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" |
11 #include "grit/theme_resources.h" | 11 #include "grit/theme_resources.h" |
12 #include "ui/base/accessibility/accessible_view_state.h" | 12 #include "ui/base/accessibility/accessible_view_state.h" |
| 13 #include "ui/base/event.h" |
13 #include "ui/base/l10n/l10n_util.h" | 14 #include "ui/base/l10n/l10n_util.h" |
14 #include "ui/base/resource/resource_bundle.h" | 15 #include "ui/base/resource/resource_bundle.h" |
15 #include "ui/gfx/size.h" | 16 #include "ui/gfx/size.h" |
16 | 17 |
17 ZoomView::ZoomView(ToolbarModel* toolbar_model, | 18 ZoomView::ZoomView(ToolbarModel* toolbar_model, |
18 LocationBarView::Delegate* location_bar_delegate) | 19 LocationBarView::Delegate* location_bar_delegate) |
19 : toolbar_model_(toolbar_model), | 20 : toolbar_model_(toolbar_model), |
20 location_bar_delegate_(location_bar_delegate), | 21 location_bar_delegate_(location_bar_delegate), |
21 zoom_icon_state_(ZoomController::NONE), | 22 zoom_icon_state_(ZoomController::NONE), |
22 zoom_percent_(100) { | 23 zoom_percent_(100) { |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 return true; | 73 return true; |
73 } | 74 } |
74 | 75 |
75 void ZoomView::OnMouseReleased(const views::MouseEvent& event) { | 76 void ZoomView::OnMouseReleased(const views::MouseEvent& event) { |
76 if (event.IsOnlyLeftMouseButton() && HitTest(event.location())) { | 77 if (event.IsOnlyLeftMouseButton() && HitTest(event.location())) { |
77 ZoomBubbleView::ShowBubble( | 78 ZoomBubbleView::ShowBubble( |
78 this, location_bar_delegate_->GetTabContents(), false); | 79 this, location_bar_delegate_->GetTabContents(), false); |
79 } | 80 } |
80 } | 81 } |
81 | 82 |
82 bool ZoomView::OnKeyPressed(const views::KeyEvent& event) { | 83 bool ZoomView::OnKeyPressed(const ui::KeyEvent& event) { |
83 if (event.key_code() != ui::VKEY_SPACE && | 84 if (event.key_code() != ui::VKEY_SPACE && |
84 event.key_code() != ui::VKEY_RETURN) | 85 event.key_code() != ui::VKEY_RETURN) |
85 return false; | 86 return false; |
86 | 87 |
87 ZoomBubbleView::ShowBubble( | 88 ZoomBubbleView::ShowBubble( |
88 this, location_bar_delegate_->GetTabContents(), false); | 89 this, location_bar_delegate_->GetTabContents(), false); |
89 return true; | 90 return true; |
90 } | 91 } |
OLD | NEW |