Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2454)

Unified Diff: chrome/browser/ui/views/extensions/bookmark_app_bubble_view.cc

Issue 932023002: Use the correct title for the bookmark app bubble. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix mac Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/extensions/bookmark_app_bubble_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/extensions/bookmark_app_bubble_view.cc
diff --git a/chrome/browser/ui/views/extensions/bookmark_app_bubble_view.cc b/chrome/browser/ui/views/extensions/bookmark_app_bubble_view.cc
index 71df060155324decf47f59a7444d231554c2b78f..46f8d15f3b2ab4e27c137782375da1760d0c5009 100644
--- a/chrome/browser/ui/views/extensions/bookmark_app_bubble_view.cc
+++ b/chrome/browser/ui/views/extensions/bookmark_app_bubble_view.cc
@@ -7,6 +7,7 @@
#include "base/strings/string16.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
+#include "chrome/browser/ui/host_desktop.h"
#include "chrome/grit/generated_resources.h"
#include "content/public/browser/web_contents.h"
#include "extensions/common/constants.h"
@@ -102,7 +103,7 @@ BookmarkAppBubbleView::BookmarkAppBubbleView(
void BookmarkAppBubbleView::Init() {
views::Label* title_label = new views::Label(
- l10n_util::GetStringUTF16(IDS_BOOKMARK_APP_BUBBLE_TITLE));
+ l10n_util::GetStringUTF16(TitleStringId()));
ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance();
title_label->SetFontList(rb->GetFontList(ui::ResourceBundle::MediumFont));
title_label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
@@ -218,7 +219,7 @@ bool BookmarkAppBubbleView::AcceleratorPressed(
void BookmarkAppBubbleView::GetAccessibleState(ui::AXViewState* state) {
views::BubbleDelegateView::GetAccessibleState(state);
- state->name = l10n_util::GetStringUTF16(IDS_BOOKMARK_APP_BUBBLE_TITLE);
+ state->name = l10n_util::GetStringUTF16(TitleStringId());
}
gfx::Size BookmarkAppBubbleView::GetMinimumSize() const {
@@ -253,6 +254,22 @@ void BookmarkAppBubbleView::UpdateAddButtonState() {
add_button_->SetEnabled(!GetTrimmedTitle().empty());
}
+int BookmarkAppBubbleView::TitleStringId() {
+#if defined(OS_WIN)
+ int string_id = IDS_ADD_TO_TASKBAR_BUBBLE_TITLE;
+#else
+ int string_id = IDS_ADD_TO_DESKTOP_BUBBLE_TITLE;
+#endif
+#if defined(USE_ASH)
+ if (chrome::GetHostDesktopTypeForNativeWindow(
+ anchor_widget()->GetNativeWindow()) ==
+ chrome::HOST_DESKTOP_TYPE_ASH) {
+ string_id = IDS_ADD_TO_SHELF_BUBBLE_TITLE;
+ }
+#endif
+ return string_id;
+}
+
base::string16 BookmarkAppBubbleView::GetTrimmedTitle() {
base::string16 title(title_tf_->text());
base::TrimWhitespace(title, base::TRIM_ALL, &title);
« no previous file with comments | « chrome/browser/ui/views/extensions/bookmark_app_bubble_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698