| 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_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/views/passwords/manage_passwords_bubble_view.h" | 10 #include "chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h" |
| 11 #include "components/password_manager/core/common/password_manager_ui.h" | 11 #include "components/password_manager/core/common/password_manager_ui.h" |
| 12 #include "ui/base/l10n/l10n_util.h" | 12 #include "ui/base/l10n/l10n_util.h" |
| 13 #include "ui/base/resource/resource_bundle.h" | 13 #include "ui/base/resource/resource_bundle.h" |
| 14 | 14 |
| 15 ManagePasswordsIconView::ManagePasswordsIconView(CommandUpdater* updater) | 15 ManagePasswordsIconView::ManagePasswordsIconView(CommandUpdater* updater, |
| 16 : BubbleIconView(updater, IDC_MANAGE_PASSWORDS_FOR_PAGE) { | 16 Browser* browser) |
| 17 : BubbleIconView(updater, IDC_MANAGE_PASSWORDS_FOR_PAGE, browser) { |
| 17 SetFocusable(true); | 18 SetFocusable(true); |
| 18 UpdateVisibleUI(); | 19 UpdateVisibleUI(); |
| 19 } | 20 } |
| 20 | 21 |
| 21 ManagePasswordsIconView::~ManagePasswordsIconView() {} | 22 ManagePasswordsIconView::~ManagePasswordsIconView() {} |
| 22 | 23 |
| 23 void ManagePasswordsIconView::UpdateVisibleUI() { | 24 void ManagePasswordsIconView::UpdateVisibleUI() { |
| 24 if (state() == password_manager::ui::INACTIVE_STATE) { | 25 if (state() == password_manager::ui::INACTIVE_STATE) { |
| 25 SetVisible(false); | 26 SetVisible(false); |
| 26 if (ManagePasswordsBubbleView::IsShowing()) | 27 if (ManagePasswordsBubbleView::IsShowing()) |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 return true; | 68 return true; |
| 68 } | 69 } |
| 69 return BubbleIconView::OnKeyPressed(event); | 70 return BubbleIconView::OnKeyPressed(event); |
| 70 } | 71 } |
| 71 | 72 |
| 72 void ManagePasswordsIconView::AboutToRequestFocusFromTabTraversal( | 73 void ManagePasswordsIconView::AboutToRequestFocusFromTabTraversal( |
| 73 bool reverse) { | 74 bool reverse) { |
| 74 if (active()) | 75 if (active()) |
| 75 ManagePasswordsBubbleView::ActivateBubble(); | 76 ManagePasswordsBubbleView::ActivateBubble(); |
| 76 } | 77 } |
| OLD | NEW |