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

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

Issue 322253006: Password bubble: Add an "active" icon state, and a new disabled icon. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 500s. Created 6 years, 6 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 | Annotate | Revision Log
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_icon_view.h" 5 #include "chrome/browser/ui/views/passwords/manage_passwords_icon_view.h"
6 6
7 #include "chrome/app/chrome_command_ids.h" 7 #include "chrome/app/chrome_command_ids.h"
8 #include "chrome/browser/command_updater.h" 8 #include "chrome/browser/command_updater.h"
9 #include "chrome/browser/ui/passwords/manage_passwords_ui_controller.h" 9 #include "chrome/browser/ui/passwords/manage_passwords_ui_controller.h"
10 #include "chrome/browser/ui/view_ids.h" 10 #include "chrome/browser/ui/view_ids.h"
(...skipping 23 matching lines...) Expand all
34 tooltip_text_id_ = 0; 34 tooltip_text_id_ = 0;
35 35
36 SetVisible(false); 36 SetVisible(false);
37 if (ManagePasswordsBubbleView::IsShowing()) 37 if (ManagePasswordsBubbleView::IsShowing())
38 ManagePasswordsBubbleView::CloseBubble(); 38 ManagePasswordsBubbleView::CloseBubble();
39 return; 39 return;
40 } 40 }
41 41
42 // Otherwise, start with the correct values for MANAGE_STATE, and adjust 42 // Otherwise, start with the correct values for MANAGE_STATE, and adjust
43 // things accordingly if we're either in BLACKLIST_STATE or PENDING_STATE. 43 // things accordingly if we're either in BLACKLIST_STATE or PENDING_STATE.
44 icon_id_ = IDR_SAVE_PASSWORD; 44 icon_id_ = active() ? IDR_SAVE_PASSWORD_ACTIVE : IDR_SAVE_PASSWORD_INACTIVE;
45 tooltip_text_id_ = IDS_PASSWORD_MANAGER_TOOLTIP_MANAGE; 45 tooltip_text_id_ = IDS_PASSWORD_MANAGER_TOOLTIP_MANAGE;
46 if (state() == password_manager::ui::BLACKLIST_STATE) 46 if (state() == password_manager::ui::BLACKLIST_STATE)
47 icon_id_ = IDR_SAVE_PASSWORD_BLACKLISTED; 47 icon_id_ = active() ? IDR_SAVE_PASSWORD_DISABLED_ACTIVE
48 : IDR_SAVE_PASSWORD_DISABLED_INACTIVE;
48 else if (password_manager::ui::IsPendingState(state())) 49 else if (password_manager::ui::IsPendingState(state()))
49 tooltip_text_id_ = IDS_PASSWORD_MANAGER_TOOLTIP_SAVE; 50 tooltip_text_id_ = IDS_PASSWORD_MANAGER_TOOLTIP_SAVE;
50 51
51 SetVisible(true); 52 SetVisible(true);
52 SetImage(ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(icon_id_)); 53 SetImage(ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(icon_id_));
53 SetTooltipText(l10n_util::GetStringUTF16(tooltip_text_id_)); 54 SetTooltipText(l10n_util::GetStringUTF16(tooltip_text_id_));
54 55
55 if (password_manager::ui::PENDING_PASSWORD_AND_BUBBLE_STATE) { 56 if (password_manager::ui::PENDING_PASSWORD_AND_BUBBLE_STATE) {
56 // We're about the automatically pop up a ManagePasswordsBubbleView. 57 // We're about the automatically pop up a ManagePasswordsBubbleView.
57 // Force layout of the icon's parent now; the bubble will be incorrectly 58 // Force layout of the icon's parent now; the bubble will be incorrectly
58 // positioned otherwise, as the icon won't have been drawn into position. 59 // positioned otherwise, as the icon won't have been drawn into position.
59 parent()->Layout(); 60 parent()->Layout();
60 } 61 }
61 } 62 }
62 63
63 bool ManagePasswordsIconView::IsBubbleShowing() const { 64 bool ManagePasswordsIconView::IsBubbleShowing() const {
64 return ManagePasswordsBubbleView::IsShowing(); 65 return ManagePasswordsBubbleView::IsShowing();
65 } 66 }
66 67
67 void ManagePasswordsIconView::OnExecuting( 68 void ManagePasswordsIconView::OnExecuting(
68 BubbleIconView::ExecuteSource source) { 69 BubbleIconView::ExecuteSource source) {
69 } 70 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698