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

Side by Side Diff: chrome/browser/ui/views/location_bar/open_pdf_in_reader_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/open_pdf_in_reader_view.h" 5 #include "chrome/browser/ui/views/location_bar/open_pdf_in_reader_view.h"
6 6
7 #include "chrome/browser/ui/pdf/pdf_tab_helper.h" 7 #include "chrome/browser/ui/pdf/pdf_tab_helper.h"
8 #include "chrome/browser/ui/views/open_pdf_in_reader_bubble_view.h" 8 #include "chrome/browser/ui/views/open_pdf_in_reader_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"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 state->name = l10n_util::GetStringUTF16(IDS_ACCNAME_OPEN_PDF_IN_READER); 50 state->name = l10n_util::GetStringUTF16(IDS_ACCNAME_OPEN_PDF_IN_READER);
51 state->role = ui::AX_ROLE_BUTTON; 51 state->role = ui::AX_ROLE_BUTTON;
52 } 52 }
53 53
54 bool OpenPDFInReaderView::OnMousePressed(const ui::MouseEvent& event) { 54 bool OpenPDFInReaderView::OnMousePressed(const ui::MouseEvent& event) {
55 // Show the bubble on mouse release; that is standard button behavior. 55 // Show the bubble on mouse release; that is standard button behavior.
56 return true; 56 return true;
57 } 57 }
58 58
59 void OpenPDFInReaderView::OnMouseReleased(const ui::MouseEvent& event) { 59 void OpenPDFInReaderView::OnMouseReleased(const ui::MouseEvent& event) {
60 if (event.IsOnlyLeftMouseButton() && HitTestPoint(event.location())) 60 if (event.IsOnlyLeftMouseButton() &&
61 HitTestPoint(gfx::ToFlooredPoint(event.location())))
61 ShowBubble(); 62 ShowBubble();
62 } 63 }
63 64
64 bool OpenPDFInReaderView::OnKeyPressed(const ui::KeyEvent& event) { 65 bool OpenPDFInReaderView::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 ShowBubble(); 71 ShowBubble();
71 return true; 72 return true;
72 } 73 }
73 74
74 void OpenPDFInReaderView::OnWidgetDestroying(views::Widget* widget) { 75 void OpenPDFInReaderView::OnWidgetDestroying(views::Widget* widget) {
75 if (!bubble_) 76 if (!bubble_)
76 return; 77 return;
77 78
78 bubble_->GetWidget()->RemoveObserver(this); 79 bubble_->GetWidget()->RemoveObserver(this);
79 bubble_ = NULL; 80 bubble_ = NULL;
80 } 81 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698