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

Side by Side Diff: chrome/browser/ui/views/tab_contents/native_tab_contents_view_aura.cc

Issue 9473001: Extract minimal RenderViewHost interface for embedders, leaving (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to LKGR. Created 8 years, 9 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/tab_contents/native_tab_contents_view_aura.h" 5 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_view_aura.h"
6 6
7 #include "base/event_types.h" 7 #include "base/event_types.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_view_delegate .h" 9 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_view_delegate .h"
10 #include "content/browser/renderer_host/render_view_host.h" 10 #include "content/browser/renderer_host/render_view_host.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 } 53 }
54 virtual void DidProcessEvent(const base::NativeEvent& event) OVERRIDE { 54 virtual void DidProcessEvent(const base::NativeEvent& event) OVERRIDE {
55 ui::EventType type = ui::EventTypeFromNative(event); 55 ui::EventType type = ui::EventTypeFromNative(event);
56 RenderViewHost* rvh = NULL; 56 RenderViewHost* rvh = NULL;
57 switch (type) { 57 switch (type) {
58 case ui::ET_MOUSE_DRAGGED: 58 case ui::ET_MOUSE_DRAGGED:
59 rvh = view_->GetWebContents()->GetRenderViewHost(); 59 rvh = view_->GetWebContents()->GetRenderViewHost();
60 if (rvh) { 60 if (rvh) {
61 gfx::Point screen_loc = ui::EventLocationFromNative(event); 61 gfx::Point screen_loc = ui::EventLocationFromNative(event);
62 gfx::Point client_loc = screen_loc; 62 gfx::Point client_loc = screen_loc;
63 aura::Window* window = rvh->view()->GetNativeView(); 63 aura::Window* window = rvh->GetView()->GetNativeView();
64 aura::Window::ConvertPointToWindow(window->GetRootWindow(), 64 aura::Window::ConvertPointToWindow(window->GetRootWindow(),
65 window, &client_loc); 65 window, &client_loc);
66 rvh->DragSourceMovedTo(client_loc.x(), client_loc.y(), 66 rvh->DragSourceMovedTo(client_loc.x(), client_loc.y(),
67 screen_loc.x(), screen_loc.y()); 67 screen_loc.x(), screen_loc.y());
68 } 68 }
69 break; 69 break;
70 default: 70 default:
71 break; 71 break;
72 } 72 }
73 } 73 }
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 } 322 }
323 323
324 //////////////////////////////////////////////////////////////////////////////// 324 ////////////////////////////////////////////////////////////////////////////////
325 // NativeTabContentsViewAura, private: 325 // NativeTabContentsViewAura, private:
326 326
327 void NativeTabContentsViewAura::EndDrag(WebKit::WebDragOperationsMask ops) { 327 void NativeTabContentsViewAura::EndDrag(WebKit::WebDragOperationsMask ops) {
328 aura::RootWindow* root_window = GetNativeView()->GetRootWindow(); 328 aura::RootWindow* root_window = GetNativeView()->GetRootWindow();
329 gfx::Point screen_loc = root_window->last_mouse_location(); 329 gfx::Point screen_loc = root_window->last_mouse_location();
330 gfx::Point client_loc = screen_loc; 330 gfx::Point client_loc = screen_loc;
331 RenderViewHost* rvh = GetWebContents()->GetRenderViewHost(); 331 RenderViewHost* rvh = GetWebContents()->GetRenderViewHost();
332 aura::Window* window = rvh->view()->GetNativeView(); 332 aura::Window* window = rvh->GetView()->GetNativeView();
333 aura::Window::ConvertPointToWindow(root_window, window, &client_loc); 333 aura::Window::ConvertPointToWindow(root_window, window, &client_loc);
334 rvh->DragSourceEndedAt(client_loc.x(), client_loc.y(), screen_loc.x(), 334 rvh->DragSourceEndedAt(client_loc.x(), client_loc.y(), screen_loc.x(),
335 screen_loc.y(), ops); 335 screen_loc.y(), ops);
336 } 336 }
337 337
338 //////////////////////////////////////////////////////////////////////////////// 338 ////////////////////////////////////////////////////////////////////////////////
339 // NativeTabContentsView, public: 339 // NativeTabContentsView, public:
340 340
341 // static 341 // static
342 NativeTabContentsView* NativeTabContentsView::CreateNativeTabContentsView( 342 NativeTabContentsView* NativeTabContentsView::CreateNativeTabContentsView(
343 internal::NativeTabContentsViewDelegate* delegate) { 343 internal::NativeTabContentsViewDelegate* delegate) {
344 return new NativeTabContentsViewAura(delegate); 344 return new NativeTabContentsViewAura(delegate);
345 } 345 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698