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

Unified Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 10908127: events: Move EventTarget into Event. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/render_widget_host_view_aura.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index ca54357ca1c2b9449258a0f65be92b9c4c9c5397..271aa01169f335eef201f4a5af55570ec87d74ef 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -1167,11 +1167,83 @@ void RenderWidgetHostViewAura::OnBlur() {
}
}
-bool RenderWidgetHostViewAura::OnKeyEvent(ui::KeyEvent* event) {
+gfx::NativeCursor RenderWidgetHostViewAura::GetCursor(const gfx::Point& point) {
+ if (mouse_locked_)
+ return ui::kCursorNone;
+ return current_cursor_.GetNativeCursor();
+}
+
+int RenderWidgetHostViewAura::GetNonClientComponent(
+ const gfx::Point& point) const {
+ return HTCLIENT;
+}
+
+bool RenderWidgetHostViewAura::ShouldDescendIntoChildForEventHandling(
+ aura::Window* child,
+ const gfx::Point& location) {
+ return true;
+}
+
+bool RenderWidgetHostViewAura::CanFocus() {
+ return popup_type_ == WebKit::WebPopupTypeNone;
+}
+
+void RenderWidgetHostViewAura::OnCaptureLost() {
+ host_->LostCapture();
+}
+
+void RenderWidgetHostViewAura::OnPaint(gfx::Canvas* canvas) {
+ paint_canvas_ = canvas;
+ BackingStore* backing_store = host_->GetBackingStore(true);
+ paint_canvas_ = NULL;
+ if (backing_store) {
+ static_cast<BackingStoreAura*>(backing_store)->SkiaShowRect(gfx::Point(),
+ canvas);
+ } else if (aura::Env::GetInstance()->render_white_bg()) {
+ canvas->DrawColor(SK_ColorWHITE);
+ }
+}
+
+void RenderWidgetHostViewAura::OnDeviceScaleFactorChanged(
+ float device_scale_factor) {
+ if (!host_)
+ return;
+
+ BackingStoreAura* backing_store = static_cast<BackingStoreAura*>(
+ host_->GetBackingStore(false));
+ if (backing_store) // NULL in hardware path.
+ backing_store->ScaleFactorChanged(device_scale_factor);
+
+ host_->SetDeviceScaleFactor(device_scale_factor);
+ current_cursor_.SetScaleFactor(device_scale_factor);
+}
+
+void RenderWidgetHostViewAura::OnWindowDestroying() {
+}
+
+void RenderWidgetHostViewAura::OnWindowDestroyed() {
+ host_->ViewDestroyed();
+ delete this;
+}
+
+void RenderWidgetHostViewAura::OnWindowTargetVisibilityChanged(bool visible) {
+}
+
+bool RenderWidgetHostViewAura::HasHitTestMask() const {
+ return false;
+}
+
+void RenderWidgetHostViewAura::GetHitTestMask(gfx::Path* mask) const {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// RenderWidgetHostViewAura, ui::EventHandler implementation:
+
+ui::EventResult RenderWidgetHostViewAura::OnKeyEvent(ui::KeyEvent* event) {
TRACE_EVENT0("browser", "RenderWidgetHostViewAura::OnKeyEvent");
if (popup_child_host_view_ && popup_child_host_view_->NeedsInputGrab() &&
popup_child_host_view_->OnKeyEvent(event))
- return true;
+ return ui::ER_HANDLED;
// We need to handle the Escape key for Pepper Flash.
if (is_fullscreen_ && event->key_code() == ui::VKEY_ESCAPE) {
@@ -1194,27 +1266,10 @@ bool RenderWidgetHostViewAura::OnKeyEvent(ui::KeyEvent* event) {
host_->ForwardKeyboardEvent(webkit_event);
}
}
- return true;
-}
-
-gfx::NativeCursor RenderWidgetHostViewAura::GetCursor(const gfx::Point& point) {
- if (mouse_locked_)
- return ui::kCursorNone;
- return current_cursor_.GetNativeCursor();
-}
-
-int RenderWidgetHostViewAura::GetNonClientComponent(
- const gfx::Point& point) const {
- return HTCLIENT;
-}
-
-bool RenderWidgetHostViewAura::ShouldDescendIntoChildForEventHandling(
- aura::Window* child,
- const gfx::Point& location) {
- return true;
+ return ui::ER_HANDLED;
}
-bool RenderWidgetHostViewAura::OnMouseEvent(ui::MouseEvent* event) {
+ui::EventResult RenderWidgetHostViewAura::OnMouseEvent(ui::MouseEvent* event) {
TRACE_EVENT0("browser", "RenderWidgetHostViewAura::OnMouseEvent");
if (mouse_locked_) {
WebKit::WebMouseEvent mouse_event = MakeWebMouseEvent(event);
@@ -1241,7 +1296,7 @@ bool RenderWidgetHostViewAura::OnMouseEvent(ui::MouseEvent* event) {
host_->ForwardMouseEvent(mouse_event);
}
- return false;
+ return ui::ER_UNHANDLED;
}
if (event->type() == ui::ET_MOUSEWHEEL) {
@@ -1290,7 +1345,7 @@ bool RenderWidgetHostViewAura::OnMouseEvent(ui::MouseEvent* event) {
window_->parent()->delegate()->OnMouseEvent(event);
// Return true so that we receive released/drag events.
- return true;
+ return ui::ER_HANDLED;
}
ui::TouchStatus RenderWidgetHostViewAura::OnTouchEvent(
@@ -1362,58 +1417,6 @@ ui::EventResult RenderWidgetHostViewAura::OnGestureEvent(
return ui::ER_CONSUMED;
}
-bool RenderWidgetHostViewAura::CanFocus() {
- return popup_type_ == WebKit::WebPopupTypeNone;
-}
-
-void RenderWidgetHostViewAura::OnCaptureLost() {
- host_->LostCapture();
-}
-
-void RenderWidgetHostViewAura::OnPaint(gfx::Canvas* canvas) {
- paint_canvas_ = canvas;
- BackingStore* backing_store = host_->GetBackingStore(true);
- paint_canvas_ = NULL;
- if (backing_store) {
- static_cast<BackingStoreAura*>(backing_store)->SkiaShowRect(gfx::Point(),
- canvas);
- } else if (aura::Env::GetInstance()->render_white_bg()) {
- canvas->DrawColor(SK_ColorWHITE);
- }
-}
-
-void RenderWidgetHostViewAura::OnDeviceScaleFactorChanged(
- float device_scale_factor) {
- if (!host_)
- return;
-
- BackingStoreAura* backing_store = static_cast<BackingStoreAura*>(
- host_->GetBackingStore(false));
- if (backing_store) // NULL in hardware path.
- backing_store->ScaleFactorChanged(device_scale_factor);
-
- host_->SetDeviceScaleFactor(device_scale_factor);
- current_cursor_.SetScaleFactor(device_scale_factor);
-}
-
-void RenderWidgetHostViewAura::OnWindowDestroying() {
-}
-
-void RenderWidgetHostViewAura::OnWindowDestroyed() {
- host_->ViewDestroyed();
- delete this;
-}
-
-void RenderWidgetHostViewAura::OnWindowTargetVisibilityChanged(bool visible) {
-}
-
-bool RenderWidgetHostViewAura::HasHitTestMask() const {
- return false;
-}
-
-void RenderWidgetHostViewAura::GetHitTestMask(gfx::Path* mask) const {
-}
-
////////////////////////////////////////////////////////////////////////////////
// RenderWidgetHostViewAura, aura::client::ActivationDelegate implementation:
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura.h ('k') | content/browser/web_contents/web_contents_view_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698