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

Side by Side Diff: chrome/browser/ui/views/passwords/auto_signin_first_run_dialog_view.cc

Issue 2785683003: views: implement width snapping for DialogDelegateViews (Closed)
Patch Set: Created 3 years, 8 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/passwords/auto_signin_first_run_dialog_view.h" 5 #include "chrome/browser/ui/views/passwords/auto_signin_first_run_dialog_view.h"
6 6
7 #include "chrome/browser/ui/passwords/password_dialog_controller.h" 7 #include "chrome/browser/ui/passwords/password_dialog_controller.h"
8 #include "chrome/grit/generated_resources.h" 8 #include "chrome/grit/generated_resources.h"
9 #include "components/constrained_window/constrained_window_views.h" 9 #include "components/constrained_window/constrained_window_views.h"
10 #include "ui/base/l10n/l10n_util.h" 10 #include "ui/base/l10n/l10n_util.h"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 if (controller_) 109 if (controller_)
110 controller_->OnCloseDialog(); 110 controller_->OnCloseDialog();
111 } 111 }
112 112
113 int AutoSigninFirstRunDialogView::GetDialogButtons() const { 113 int AutoSigninFirstRunDialogView::GetDialogButtons() const {
114 // None because ESC is equivalent to Cancel. It shouldn't turn off the auto 114 // None because ESC is equivalent to Cancel. It shouldn't turn off the auto
115 // signin. 115 // signin.
116 return ui::DIALOG_BUTTON_NONE; 116 return ui::DIALOG_BUTTON_NONE;
117 } 117 }
118 118
119 gfx::Size AutoSigninFirstRunDialogView::GetPreferredSize() const { 119 gfx::Size AutoSigninFirstRunDialogView::GetUnsnappedPreferredSize() const {
120 return gfx::Size(kDesiredWidth, GetHeightForWidth(kDesiredWidth)); 120 return gfx::Size(kDesiredWidth, GetHeightForWidth(kDesiredWidth));
121 } 121 }
122 122
123 void AutoSigninFirstRunDialogView::ButtonPressed(views::Button* sender, 123 void AutoSigninFirstRunDialogView::ButtonPressed(views::Button* sender,
124 const ui::Event& event) { 124 const ui::Event& event) {
125 if (sender == ok_button_) 125 if (sender == ok_button_)
126 controller_->OnAutoSigninOK(); 126 controller_->OnAutoSigninOK();
127 else if (sender == turn_off_button_) 127 else if (sender == turn_off_button_)
128 controller_->OnAutoSigninTurnOff(); 128 controller_->OnAutoSigninTurnOff();
129 else 129 else
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 this, l10n_util::GetStringUTF16(IDS_AUTO_SIGNIN_FIRST_RUN_TURN_OFF)); 180 this, l10n_util::GetStringUTF16(IDS_AUTO_SIGNIN_FIRST_RUN_TURN_OFF));
181 layout->AddView(ok_button_); 181 layout->AddView(ok_button_);
182 layout->AddView(turn_off_button_); 182 layout->AddView(turn_off_button_);
183 layout->AddPaddingRow(0, views::kButtonVEdgeMarginNew); 183 layout->AddPaddingRow(0, views::kButtonVEdgeMarginNew);
184 } 184 }
185 185
186 AutoSigninFirstRunPrompt* CreateAutoSigninPromptView( 186 AutoSigninFirstRunPrompt* CreateAutoSigninPromptView(
187 PasswordDialogController* controller, content::WebContents* web_contents) { 187 PasswordDialogController* controller, content::WebContents* web_contents) {
188 return new AutoSigninFirstRunDialogView(controller, web_contents); 188 return new AutoSigninFirstRunDialogView(controller, web_contents);
189 } 189 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698