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

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

Issue 2832913002: Harmonizing SmartLock dialog (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 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/metrics/user_metrics.h" 8 #include "base/metrics/user_metrics.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "base/timer/timer.h" 10 #include "base/timer/timer.h"
11 #include "chrome/browser/profiles/profile.h" 11 #include "chrome/browser/profiles/profile.h"
12 #include "chrome/browser/ui/browser.h" 12 #include "chrome/browser/ui/browser.h"
13 #include "chrome/browser/ui/browser_finder.h" 13 #include "chrome/browser/ui/browser_finder.h"
14 #include "chrome/browser/ui/exclusive_access/fullscreen_controller.h" 14 #include "chrome/browser/ui/exclusive_access/fullscreen_controller.h"
15 #include "chrome/browser/ui/passwords/password_dialog_prompts.h" 15 #include "chrome/browser/ui/passwords/password_dialog_prompts.h"
16 #include "chrome/browser/ui/passwords/passwords_model_delegate.h" 16 #include "chrome/browser/ui/passwords/passwords_model_delegate.h"
17 #include "chrome/browser/ui/views/frame/browser_view.h" 17 #include "chrome/browser/ui/views/frame/browser_view.h"
18 #include "chrome/browser/ui/views/harmony/chrome_layout_provider.h"
18 #include "chrome/browser/ui/views/passwords/credentials_item_view.h" 19 #include "chrome/browser/ui/views/passwords/credentials_item_view.h"
19 #include "chrome/browser/ui/views/passwords/credentials_selection_view.h" 20 #include "chrome/browser/ui/views/passwords/credentials_selection_view.h"
20 #include "chrome/browser/ui/views/passwords/manage_password_items_view.h" 21 #include "chrome/browser/ui/views/passwords/manage_password_items_view.h"
21 #include "chrome/browser/ui/views/passwords/manage_passwords_icon_views.h" 22 #include "chrome/browser/ui/views/passwords/manage_passwords_icon_views.h"
22 #include "chrome/grit/generated_resources.h" 23 #include "chrome/grit/generated_resources.h"
23 #include "components/strings/grit/components_strings.h" 24 #include "components/strings/grit/components_strings.h"
24 #include "ui/base/l10n/l10n_util.h" 25 #include "ui/base/l10n/l10n_util.h"
25 #include "ui/base/material_design/material_design_controller.h" 26 #include "ui/base/material_design/material_design_controller.h"
26 #include "ui/base/resource/resource_bundle.h" 27 #include "ui/base/resource/resource_bundle.h"
27 #include "ui/gfx/color_palette.h" 28 #include "ui/gfx/color_palette.h"
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 216
216 DISALLOW_COPY_AND_ASSIGN(AutoSigninView); 217 DISALLOW_COPY_AND_ASSIGN(AutoSigninView);
217 }; 218 };
218 219
219 ManagePasswordsBubbleView::AutoSigninView::AutoSigninView( 220 ManagePasswordsBubbleView::AutoSigninView::AutoSigninView(
220 ManagePasswordsBubbleView* parent) 221 ManagePasswordsBubbleView* parent)
221 : parent_(parent), 222 : parent_(parent),
222 observed_browser_(this) { 223 observed_browser_(this) {
223 SetLayoutManager(new views::FillLayout); 224 SetLayoutManager(new views::FillLayout);
224 const autofill::PasswordForm& form = parent_->model()->pending_password(); 225 const autofill::PasswordForm& form = parent_->model()->pending_password();
225 CredentialsItemView* credential = new CredentialsItemView( 226 CredentialsItemView* credential;
226 this, base::string16(), 227 if (ChromeLayoutProvider::Get()->IsHarmonyMode()) {
227 l10n_util::GetStringFUTF16(IDS_MANAGE_PASSWORDS_AUTO_SIGNIN_TITLE, 228 credential = new CredentialsItemView(
228 form.username_value), 229 this,
229 kButtonHoverColor, &form, 230 l10n_util::GetStringFUTF16(IDS_MANAGE_PASSWORDS_AUTO_SIGNIN_TITLE,
vabr (Chromium) 2017/04/21 14:28:15 Inserting an empty string here seems to be a bit o
kylix_rd 2017/04/21 16:17:30 That thought had crossed my mind. Next patch has t
230 parent_->model()->GetProfile()->GetRequestContext()); 231 base::string16()),
232 form.username_value, kButtonHoverColor, &form,
233 parent_->model()->GetProfile()->GetRequestContext());
234 } else {
235 credential = new CredentialsItemView(
236 this, base::string16(),
237 l10n_util::GetStringFUTF16(IDS_MANAGE_PASSWORDS_AUTO_SIGNIN_TITLE,
238 form.username_value),
239 kButtonHoverColor, &form,
240 parent_->model()->GetProfile()->GetRequestContext());
241 }
231 credential->SetEnabled(false); 242 credential->SetEnabled(false);
232 AddChildView(credential); 243 AddChildView(credential);
233 244
234 // Setup the observer and maybe start the timer. 245 // Setup the observer and maybe start the timer.
235 Browser* browser = 246 Browser* browser =
236 chrome::FindBrowserWithWebContents(parent_->web_contents()); 247 chrome::FindBrowserWithWebContents(parent_->web_contents());
237 DCHECK(browser); 248 DCHECK(browser);
238 BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser); 249 BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser);
239 observed_browser_.Add(browser_view->GetWidget()); 250 observed_browser_.Add(browser_view->GetWidget());
240 251
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
857 } else if (model_.state() == 868 } else if (model_.state() ==
858 password_manager::ui::CHROME_DESKTOP_IOS_PROMO_STATE) { 869 password_manager::ui::CHROME_DESKTOP_IOS_PROMO_STATE) {
859 AddChildView(new DesktopIOSPromotionBubbleView( 870 AddChildView(new DesktopIOSPromotionBubbleView(
860 model_.GetProfile(), 871 model_.GetProfile(),
861 desktop_ios_promotion::PromotionEntryPoint::SAVE_PASSWORD_BUBBLE)); 872 desktop_ios_promotion::PromotionEntryPoint::SAVE_PASSWORD_BUBBLE));
862 #endif 873 #endif
863 } else { 874 } else {
864 AddChildView(new ManageView(this)); 875 AddChildView(new ManageView(this));
865 } 876 }
866 } 877 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698