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

Side by Side Diff: content/browser/web_contents/web_contents_view_aura.cc

Issue 11592011: events: Update mouse-event handlers to not return EventResult. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 "content/browser/web_contents/web_contents_view_aura.h" 5 #include "content/browser/web_contents/web_contents_view_aura.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "content/browser/renderer_host/dip_util.h" 9 #include "content/browser/renderer_host/dip_util.h"
10 #include "content/browser/renderer_host/overscroll_controller.h" 10 #include "content/browser/renderer_host/overscroll_controller.h"
(...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after
904 NOTREACHED(); 904 NOTREACHED();
905 return scoped_refptr<ui::Texture>(); 905 return scoped_refptr<ui::Texture>();
906 } 906 }
907 907
908 //////////////////////////////////////////////////////////////////////////////// 908 ////////////////////////////////////////////////////////////////////////////////
909 // WebContentsViewAura, ui::EventHandler implementation: 909 // WebContentsViewAura, ui::EventHandler implementation:
910 910
911 void WebContentsViewAura::OnKeyEvent(ui::KeyEvent* event) { 911 void WebContentsViewAura::OnKeyEvent(ui::KeyEvent* event) {
912 } 912 }
913 913
914 ui::EventResult WebContentsViewAura::OnMouseEvent(ui::MouseEvent* event) { 914 void WebContentsViewAura::OnMouseEvent(ui::MouseEvent* event) {
915 if (!web_contents_->GetDelegate()) 915 if (!web_contents_->GetDelegate())
916 return ui::ER_UNHANDLED; 916 return;
917 917
918 switch (event->type()) { 918 switch (event->type()) {
919 case ui::ET_MOUSE_PRESSED: 919 case ui::ET_MOUSE_PRESSED:
920 web_contents_->GetDelegate()->ActivateContents(web_contents_); 920 web_contents_->GetDelegate()->ActivateContents(web_contents_);
921 break; 921 break;
922 case ui::ET_MOUSE_MOVED: 922 case ui::ET_MOUSE_MOVED:
923 web_contents_->GetDelegate()->ContentsMouseEvent( 923 web_contents_->GetDelegate()->ContentsMouseEvent(
924 web_contents_, 924 web_contents_,
925 gfx::Screen::GetScreenFor(GetNativeView())->GetCursorScreenPoint(), 925 gfx::Screen::GetScreenFor(GetNativeView())->GetCursorScreenPoint(),
926 true); 926 true);
927 break; 927 break;
928 default: 928 default:
929 break; 929 break;
930 } 930 }
931 return ui::ER_UNHANDLED;
932 } 931 }
933 932
934 //////////////////////////////////////////////////////////////////////////////// 933 ////////////////////////////////////////////////////////////////////////////////
935 // WebContentsViewAura, aura::client::DragDropDelegate implementation: 934 // WebContentsViewAura, aura::client::DragDropDelegate implementation:
936 935
937 void WebContentsViewAura::OnDragEntered(const ui::DropTargetEvent& event) { 936 void WebContentsViewAura::OnDragEntered(const ui::DropTargetEvent& event) {
938 if (drag_dest_delegate_) 937 if (drag_dest_delegate_)
939 drag_dest_delegate_->DragInitialize(web_contents_); 938 drag_dest_delegate_->DragInitialize(web_contents_);
940 939
941 current_drop_data_.reset(new WebDropData()); 940 current_drop_data_.reset(new WebDropData());
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
995 event.location(), 994 event.location(),
996 gfx::Screen::GetScreenFor(GetNativeView())->GetCursorScreenPoint(), 995 gfx::Screen::GetScreenFor(GetNativeView())->GetCursorScreenPoint(),
997 ConvertAuraEventFlagsToWebInputEventModifiers(event.flags())); 996 ConvertAuraEventFlagsToWebInputEventModifiers(event.flags()));
998 if (drag_dest_delegate_) 997 if (drag_dest_delegate_)
999 drag_dest_delegate_->OnDrop(); 998 drag_dest_delegate_->OnDrop();
1000 current_drop_data_.reset(); 999 current_drop_data_.reset();
1001 return current_drag_op_; 1000 return current_drag_op_;
1002 } 1001 }
1003 1002
1004 } // namespace content 1003 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_view_aura.h ('k') | ui/aura/gestures/gesture_recognizer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698