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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 10831361: Draggable region support for frameless app window on CrOS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use ShouldDescendIntoChildForEventHandling Created 8 years, 4 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 "content/browser/renderer_host/render_widget_host_view_aura.h" 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after
1184 return current_cursor_.GetNativeCursor(); 1184 return current_cursor_.GetNativeCursor();
1185 } 1185 }
1186 1186
1187 int RenderWidgetHostViewAura::GetNonClientComponent( 1187 int RenderWidgetHostViewAura::GetNonClientComponent(
1188 const gfx::Point& point) const { 1188 const gfx::Point& point) const {
1189 return HTCLIENT; 1189 return HTCLIENT;
1190 } 1190 }
1191 1191
1192 bool RenderWidgetHostViewAura::ShouldDescendIntoChildForEventHandling( 1192 bool RenderWidgetHostViewAura::ShouldDescendIntoChildForEventHandling(
1193 aura::Window* child, 1193 aura::Window* child,
1194 const gfx::Point& location) { 1194 const gfx::Point& event_location,
1195 ui::EventType event_type) {
1195 return true; 1196 return true;
1196 } 1197 }
1197 1198
1198 bool RenderWidgetHostViewAura::OnMouseEvent(ui::MouseEvent* event) { 1199 bool RenderWidgetHostViewAura::OnMouseEvent(ui::MouseEvent* event) {
1199 TRACE_EVENT0("browser", "RenderWidgetHostViewAura::OnMouseEvent"); 1200 TRACE_EVENT0("browser", "RenderWidgetHostViewAura::OnMouseEvent");
1200 if (mouse_locked_) { 1201 if (mouse_locked_) {
1201 WebKit::WebMouseEvent mouse_event = MakeWebMouseEvent(event); 1202 WebKit::WebMouseEvent mouse_event = MakeWebMouseEvent(event);
1202 gfx::Point center(gfx::Rect(window_->bounds().size()).CenterPoint()); 1203 gfx::Point center(gfx::Rect(window_->bounds().size()).CenterPoint());
1203 1204
1204 bool is_move_to_center_event = (event->type() == ui::ET_MOUSE_MOVED || 1205 bool is_move_to_center_event = (event->type() == ui::ET_MOUSE_MOVED ||
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
1491 // associated with the window, but just in case. 1492 // associated with the window, but just in case.
1492 DetachFromInputMethod(); 1493 DetachFromInputMethod();
1493 } 1494 }
1494 1495
1495 void RenderWidgetHostViewAura::UpdateCursorIfOverSelf() { 1496 void RenderWidgetHostViewAura::UpdateCursorIfOverSelf() {
1496 const gfx::Point screen_point = gfx::Screen::GetCursorScreenPoint(); 1497 const gfx::Point screen_point = gfx::Screen::GetCursorScreenPoint();
1497 aura::RootWindow* root_window = window_->GetRootWindow(); 1498 aura::RootWindow* root_window = window_->GetRootWindow();
1498 if (!root_window) 1499 if (!root_window)
1499 return; 1500 return;
1500 1501
1501 if (root_window->GetEventHandlerForPoint(screen_point) != window_) 1502 if (root_window->GetEventHandlerForPoint(screen_point,
1503 ui::ET_MOUSE_MOVED) != window_)
1502 return; 1504 return;
1503 1505
1504 gfx::NativeCursor cursor = current_cursor_.GetNativeCursor(); 1506 gfx::NativeCursor cursor = current_cursor_.GetNativeCursor();
1505 if (is_loading_) 1507 if (is_loading_)
1506 cursor = ui::kCursorPointer; 1508 cursor = ui::kCursorPointer;
1507 1509
1508 root_window->SetCursor(cursor); 1510 root_window->SetCursor(cursor);
1509 } 1511 }
1510 1512
1511 ui::InputMethod* RenderWidgetHostViewAura::GetInputMethod() const { 1513 ui::InputMethod* RenderWidgetHostViewAura::GetInputMethod() const {
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
1654 RenderWidgetHost* widget) { 1656 RenderWidgetHost* widget) {
1655 return new RenderWidgetHostViewAura(widget); 1657 return new RenderWidgetHostViewAura(widget);
1656 } 1658 }
1657 1659
1658 // static 1660 // static
1659 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { 1661 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) {
1660 GetScreenInfoForWindow(results, NULL); 1662 GetScreenInfoForWindow(results, NULL);
1661 } 1663 }
1662 1664
1663 } // namespace content 1665 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698