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

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

Issue 2382443007: Clean up NativeTheme (particularly CommonTheme). (Closed)
Patch Set: two slight fixes Created 4 years, 2 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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/passwords/manage_passwords_bubble_view.h" 5 #include "chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "base/timer/timer.h" 9 #include "base/timer/timer.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
11 #include "chrome/browser/ui/browser.h" 11 #include "chrome/browser/ui/browser.h"
12 #include "chrome/browser/ui/browser_finder.h" 12 #include "chrome/browser/ui/browser_finder.h"
13 #include "chrome/browser/ui/exclusive_access/fullscreen_controller.h" 13 #include "chrome/browser/ui/exclusive_access/fullscreen_controller.h"
14 #include "chrome/browser/ui/passwords/password_dialog_prompts.h"
14 #include "chrome/browser/ui/passwords/passwords_model_delegate.h" 15 #include "chrome/browser/ui/passwords/passwords_model_delegate.h"
15 #include "chrome/browser/ui/views/frame/browser_view.h" 16 #include "chrome/browser/ui/views/frame/browser_view.h"
16 #include "chrome/browser/ui/views/passwords/credentials_item_view.h" 17 #include "chrome/browser/ui/views/passwords/credentials_item_view.h"
17 #include "chrome/browser/ui/views/passwords/credentials_selection_view.h" 18 #include "chrome/browser/ui/views/passwords/credentials_selection_view.h"
18 #include "chrome/browser/ui/views/passwords/manage_password_items_view.h" 19 #include "chrome/browser/ui/views/passwords/manage_password_items_view.h"
19 #include "chrome/browser/ui/views/passwords/manage_passwords_icon_views.h" 20 #include "chrome/browser/ui/views/passwords/manage_passwords_icon_views.h"
20 #include "chrome/grit/generated_resources.h" 21 #include "chrome/grit/generated_resources.h"
21 #include "components/strings/grit/components_strings.h" 22 #include "components/strings/grit/components_strings.h"
22 #include "content/public/browser/user_metrics.h" 23 #include "content/public/browser/user_metrics.h"
23 #include "ui/base/l10n/l10n_util.h" 24 #include "ui/base/l10n/l10n_util.h"
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 DISALLOW_COPY_AND_ASSIGN(AutoSigninView); 212 DISALLOW_COPY_AND_ASSIGN(AutoSigninView);
212 }; 213 };
213 214
214 ManagePasswordsBubbleView::AutoSigninView::AutoSigninView( 215 ManagePasswordsBubbleView::AutoSigninView::AutoSigninView(
215 ManagePasswordsBubbleView* parent) 216 ManagePasswordsBubbleView* parent)
216 : parent_(parent), 217 : parent_(parent),
217 observed_browser_(this) { 218 observed_browser_(this) {
218 SetLayoutManager(new views::FillLayout); 219 SetLayoutManager(new views::FillLayout);
219 const autofill::PasswordForm& form = parent_->model()->pending_password(); 220 const autofill::PasswordForm& form = parent_->model()->pending_password();
220 CredentialsItemView* credential = new CredentialsItemView( 221 CredentialsItemView* credential = new CredentialsItemView(
221 this, 222 this, base::string16(),
222 base::string16(),
223 l10n_util::GetStringFUTF16(IDS_MANAGE_PASSWORDS_AUTO_SIGNIN_TITLE, 223 l10n_util::GetStringFUTF16(IDS_MANAGE_PASSWORDS_AUTO_SIGNIN_TITLE,
224 form.username_value), 224 form.username_value),
225 GetNativeTheme()->GetSystemColor( 225 kButtonHoverColor, &form,
226 ui::NativeTheme::kColorId_ButtonBackgroundColor),
Evan Stade 2016/09/30 18:02:36 this is a subtle behavior change but I think it im
tdanderson 2016/09/30 21:00:56 Acknowledged.
227 &form,
228 parent_->model()->GetProfile()->GetRequestContext()); 226 parent_->model()->GetProfile()->GetRequestContext());
229 credential->SetEnabled(false); 227 credential->SetEnabled(false);
230 AddChildView(credential); 228 AddChildView(credential);
231 229
232 // Setup the observer and maybe start the timer. 230 // Setup the observer and maybe start the timer.
233 Browser* browser = 231 Browser* browser =
234 chrome::FindBrowserWithWebContents(parent_->web_contents()); 232 chrome::FindBrowserWithWebContents(parent_->web_contents());
235 DCHECK(browser); 233 DCHECK(browser);
236 BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser); 234 BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser);
237 observed_browser_.Add(browser_view->GetWidget()); 235 observed_browser_.Add(browser_view->GetWidget());
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after
832 AddChildView(new SaveConfirmationView(this)); 830 AddChildView(new SaveConfirmationView(this));
833 } else if (model_.state() == password_manager::ui::AUTO_SIGNIN_STATE) { 831 } else if (model_.state() == password_manager::ui::AUTO_SIGNIN_STATE) {
834 AddChildView(new AutoSigninView(this)); 832 AddChildView(new AutoSigninView(this));
835 } else if (model_.state() == 833 } else if (model_.state() ==
836 password_manager::ui::CHROME_SIGN_IN_PROMO_STATE) { 834 password_manager::ui::CHROME_SIGN_IN_PROMO_STATE) {
837 AddChildView(new SignInPromoView(this)); 835 AddChildView(new SignInPromoView(this));
838 } else { 836 } else {
839 AddChildView(new ManageView(this)); 837 AddChildView(new ManageView(this));
840 } 838 }
841 } 839 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698