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

Side by Side Diff: chrome/browser/ui/views/sync/one_click_signin_bubble_view.cc

Issue 371633002: LabelButton: cache the last computed preferred size (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 5 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/sync/one_click_signin_bubble_view.h" 5 #include "chrome/browser/ui/views/sync/one_click_signin_bubble_view.h"
6 6
7 #include "base/callback_helpers.h" 7 #include "base/callback_helpers.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "chrome/browser/ui/browser.h" 9 #include "chrome/browser/ui/browser.h"
10 #include "chrome/browser/ui/sync/one_click_signin_helper.h" 10 #include "chrome/browser/ui/sync/one_click_signin_helper.h"
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 views::LabelButton** undo_button) { 277 views::LabelButton** undo_button) {
278 base::string16 ok_label = !error_message_.empty() ? 278 base::string16 ok_label = !error_message_.empty() ?
279 l10n_util::GetStringUTF16(IDS_OK) : 279 l10n_util::GetStringUTF16(IDS_OK) :
280 l10n_util::GetStringUTF16(IDS_ONE_CLICK_SIGNIN_DIALOG_OK_BUTTON); 280 l10n_util::GetStringUTF16(IDS_ONE_CLICK_SIGNIN_DIALOG_OK_BUTTON);
281 281
282 *ok_button = new views::LabelButton(this, ok_label); 282 *ok_button = new views::LabelButton(this, ok_label);
283 (*ok_button)->SetStyle(views::Button::STYLE_BUTTON); 283 (*ok_button)->SetStyle(views::Button::STYLE_BUTTON);
284 284
285 // The default size of the buttons is too large. To allow them to be smaller 285 // The default size of the buttons is too large. To allow them to be smaller
286 // ignore the minimum default size., 286 // ignore the minimum default size.,
287 (*ok_button)->set_min_size(gfx::Size()); 287 (*ok_button)->SetMinSize(gfx::Size());
288 288
289 if (is_sync_dialog_) { 289 if (is_sync_dialog_) {
290 *undo_button = new views::LabelButton(this, base::string16()); 290 *undo_button = new views::LabelButton(this, base::string16());
291 (*undo_button)->SetStyle(views::Button::STYLE_BUTTON); 291 (*undo_button)->SetStyle(views::Button::STYLE_BUTTON);
292 (*undo_button)->set_min_size(gfx::Size()); 292 (*undo_button)->SetMinSize(gfx::Size());
293 293
294 base::string16 undo_label = 294 base::string16 undo_label =
295 l10n_util::GetStringUTF16(IDS_ONE_CLICK_SIGNIN_DIALOG_UNDO_BUTTON); 295 l10n_util::GetStringUTF16(IDS_ONE_CLICK_SIGNIN_DIALOG_UNDO_BUTTON);
296 (*undo_button)->SetText(undo_label); 296 (*undo_button)->SetText(undo_label);
297 } 297 }
298 } 298 }
299 299
300 void OneClickSigninBubbleView::InitAdvancedLink() { 300 void OneClickSigninBubbleView::InitAdvancedLink() {
301 advanced_link_ = new views::Link( 301 advanced_link_ = new views::Link(
302 l10n_util::GetStringUTF16(IDS_ONE_CLICK_SIGNIN_DIALOG_ADVANCED)); 302 l10n_util::GetStringUTF16(IDS_ONE_CLICK_SIGNIN_DIALOG_ADVANCED));
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 // we'll be destroyed asynchronously and the shown state will be checked 408 // we'll be destroyed asynchronously and the shown state will be checked
409 // before then. 409 // before then.
410 DCHECK_EQ(bubble_view_, this); 410 DCHECK_EQ(bubble_view_, this);
411 bubble_view_ = NULL; 411 bubble_view_ = NULL;
412 412
413 if (is_sync_dialog_ && !start_sync_callback_.is_null()) { 413 if (is_sync_dialog_ && !start_sync_callback_.is_null()) {
414 base::ResetAndReturn(&start_sync_callback_).Run( 414 base::ResetAndReturn(&start_sync_callback_).Run(
415 OneClickSigninSyncStarter::UNDO_SYNC); 415 OneClickSigninSyncStarter::UNDO_SYNC);
416 } 416 }
417 } 417 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/profiles/profile_reset_bubble_view.cc ('k') | ui/views/button_drag_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698