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

Issue 188853003: Revert of Clean up WindowEventDispatcher some more. (Closed)

Created:
6 years, 9 months ago by Ben Goodger (Google)
Modified:
6 years, 6 months ago
Reviewers:
sky
CC:
chromium-reviews, sadrul, ben+aura_chromium.org, kalyank
Visibility:
Public.

Description

Revert of Clean up WindowEventDispatcher some more. (https://codereview.chromium.org/188223002/) Reason for revert: browser_tests failures. Original issue's description: > Clean up WindowEventDispatcher some more. > > . Eliminate the implementation of LayerAnimationObserver. It seems no one expects WED to be a LAO anymore. > . Remove WindowTreeHostDelegate. This involves moving some of the functions to WTH, removing some completely, and moving the remainder to the WED public API. A little icky for now, but I plan to take a pass on cleaning up WED's public API once I get it pared down. > . window_tree_host_x11_unittest provided an implementation of WTHD that was not WED. This is not a valid situation now since various functions in WTH now call directly through to WED. Replaced this with a simple EventHandler to test that events are being dispatched. > > R=sky@chromium.org > http://crbug.com/308843 > > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=255368 TBR=sky@chromium.org NOTREECHECKS=true NOTRY=true

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+384 lines, -202 lines) Patch
M ash/cancel_mode.h View 1 chunk +1 line, -1 line 0 comments Download
M ash/cancel_mode.cc View 1 chunk +1 line, -1 line 0 comments Download
M ash/first_run/desktop_cleaner.cc View 1 chunk +0 lines, -1 line 0 comments Download
M ash/sticky_keys/sticky_keys_overlay_unittest.cc View 1 chunk +1 line, -0 lines 0 comments Download
M ash/sticky_keys/sticky_keys_unittest.cc View 1 chunk +1 line, -0 lines 0 comments Download
M ash/wm/overview/window_overview.cc View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/ui/views/omnibox/omnibox_view_views_browsertest.cc View 1 chunk +1 line, -0 lines 0 comments Download
M mojo/examples/aura_demo/window_tree_host_mojo.cc View 3 chunks +4 lines, -3 lines 0 comments Download
M ui/app_list/views/app_list_view.cc View 1 chunk +0 lines, -1 line 0 comments Download
M ui/aura/aura.gyp View 1 chunk +1 line, -0 lines 0 comments Download
M ui/aura/remote_window_tree_host_win.h View 1 chunk +1 line, -1 line 0 comments Download
M ui/aura/remote_window_tree_host_win.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M ui/aura/window_event_dispatcher.h View 7 chunks +30 lines, -9 lines 0 comments Download
M ui/aura/window_event_dispatcher.cc View 5 chunks +92 lines, -39 lines 0 comments Download
M ui/aura/window_event_dispatcher_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M ui/aura/window_tree_host.h View 5 chunks +9 lines, -2 lines 0 comments Download
M ui/aura/window_tree_host.cc View 9 chunks +29 lines, -32 lines 0 comments Download
A ui/aura/window_tree_host_delegate.h View 1 chunk +60 lines, -0 lines 0 comments Download
M ui/aura/window_tree_host_mac.mm View 1 chunk +1 line, -0 lines 0 comments Download
M ui/aura/window_tree_host_ozone.cc View 1 chunk +1 line, -1 line 0 comments Download
M ui/aura/window_tree_host_win.cc View 6 chunks +7 lines, -7 lines 0 comments Download
M ui/aura/window_tree_host_x11.h View 1 chunk +1 line, -1 line 0 comments Download
M ui/aura/window_tree_host_x11.cc View 9 chunks +17 lines, -13 lines 0 comments Download
M ui/aura/window_tree_host_x11_unittest.cc View 8 chunks +108 lines, -73 lines 0 comments Download
M ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc View 4 chunks +7 lines, -7 lines 0 comments Download
M ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc View 6 chunks +8 lines, -6 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Ben Goodger (Google)
Created Revert of Clean up WindowEventDispatcher some more.
6 years, 9 months ago (2014-03-06 17:53:42 UTC) #1
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ben@chromium.org/188853003/1
6 years, 9 months ago (2014-03-06 17:55:22 UTC) #2
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-06 17:55:36 UTC) #3
commit-bot: I haz the power
6 years, 9 months ago (2014-03-06 17:55:37 UTC) #4
Failed to apply patch for ui/aura/window_tree_host_x11.cc:
While running patch -p1 --forward --force --no-backup-if-mismatch;
  patching file ui/aura/window_tree_host_x11.cc
  Hunk #1 succeeded at 35 (offset -1 lines).
  Hunk #2 FAILED at 403.
  Hunk #3 succeeded at 418 (offset -18 lines).
  Hunk #4 succeeded at 551 (offset -18 lines).
  Hunk #5 succeeded at 585 (offset -18 lines).
  Hunk #6 succeeded at 709 (offset -18 lines).
  Hunk #7 succeeded at 749 (offset -18 lines).
  Hunk #8 succeeded at 766 (offset -18 lines).
  Hunk #9 FAILED at 874.
  2 out of 9 hunks FAILED -- saving rejects to file
