| 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/toolbar/toolbar_model.h" | 7 #include "chrome/browser/ui/toolbar/toolbar_model.h" |
| 8 #include "chrome/browser/ui/view_ids.h" | 8 #include "chrome/browser/ui/view_ids.h" |
| 9 #include "chrome/browser/ui/views/location_bar/zoom_bubble_view.h" | 9 #include "chrome/browser/ui/views/location_bar/zoom_bubble_view.h" |
| 10 #include "chrome/browser/ui/zoom/zoom_controller.h" | 10 #include "chrome/browser/ui/zoom/zoom_controller.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 bool ZoomView::OnKeyPressed(const ui::KeyEvent& event) { | 66 bool ZoomView::OnKeyPressed(const ui::KeyEvent& event) { |
| 67 if (event.key_code() != ui::VKEY_SPACE && | 67 if (event.key_code() != ui::VKEY_SPACE && |
| 68 event.key_code() != ui::VKEY_RETURN) { | 68 event.key_code() != ui::VKEY_RETURN) { |
| 69 return false; | 69 return false; |
| 70 } | 70 } |
| 71 | 71 |
| 72 ActivateBubble(); | 72 ActivateBubble(); |
| 73 return true; | 73 return true; |
| 74 } | 74 } |
| 75 | 75 |
| 76 ui::EventResult ZoomView::OnGestureEvent(ui::GestureEvent* event) { | 76 void ZoomView::OnGestureEvent(ui::GestureEvent* event) { |
| 77 if (event->type() != ui::ET_GESTURE_TAP) | 77 if (event->type() == ui::ET_GESTURE_TAP) { |
| 78 return ui::ER_UNHANDLED; | 78 ActivateBubble(); |
| 79 | 79 event->SetHandled(); |
| 80 ActivateBubble(); | 80 } |
| 81 return ui::ER_CONSUMED; | |
| 82 } | 81 } |
| 83 | 82 |
| 84 int ZoomView::GetBuiltInHorizontalPadding() const { | 83 int ZoomView::GetBuiltInHorizontalPadding() const { |
| 85 return GetBuiltInHorizontalPaddingImpl(); | 84 return GetBuiltInHorizontalPaddingImpl(); |
| 86 } | 85 } |
| 87 | 86 |
| 88 void ZoomView::ActivateBubble() { | 87 void ZoomView::ActivateBubble() { |
| 89 ZoomBubbleView::ShowBubble( | 88 ZoomBubbleView::ShowBubble( |
| 90 this, location_bar_delegate_->GetWebContents(), false); | 89 this, location_bar_delegate_->GetWebContents(), false); |
| 91 } | 90 } |
| OLD | NEW |