| 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" |
| 11 #include "ui/base/accessibility/accessible_view_state.h" | 11 #include "ui/base/accessibility/accessible_view_state.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( | 15 ManagePasswordsIconView::ManagePasswordsIconView( |
| 16 LocationBarView::Delegate* location_bar_delegate) | 16 LocationBarView::Delegate* location_bar_delegate) |
| 17 : location_bar_delegate_(location_bar_delegate) { | 17 : location_bar_delegate_(location_bar_delegate) { |
| 18 set_accessibility_focusable(true); | 18 SetAccessibilityFocusable(true); |
| 19 Update(NULL); | 19 Update(NULL); |
| 20 LocationBarView::InitTouchableLocationBarChildView(this); | 20 LocationBarView::InitTouchableLocationBarChildView(this); |
| 21 } | 21 } |
| 22 | 22 |
| 23 ManagePasswordsIconView::~ManagePasswordsIconView() {} | 23 ManagePasswordsIconView::~ManagePasswordsIconView() {} |
| 24 | 24 |
| 25 void ManagePasswordsIconView::Update( | 25 void ManagePasswordsIconView::Update( |
| 26 ManagePasswordsBubbleUIController* manage_passwords_bubble_ui_controller) { | 26 ManagePasswordsBubbleUIController* manage_passwords_bubble_ui_controller) { |
| 27 SetVisible(manage_passwords_bubble_ui_controller && | 27 SetVisible(manage_passwords_bubble_ui_controller && |
| 28 manage_passwords_bubble_ui_controller-> | 28 manage_passwords_bubble_ui_controller-> |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 bool ManagePasswordsIconView::OnMousePressed(const ui::MouseEvent& event) { | 74 bool ManagePasswordsIconView::OnMousePressed(const ui::MouseEvent& event) { |
| 75 // Do nothing until the mouse button is released. | 75 // Do nothing until the mouse button is released. |
| 76 return true; | 76 return true; |
| 77 } | 77 } |
| 78 | 78 |
| 79 void ManagePasswordsIconView::OnMouseReleased(const ui::MouseEvent& event) { | 79 void ManagePasswordsIconView::OnMouseReleased(const ui::MouseEvent& event) { |
| 80 if (event.IsOnlyLeftMouseButton() && HitTestPoint(event.location())) | 80 if (event.IsOnlyLeftMouseButton() && HitTestPoint(event.location())) |
| 81 ManagePasswordsBubbleView::ShowBubble( | 81 ManagePasswordsBubbleView::ShowBubble( |
| 82 location_bar_delegate_->GetWebContents(), this); | 82 location_bar_delegate_->GetWebContents(), this); |
| 83 } | 83 } |
| OLD | NEW |