sunfish: Update search results panel title.
Update panel title according to strings doc, mark it as translateable, and set it as the panel window's title. Bug: b:401570359 Change-Id: I23d95594f27bb167d68504515b6a4288d852b856 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6347738 Commit-Queue: Michelle Chen <michellegc@google.com> Reviewed-by: Ahmed Fakhry <afakhry@chromium.org> Cr-Commit-Position: refs/heads/main@{#1432439}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
de178865bc
commit
a528d3bac4
ash
@ -6856,6 +6856,9 @@ Here are some things you can try to get started.
|
||||
<message name="IDS_ASH_SCREEN_CAPTURE_EDUCATION_SETTINGS_NUDGE_LABEL" desc="The label of the Screen Capture Education settings nudge (Arm 3) for using the quick settings menu.">
|
||||
Use the screen capture tool in quick settings to take screenshots
|
||||
</message>
|
||||
<message name="IDS_ASH_SCREEN_CAPTURE_SEARCH_RESULTS_PANEL_TITLE" desc="The title of the panel that shows Google Search results when the user searches a selected region on their screen.">
|
||||
Google Search
|
||||
</message>
|
||||
<message name="IDS_ASH_SCREEN_CAPTURE_COPY_TEXT_BUTTON_LABEL" desc="The label on a button that can be clicked to copy text from the contents of a screenshot into the user's clipboard.">
|
||||
Copy text
|
||||
</message>
|
||||
|
@ -0,0 +1 @@
|
||||
b77c3e83f84550508c866d9cc4abdd6d313c60a7
|
@ -15,9 +15,11 @@
|
||||
#include "ash/public/cpp/style/color_provider.h"
|
||||
#include "ash/resources/vector_icons/vector_icons.h"
|
||||
#include "ash/shell.h"
|
||||
#include "ash/strings/grit/ash_strings.h"
|
||||
#include "ash/style/icon_button.h"
|
||||
#include "ash/style/typography.h"
|
||||
#include "components/vector_icons/vector_icons.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
#include "ui/base/metadata/metadata_impl_macros.h"
|
||||
#include "ui/base/models/image_model.h"
|
||||
#include "ui/chromeos/styles/cros_tokens_color_mappings.h"
|
||||
@ -33,6 +35,7 @@
|
||||
#include "ui/views/controls/textfield/textfield_controller.h"
|
||||
#include "ui/views/focus/focus_manager.h"
|
||||
#include "ui/views/layout/flex_layout_view.h"
|
||||
#include "ui/views/widget/widget_delegate.h"
|
||||
#include "ui/wm/core/coordinate_conversion.h"
|
||||
#include "ui/wm/core/shadow_types.h"
|
||||
|
||||
@ -64,6 +67,11 @@ aura::Window* GetParentContainer(aura::Window* root, bool is_active) {
|
||||
: kShellWindowId_SystemModalContainer);
|
||||
}
|
||||
|
||||
std::u16string GetSearchResultsPanelTitle() {
|
||||
return l10n_util::GetStringUTF16(
|
||||
IDS_ASH_SCREEN_CAPTURE_SEARCH_RESULTS_PANEL_TITLE);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
// TODO: crbug.com/377764351 - Fix the textfield being too far to the left when
|
||||
@ -190,7 +198,7 @@ SearchResultsPanel::SearchResultsPanel() {
|
||||
.SetProperty(views::kMarginsKey, kHeaderIconSpacing),
|
||||
// Title.
|
||||
views::Builder<views::Label>()
|
||||
.SetText(u"Search with Lens")
|
||||
.SetText(GetSearchResultsPanelTitle())
|
||||
.SetHorizontalAlignment(gfx::HorizontalAlignment::ALIGN_LEFT)
|
||||
.SetFontList(
|
||||
TypographyProvider::Get()->ResolveTypographyToken(
|
||||
@ -281,6 +289,7 @@ views::UniqueWidgetPtr SearchResultsPanel::CreateWidget(aura::Window* root,
|
||||
params.name = "SearchResultsPanelWidget";
|
||||
auto widget = std::make_unique<views::Widget>(std::move(params));
|
||||
widget->SetContentsView(std::make_unique<SearchResultsPanel>());
|
||||
widget->widget_delegate()->SetTitle(GetSearchResultsPanelTitle());
|
||||
return widget;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user