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

Unified Diff: chrome/browser/ui/views/translate/translate_bubble_view.cc

Issue 1967743002: Temp fix for blank view. Somehow the third calls to AddIconToLayout() cause this strange bug. Tried… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add comments adn also remove the icon from the error view Created 4 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/translate/translate_bubble_view.cc
diff --git a/chrome/browser/ui/views/translate/translate_bubble_view.cc b/chrome/browser/ui/views/translate/translate_bubble_view.cc
index 6b4dba941d56d103489d88e2e49abdd103dbe5a1..12753f9e0743694c252f6fb23ba710f6ffd4e273 100644
--- a/chrome/browser/ui/views/translate/translate_bubble_view.cc
+++ b/chrome/browser/ui/views/translate/translate_bubble_view.cc
@@ -85,6 +85,10 @@ views::Link* CreateLink(views::LinkListener* listener,
return CreateLink(listener, l10n_util::GetStringUTF16(resource_id), id);
}
+// Somehow the third views calling AddIconToLayout show blank as in
msw 2016/05/10 20:43:21 This comment isn't very good. What does "third vie
ftang 2016/05/10 21:17:26 Any third view (regardless which one) show the ico
ftang 2016/05/10 21:17:26 Done.
+// https://bugs.chromium.org/p/chromium/issues/detail?id=610351
+// We cannot figure out what is going on under the hook. Caching the Skia in
+// a global variable didn't help.
void AddIconToLayout(views::GridLayout* layout) {
views::ImageView* icon = new views::ImageView();
ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
@@ -703,11 +707,6 @@ views::View* TranslateBubbleView::CreateViewAfterTranslate() {
};
views::ColumnSet* cs = layout->AddColumnSet(COLUMN_SET_ID_MESSAGE);
- if (Use2016Q2UI()) {
- cs->AddColumn(GridLayout::LEADING, GridLayout::CENTER, 0,
- GridLayout::USE_PREF, 0, 0);
- cs->AddPaddingColumn(0, views::kRelatedButtonHSpacing);
- }
cs->AddColumn(GridLayout::LEADING, GridLayout::CENTER, 0,
GridLayout::USE_PREF, 0, 0);
cs->AddPaddingColumn(0, views::kRelatedButtonHSpacing);
@@ -721,8 +720,6 @@ views::View* TranslateBubbleView::CreateViewAfterTranslate() {
GridLayout::USE_PREF, 0, 0);
layout->StartRow(0, COLUMN_SET_ID_MESSAGE);
- if (Use2016Q2UI())
- AddIconToLayout(layout);
layout->AddView(label);
layout->AddView(
CreateLink(this, IDS_TRANSLATE_BUBBLE_ADVANCED, LINK_ID_ADVANCED));
@@ -753,11 +750,6 @@ views::View* TranslateBubbleView::CreateViewError() {
};
views::ColumnSet* cs = layout->AddColumnSet(COLUMN_SET_ID_MESSAGE);
- if (Use2016Q2UI()) {
- cs->AddColumn(GridLayout::LEADING, GridLayout::CENTER, 0,
- GridLayout::USE_PREF, 0, 0);
- cs->AddPaddingColumn(0, views::kRelatedButtonHSpacing);
- }
cs->AddColumn(GridLayout::LEADING, GridLayout::CENTER, 0,
GridLayout::USE_PREF, 0, 0);
cs->AddPaddingColumn(0, views::kRelatedButtonHSpacing);
@@ -771,8 +763,6 @@ views::View* TranslateBubbleView::CreateViewError() {
GridLayout::USE_PREF, 0, 0);
layout->StartRow(0, COLUMN_SET_ID_MESSAGE);
- if (Use2016Q2UI())
- AddIconToLayout(layout);
layout->AddView(label);
layout->AddView(
CreateLink(this, IDS_TRANSLATE_BUBBLE_ADVANCED, LINK_ID_ADVANCED));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698