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/browser/ui/passwords/manage_passwords_bubble_ui_controller.h" | 7 #include "chrome/browser/ui/passwords/manage_passwords_bubble_ui_controller.h" |
8 #include "chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h" | 8 #include "chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h" |
9 #include "grit/generated_resources.h" | 9 #include "grit/generated_resources.h" |
10 #include "grit/theme_resources.h" | 10 #include "grit/theme_resources.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 ManagePasswordsIconView::~ManagePasswordsIconView() {} | 22 ManagePasswordsIconView::~ManagePasswordsIconView() {} |
23 | 23 |
24 void ManagePasswordsIconView::Update( | 24 void ManagePasswordsIconView::Update( |
25 ManagePasswordsBubbleUIController* manage_passwords_bubble_ui_controller) { | 25 ManagePasswordsBubbleUIController* manage_passwords_bubble_ui_controller) { |
26 SetVisible(manage_passwords_bubble_ui_controller && | 26 SetVisible(manage_passwords_bubble_ui_controller && |
27 manage_passwords_bubble_ui_controller-> | 27 manage_passwords_bubble_ui_controller-> |
28 manage_passwords_icon_to_be_shown() && | 28 manage_passwords_icon_to_be_shown() && |
29 !location_bar_delegate_->GetToolbarModel()->input_in_progress()); | 29 !location_bar_delegate_->GetToolbarModel()->input_in_progress()); |
30 if (!visible()) { | 30 if (!visible()) { |
31 ManagePasswordsBubbleView::CloseBubble( | 31 ManagePasswordsBubbleView::CloseBubble(); |
32 password_manager::metrics_util::NOT_DISPLAYED); | |
33 return; | 32 return; |
34 } | 33 } |
35 int icon_to_display = | 34 int icon_to_display = |
36 manage_passwords_bubble_ui_controller->autofill_blocked() | 35 manage_passwords_bubble_ui_controller->autofill_blocked() |
37 ? IDR_SAVE_PASSWORD_BLACKLISTED | 36 ? IDR_SAVE_PASSWORD_BLACKLISTED |
38 : IDR_SAVE_PASSWORD; | 37 : IDR_SAVE_PASSWORD; |
39 SetImage(ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( | 38 SetImage(ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( |
40 icon_to_display)); | 39 icon_to_display)); |
41 SetTooltip(manage_passwords_bubble_ui_controller->password_to_be_saved()); | 40 SetTooltip(manage_passwords_bubble_ui_controller->password_to_be_saved()); |
42 } | 41 } |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 } | 84 } |
86 | 85 |
87 void ManagePasswordsIconView::OnMouseReleased(const ui::MouseEvent& event) { | 86 void ManagePasswordsIconView::OnMouseReleased(const ui::MouseEvent& event) { |
88 if (event.IsOnlyLeftMouseButton() && HitTestPoint(event.location())) { | 87 if (event.IsOnlyLeftMouseButton() && HitTestPoint(event.location())) { |
89 ManagePasswordsBubbleView::ShowBubble( | 88 ManagePasswordsBubbleView::ShowBubble( |
90 location_bar_delegate_->GetWebContents(), | 89 location_bar_delegate_->GetWebContents(), |
91 this, | 90 this, |
92 ManagePasswordsBubbleView::USER_ACTION); | 91 ManagePasswordsBubbleView::USER_ACTION); |
93 } | 92 } |
94 } | 93 } |
OLD | NEW |