OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/location_bar/zoom_view.h" | 5 #include "chrome/browser/ui/views/location_bar/zoom_view.h" |
6 | 6 |
7 #include "chrome/browser/ui/views/browser_dialogs.h" | 7 #include "chrome/browser/ui/views/browser_dialogs.h" |
8 #include "chrome/browser/ui/views/location_bar/zoom_bubble_view.h" | 8 #include "chrome/browser/ui/views/location_bar/zoom_bubble_view.h" |
9 #include "chrome/browser/ui/view_ids.h" | 9 #include "chrome/browser/ui/view_ids.h" |
10 #include "grit/generated_resources.h" | 10 #include "grit/generated_resources.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 // Don't show tooltip if the zoom bubble is displayed. | 66 // Don't show tooltip if the zoom bubble is displayed. |
67 return !ZoomBubbleView::IsShowing() && ImageView::GetTooltipText(p, tooltip); | 67 return !ZoomBubbleView::IsShowing() && ImageView::GetTooltipText(p, tooltip); |
68 } | 68 } |
69 | 69 |
70 bool ZoomView::OnMousePressed(const views::MouseEvent& event) { | 70 bool ZoomView::OnMousePressed(const views::MouseEvent& event) { |
71 // Do nothing until mouse is released. | 71 // Do nothing until mouse is released. |
72 return true; | 72 return true; |
73 } | 73 } |
74 | 74 |
75 void ZoomView::OnMouseReleased(const views::MouseEvent& event) { | 75 void ZoomView::OnMouseReleased(const views::MouseEvent& event) { |
76 if (event.IsOnlyLeftMouseButton() && HitTest(event.location())) { | 76 if (event.IsOnlyLeftMouseButton() && HitTestPoint(event.location())) { |
77 ZoomBubbleView::ShowBubble( | 77 ZoomBubbleView::ShowBubble( |
78 this, location_bar_delegate_->GetTabContents(), false); | 78 this, location_bar_delegate_->GetTabContents(), false); |
79 } | 79 } |
80 } | 80 } |
81 | 81 |
82 bool ZoomView::OnKeyPressed(const views::KeyEvent& event) { | 82 bool ZoomView::OnKeyPressed(const views::KeyEvent& event) { |
83 if (event.key_code() != ui::VKEY_SPACE && | 83 if (event.key_code() != ui::VKEY_SPACE && |
84 event.key_code() != ui::VKEY_RETURN) | 84 event.key_code() != ui::VKEY_RETURN) |
85 return false; | 85 return false; |
86 | 86 |
87 ZoomBubbleView::ShowBubble( | 87 ZoomBubbleView::ShowBubble( |
88 this, location_bar_delegate_->GetTabContents(), false); | 88 this, location_bar_delegate_->GetTabContents(), false); |
89 return true; | 89 return true; |
90 } | 90 } |
OLD | NEW |