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

Side by Side Diff: chrome/browser/ui/views/outdated_upgrade_bubble_view.cc

Issue 941133002: Update global error bubble view's boundary (position and size) after loading elevation icon. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/views/infobars/confirm_infobar.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/outdated_upgrade_bubble_view.h" 5 #include "chrome/browser/ui/views/outdated_upgrade_bubble_view.h"
6 6
7 #include "base/metrics/histogram.h" 7 #include "base/metrics/histogram.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/ui/views/elevation_icon_setter.h" 10 #include "chrome/browser/ui/views/elevation_icon_setter.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 } 103 }
104 104
105 void OutdatedUpgradeBubbleView::Init() { 105 void OutdatedUpgradeBubbleView::Init() {
106 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 106 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
107 accept_button_ = new views::LabelButton( 107 accept_button_ = new views::LabelButton(
108 this, l10n_util::GetStringUTF16( 108 this, l10n_util::GetStringUTF16(
109 auto_update_enabled_ ? IDS_REINSTALL_APP : IDS_REENABLE_UPDATES)); 109 auto_update_enabled_ ? IDS_REINSTALL_APP : IDS_REENABLE_UPDATES));
110 accept_button_->SetStyle(views::Button::STYLE_BUTTON); 110 accept_button_->SetStyle(views::Button::STYLE_BUTTON);
111 accept_button_->SetIsDefault(true); 111 accept_button_->SetIsDefault(true);
112 accept_button_->SetFontList(rb.GetFontList(ui::ResourceBundle::BoldFont)); 112 accept_button_->SetFontList(rb.GetFontList(ui::ResourceBundle::BoldFont));
113 elevation_icon_setter_.reset(new ElevationIconSetter(accept_button_)); 113 elevation_icon_setter_.reset(new ElevationIconSetter(
114 accept_button_,
115 base::Bind(&OutdatedUpgradeBubbleView::SizeToContents,
116 base::Unretained(this))));
114 117
115 later_button_ = new views::LabelButton( 118 later_button_ = new views::LabelButton(
116 this, l10n_util::GetStringUTF16(IDS_LATER)); 119 this, l10n_util::GetStringUTF16(IDS_LATER));
117 later_button_->SetStyle(views::Button::STYLE_BUTTON); 120 later_button_->SetStyle(views::Button::STYLE_BUTTON);
118 121
119 views::Label* title_label = new views::Label( 122 views::Label* title_label = new views::Label(
120 l10n_util::GetStringUTF16(IDS_UPGRADE_BUBBLE_TITLE)); 123 l10n_util::GetStringUTF16(IDS_UPGRADE_BUBBLE_TITLE));
121 title_label->SetFontList(rb.GetFontList(ui::ResourceBundle::MediumFont)); 124 title_label->SetFontList(rb.GetFontList(ui::ResourceBundle::MediumFont));
122 title_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); 125 title_label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
123 126
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 base::Bind(&google_update::ElevateIfNeededToReenableUpdates)); 238 base::Bind(&google_update::ElevateIfNeededToReenableUpdates));
236 #endif // defined(OS_WIN) 239 #endif // defined(OS_WIN)
237 } 240 }
238 } else { 241 } else {
239 DCHECK_EQ(later_button_, sender); 242 DCHECK_EQ(later_button_, sender);
240 content::RecordAction( 243 content::RecordAction(
241 base::UserMetricsAction("OutdatedUpgradeBubble.Later")); 244 base::UserMetricsAction("OutdatedUpgradeBubble.Later"));
242 } 245 }
243 GetWidget()->Close(); 246 GetWidget()->Close();
244 } 247 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/infobars/confirm_infobar.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698