Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(584)

Side by Side Diff: chrome/browser/ui/views/location_bar/zoom_view.cc

Issue 139983009: ui::LocatedEvent location() returns gfx::PointF (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Undo accidental change. Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 // Don't show tooltip if the zoom bubble is displayed. 50 // Don't show tooltip if the zoom bubble is displayed.
51 return !ZoomBubbleView::IsShowing() && ImageView::GetTooltipText(p, tooltip); 51 return !ZoomBubbleView::IsShowing() && ImageView::GetTooltipText(p, tooltip);
52 } 52 }
53 53
54 bool ZoomView::OnMousePressed(const ui::MouseEvent& event) { 54 bool ZoomView::OnMousePressed(const ui::MouseEvent& event) {
55 // Do nothing until mouse is released. 55 // Do nothing until mouse is released.
56 return true; 56 return true;
57 } 57 }
58 58
59 void ZoomView::OnMouseReleased(const ui::MouseEvent& event) { 59 void ZoomView::OnMouseReleased(const ui::MouseEvent& event) {
60 if (event.IsOnlyLeftMouseButton() && HitTestPoint(event.location())) 60 if (event.IsOnlyLeftMouseButton() &&
61 HitTestPoint(gfx::ToFlooredPoint(event.location())))
61 ActivateBubble(); 62 ActivateBubble();
62 } 63 }
63 64
64 bool ZoomView::OnKeyPressed(const ui::KeyEvent& event) { 65 bool ZoomView::OnKeyPressed(const ui::KeyEvent& event) {
65 if (event.key_code() != ui::VKEY_SPACE && 66 if (event.key_code() != ui::VKEY_SPACE &&
66 event.key_code() != ui::VKEY_RETURN) { 67 event.key_code() != ui::VKEY_RETURN) {
67 return false; 68 return false;
68 } 69 }
69 70
70 ActivateBubble(); 71 ActivateBubble();
71 return true; 72 return true;
72 } 73 }
73 74
74 void ZoomView::OnGestureEvent(ui::GestureEvent* event) { 75 void ZoomView::OnGestureEvent(ui::GestureEvent* event) {
75 if (event->type() == ui::ET_GESTURE_TAP) { 76 if (event->type() == ui::ET_GESTURE_TAP) {
76 ActivateBubble(); 77 ActivateBubble();
77 event->SetHandled(); 78 event->SetHandled();
78 } 79 }
79 } 80 }
80 81
81 void ZoomView::ActivateBubble() { 82 void ZoomView::ActivateBubble() {
82 ZoomBubbleView::ShowBubble(location_bar_delegate_->GetWebContents(), false); 83 ZoomBubbleView::ShowBubble(location_bar_delegate_->GetWebContents(), false);
83 } 84 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698