ui/aura/window_tree_host_x11.cc.rej

Patch:       ui/aura/window_tree_host_x11.cc
Index: ui/aura/window_tree_host_x11.cc
diff --git a/ui/aura/window_tree_host_x11.cc b/ui/aura/window_tree_host_x11.cc
index
62867422910cede6615eca0f4d5da1f286e0ff9f..8b0f5644c56972e9a6279ee728170940b8b7d8f7
100644
--- a/ui/aura/window_tree_host_x11.cc
+++ b/ui/aura/window_tree_host_x11.cc
@@ -36,7 +36,6 @@
 #include "ui/base/ui_base_switches.h"
 #include "ui/base/view_prop.h"
 #include "ui/base/x/x11_util.h"
-#include "ui/compositor/compositor.h"
 #include "ui/compositor/dip_util.h"
 #include "ui/compositor/layer.h"
 #include "ui/events/event.h"
@@ -404,7 +403,7 @@
       if (static_cast<int>(xev->xbutton.button) == kBackMouseButton ||
           static_cast<int>(xev->xbutton.button) == kForwardMouseButton) {
         client::UserActionClient* gesture_client =
-            client::GetUserActionClient(window());
+            client::GetUserActionClient(delegate_->AsDispatcher()->window());
         if (gesture_client) {
           gesture_client->OnUserAction(
               static_cast<int>(xev->xbutton.button) == kBackMouseButton ?
@@ -437,7 +436,7 @@
     }
     case FocusOut:
       if (xev->xfocus.mode != NotifyGrab)
-        OnHostLostWindowCapture();
+        delegate_->OnHostLostWindowCapture();
       break;
     case ConfigureNotify: {
       DCHECK_EQ(xwindow_, xev->xconfigure.event);
@@ -570,8 +569,9 @@
   // Even if the host window's size doesn't change, aura's root window
   // size, which is in DIP, changes when the scale changes.
   float current_scale = compositor()->device_scale_factor();
-  float new_scale = gfx::Screen::GetScreenFor(window())->
-      GetDisplayNearestWindow(window()).device_scale_factor();
+  float new_scale = gfx::Screen::GetScreenFor(
+      delegate_->AsDispatcher()->window())->GetDisplayNearestWindow(
+          delegate_->AsDispatcher()->window()).device_scale_factor();
   bool origin_changed = bounds_.origin() != bounds.origin();
   bool size_changed = bounds_.size() != bounds.size();
   XWindowChanges changes = {0};
@@ -603,7 +603,8 @@
   if (size_changed || current_scale != new_scale) {
     OnHostResized(bounds.size());
   } else {
-    window()->SchedulePaintInRect(window()->bounds());
+    delegate_->AsDispatcher()->window()->SchedulePaintInRect(
+        delegate_->AsDispatcher()->window()->bounds());
   }
 }
 
@@ -726,7 +727,7 @@
       xevent.xmotion.time = CurrentTime;
 
       gfx::Point point(xevent.xmotion.x, xevent.xmotion.y);
-      ConvertPointToNativeScreen(&point);
+      delegate_->AsDispatcher()->host()->ConvertPointToNativeScreen(&point);
       xevent.xmotion.x_root = point.x();
       xevent.xmotion.y_root = point.y();
     }
@@ -766,11 +767,14 @@
 
 void WindowTreeHostX11::OnRootWindowInitialized(
     WindowEventDispatcher* d) {
-  // UpdateIsInternalDisplay relies on WED's kDisplayIdKey property being set
-  // available by the time WED::Init is called. (set in
-  // DisplayManager::CreateRootWindowForDisplay)
+  // UpdateIsInternalDisplay relies on:
+  // 1. delegate_ pointing to WindowEventDispatcher - available after
+  //    SetDelegate.
+  // 2. WED's kDisplayIdKey property set - available by the time
+  //    WED::Init is called.
+  //    (set in DisplayManager::CreateRootWindowForDisplay)
   // Ready when NotifyRootWindowInitialized is called from WED::Init.
-  if (d != dispatcher())
+  if (!delegate_ || d != dispatcher())
     return;
   UpdateIsInternalDisplay();
 
@@ -780,7 +784,7 @@
 }
 
 ui::EventProcessor* WindowTreeHostX11::GetEventProcessor() {
-  return dispatcher();
+  return delegate_->GetEventProcessor();
 }
 
 void WindowTreeHostX11::DispatchXI2Event(const base::NativeEvent& event) {
@@ -870,7 +874,7 @@
           if (type == ui::ET_MOUSE_RELEASED)
             break;
           client::UserActionClient* gesture_client =
-              client::GetUserActionClient(window());
+              client::GetUserActionClient(delegate_->AsDispatcher()->window());
           if (gesture_client) {
             bool reverse_direction =
                 ui::IsTouchpadEvent(xev) && ui::IsNaturalScrollEnabled();

Powered by Google App Engine
This is Rietveld 408576698