OLD | NEW |
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_views.h" | 5 #include "chrome/browser/ui/views/passwords/manage_passwords_icon_views.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/views/passwords/manage_passwords_bubble_view.h" | 10 #include "chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h" |
11 #include "chrome/grit/generated_resources.h" | 11 #include "chrome/grit/generated_resources.h" |
12 #include "components/password_manager/core/common/password_manager_ui.h" | 12 #include "components/password_manager/core/common/password_manager_ui.h" |
13 #include "ui/base/l10n/l10n_util.h" | 13 #include "ui/base/l10n/l10n_util.h" |
14 #include "ui/base/resource/resource_bundle.h" | 14 #include "ui/base/resource/resource_bundle.h" |
15 #include "ui/gfx/vector_icons_public.h" | 15 #include "ui/gfx/vector_icons_public.h" |
| 16 #include "ui/views/style/platform_style.h" |
16 | 17 |
17 ManagePasswordsIconViews::ManagePasswordsIconViews(CommandUpdater* updater) | 18 ManagePasswordsIconViews::ManagePasswordsIconViews(CommandUpdater* updater) |
18 : BubbleIconView(updater, IDC_MANAGE_PASSWORDS_FOR_PAGE), | 19 : BubbleIconView(updater, IDC_MANAGE_PASSWORDS_FOR_PAGE), |
19 state_(password_manager::ui::INACTIVE_STATE) { | 20 state_(password_manager::ui::INACTIVE_STATE) { |
20 SetFocusable(true); | 21 views::PlatformStyle::ConfigureFocus(views::PlatformStyle::CONTROL::ICON, |
| 22 this); |
21 UpdateUiForState(); | 23 UpdateUiForState(); |
22 } | 24 } |
23 | 25 |
24 ManagePasswordsIconViews::~ManagePasswordsIconViews() {} | 26 ManagePasswordsIconViews::~ManagePasswordsIconViews() {} |
25 | 27 |
26 void ManagePasswordsIconViews::SetState(password_manager::ui::State state) { | 28 void ManagePasswordsIconViews::SetState(password_manager::ui::State state) { |
27 if (state_ == state) | 29 if (state_ == state) |
28 return; | 30 return; |
29 // If there is an opened bubble for the current icon it should go away. | 31 // If there is an opened bubble for the current icon it should go away. |
30 ManagePasswordsBubbleView::CloseCurrentBubble(); | 32 ManagePasswordsBubbleView::CloseCurrentBubble(); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 82 |
81 gfx::VectorIconId ManagePasswordsIconViews::GetVectorIcon() const { | 83 gfx::VectorIconId ManagePasswordsIconViews::GetVectorIcon() const { |
82 return gfx::VectorIconId::AUTOLOGIN; | 84 return gfx::VectorIconId::AUTOLOGIN; |
83 } | 85 } |
84 | 86 |
85 void ManagePasswordsIconViews::AboutToRequestFocusFromTabTraversal( | 87 void ManagePasswordsIconViews::AboutToRequestFocusFromTabTraversal( |
86 bool reverse) { | 88 bool reverse) { |
87 if (IsBubbleShowing()) | 89 if (IsBubbleShowing()) |
88 ManagePasswordsBubbleView::ActivateBubble(); | 90 ManagePasswordsBubbleView::ActivateBubble(); |
89 } | 91 } |
OLD | NEW |