| 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 44d8aa52a83ba24b18f27a6275464e10dcba4bb6..4cc14b6c9120ee7165bd9ae367e231b00bc3047b 100644
|
| --- a/content/browser/renderer_host/render_widget_host_view_aura.cc
|
| +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
|
| @@ -173,7 +173,7 @@ BOOL CALLBACK ShowWindowsCallback(HWND window, LPARAM param) {
|
|
|
| if (GetProp(window, kWidgetOwnerProperty) == widget) {
|
| HWND parent =
|
| - widget->GetNativeView()->GetRootWindow()->GetAcceleratedWidget();
|
| + widget->GetNativeView()->GetDispatcher()->GetAcceleratedWidget();
|
| SetParent(window, parent);
|
| }
|
| return TRUE;
|
| @@ -195,7 +195,7 @@ BOOL CALLBACK SetCutoutRectsCallback(HWND window, LPARAM param) {
|
| if (GetProp(window, kWidgetOwnerProperty) == params->widget) {
|
| // First calculate the offset of this plugin from the root window, since
|
| // the cutouts are relative to the root window.
|
| - HWND parent = params->widget->GetNativeView()->GetRootWindow()->
|
| + HWND parent = params->widget->GetNativeView()->GetDispatcher()->
|
| GetAcceleratedWidget();
|
| POINT offset;
|
| offset.x = offset.y = 0;
|
| @@ -398,13 +398,13 @@ class RenderWidgetHostViewAura::EventFilterForPopupExit :
|
| explicit EventFilterForPopupExit(RenderWidgetHostViewAura* rwhva)
|
| : rwhva_(rwhva) {
|
| DCHECK(rwhva_);
|
| - aura::RootWindow* root_window = rwhva_->window_->GetRootWindow();
|
| + aura::Window* root_window = rwhva_->window_->GetRootWindow();
|
| DCHECK(root_window);
|
| root_window->AddPreTargetHandler(this);
|
| }
|
|
|
| virtual ~EventFilterForPopupExit() {
|
| - aura::RootWindow* root_window = rwhva_->window_->GetRootWindow();
|
| + aura::Window* root_window = rwhva_->window_->GetRootWindow();
|
| DCHECK(root_window);
|
| root_window->RemovePreTargetHandler(this);
|
| }
|
| @@ -533,7 +533,7 @@ class RenderWidgetHostViewAura::TransientWindowObserver
|
| }
|
|
|
| aura::Window* GetToplevelWindow() {
|
| - aura::RootWindow* root = view_->window_->GetRootWindow();
|
| + aura::Window* root = view_->window_->GetRootWindow();
|
| if (!root)
|
| return NULL;
|
| aura::client::ActivationClient* activation_client =
|
| @@ -645,7 +645,7 @@ void RenderWidgetHostViewAura::InitAsPopup(
|
| window_->Init(ui::LAYER_TEXTURED);
|
| window_->SetName("RenderWidgetHostViewAura");
|
|
|
| - aura::RootWindow* root = popup_parent_host_view_->window_->GetRootWindow();
|
| + aura::Window* root = popup_parent_host_view_->window_->GetRootWindow();
|
| aura::client::ParentWindowWithContext(window_, root, bounds_in_screen);
|
|
|
| // TODO(erg): While I could make sure details of the WindowTreeClient are
|
| @@ -670,7 +670,7 @@ void RenderWidgetHostViewAura::InitAsFullscreen(
|
| window_->SetName("RenderWidgetHostViewAura");
|
| window_->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN);
|
|
|
| - aura::RootWindow* parent = NULL;
|
| + aura::Window* parent = NULL;
|
| gfx::Rect bounds;
|
| if (reference_host_view) {
|
| aura::Window* reference_window =
|
| @@ -701,7 +701,7 @@ void RenderWidgetHostViewAura::WasShown() {
|
| if (framebuffer_holder_)
|
| FrameMemoryManager::GetInstance()->SetFrameVisibility(this, true);
|
|
|
| - aura::RootWindow* root = window_->GetRootWindow();
|
| + aura::Window* root = window_->GetRootWindow();
|
| if (root) {
|
| aura::client::CursorClient* cursor_client =
|
| aura::client::GetCursorClient(root);
|
| @@ -733,9 +733,9 @@ void RenderWidgetHostViewAura::WasHidden() {
|
| released_front_lock_ = NULL;
|
|
|
| #if defined(OS_WIN)
|
| - aura::RootWindow* root_window = window_->GetRootWindow();
|
| - if (root_window) {
|
| - HWND parent = root_window->GetAcceleratedWidget();
|
| + aura::WindowEventDispatcher* dispatcher = window_->GetDispatcher();
|
| + if (dispatcher) {
|
| + HWND parent = dispatcher->GetAcceleratedWidget();
|
| LPARAM lparam = reinterpret_cast<LPARAM>(this);
|
|
|
| EnumChildWindows(parent, HideWindowsCallback, lparam);
|
| @@ -763,11 +763,11 @@ void RenderWidgetHostViewAura::SetBounds(const gfx::Rect& rect) {
|
| void RenderWidgetHostViewAura::MaybeCreateResizeLock() {
|
| if (!ShouldCreateResizeLock())
|
| return;
|
| - DCHECK(window_->GetRootWindow());
|
| - DCHECK(window_->GetRootWindow()->compositor());
|
| + DCHECK(window_->GetDispatcher());
|
| + DCHECK(window_->GetDispatcher()->compositor());
|
|
|
| // Listen to changes in the compositor lock state.
|
| - ui::Compositor* compositor = window_->GetRootWindow()->compositor();
|
| + ui::Compositor* compositor = window_->GetDispatcher()->compositor();
|
| if (!compositor->HasObserver(this))
|
| compositor->AddObserver(this);
|
|
|
| @@ -805,11 +805,11 @@ bool RenderWidgetHostViewAura::ShouldCreateResizeLock() {
|
| if (desired_size == current_frame_size_)
|
| return false;
|
|
|
| - aura::RootWindow* root_window = window_->GetRootWindow();
|
| - if (!root_window)
|
| + aura::WindowEventDispatcher* dispatcher = window_->GetDispatcher();
|
| + if (!dispatcher)
|
| return false;
|
|
|
| - ui::Compositor* compositor = root_window->compositor();
|
| + ui::Compositor* compositor = dispatcher->compositor();
|
| if (!compositor)
|
| return false;
|
|
|
| @@ -820,7 +820,7 @@ scoped_ptr<ResizeLock> RenderWidgetHostViewAura::CreateResizeLock(
|
| bool defer_compositor_lock) {
|
| gfx::Size desired_size = window_->bounds().size();
|
| return scoped_ptr<ResizeLock>(new CompositorResizeLock(
|
| - window_->GetRootWindow(),
|
| + window_->GetDispatcher(),
|
| desired_size,
|
| defer_compositor_lock,
|
| base::TimeDelta::FromMilliseconds(kResizeLockTimeoutMs)));
|
| @@ -832,9 +832,9 @@ gfx::NativeView RenderWidgetHostViewAura::GetNativeView() const {
|
|
|
| gfx::NativeViewId RenderWidgetHostViewAura::GetNativeViewId() const {
|
| #if defined(OS_WIN)
|
| - aura::RootWindow* root_window = window_->GetRootWindow();
|
| - if (root_window) {
|
| - HWND window = root_window->GetAcceleratedWidget();
|
| + aura::WindowEventDispatcher* dispatcher = window_->GetDispatcher();
|
| + if (dispatcher) {
|
| + HWND window = dispatcher->GetAcceleratedWidget();
|
| return reinterpret_cast<gfx::NativeViewId>(window);
|
| }
|
| #endif
|
| @@ -843,10 +843,10 @@ gfx::NativeViewId RenderWidgetHostViewAura::GetNativeViewId() const {
|
|
|
| gfx::NativeViewAccessible RenderWidgetHostViewAura::GetNativeViewAccessible() {
|
| #if defined(OS_WIN)
|
| - aura::RootWindow* root_window = window_->GetRootWindow();
|
| - if (!root_window)
|
| + aura::WindowEventDispatcher* dispatcher = window_->GetDispatcher();
|
| + if (!dispatcher)
|
| return static_cast<gfx::NativeViewAccessible>(NULL);
|
| - HWND hwnd = root_window->GetAcceleratedWidget();
|
| + HWND hwnd = dispatcher->GetAcceleratedWidget();
|
|
|
| BrowserAccessibilityManager* manager =
|
| GetOrCreateBrowserAccessibilityManager();
|
| @@ -865,10 +865,10 @@ RenderWidgetHostViewAura::GetOrCreateBrowserAccessibilityManager() {
|
| return manager;
|
|
|
| #if defined(OS_WIN)
|
| - aura::RootWindow* root_window = window_->GetRootWindow();
|
| - if (!root_window)
|
| + aura::WindowEventDispatcher* dispatcher = window_->GetDispatcher();
|
| + if (!dispatcher)
|
| return NULL;
|
| - HWND hwnd = root_window->GetAcceleratedWidget();
|
| + HWND hwnd = dispatcher->GetAcceleratedWidget();
|
|
|
| // The accessible_parent may be NULL at this point. The WebContents will pass
|
| // it down to this instance (by way of the RenderViewHost and
|
| @@ -899,7 +899,7 @@ void RenderWidgetHostViewAura::MovePluginWindows(
|
| DCHECK(plugin_window_moves.empty());
|
| return;
|
| }
|
| - HWND parent = window_->GetRootWindow()->GetAcceleratedWidget();
|
| + HWND parent = window_->GetDispatcher()->GetAcceleratedWidget();
|
| gfx::Rect view_bounds = window_->GetBoundsInRootWindow();
|
| std::vector<WebPluginGeometry> moves = plugin_window_moves;
|
|
|
| @@ -1074,7 +1074,7 @@ void RenderWidgetHostViewAura::DidUpdateBackingStore(
|
| SchedulePaintIfNotInClip(scroll_rect, clip_rect);
|
|
|
| #if defined(OS_WIN)
|
| - aura::RootWindow* root_window = window_->GetRootWindow();
|
| + aura::WindowEventDispatcher* dispatcher = window_->GetDispatcher();
|
| #endif
|
| for (size_t i = 0; i < copy_rects.size(); ++i) {
|
| gfx::Rect rect = gfx::SubtractRects(copy_rects[i], scroll_rect);
|
| @@ -1084,12 +1084,12 @@ void RenderWidgetHostViewAura::DidUpdateBackingStore(
|
| SchedulePaintIfNotInClip(rect, clip_rect);
|
|
|
| #if defined(OS_WIN)
|
| - if (root_window) {
|
| + if (dispatcher) {
|
| // Send the invalid rect in screen coordinates.
|
| gfx::Rect screen_rect = GetViewBounds();
|
| gfx::Rect invalid_screen_rect(rect);
|
| invalid_screen_rect.Offset(screen_rect.x(), screen_rect.y());
|
| - HWND hwnd = root_window->GetAcceleratedWidget();
|
| + HWND hwnd = dispatcher->GetAcceleratedWidget();
|
| PaintPluginWindowsHelper(hwnd, invalid_screen_rect);
|
| }
|
| #endif // defined(OS_WIN)
|
| @@ -1112,7 +1112,7 @@ void RenderWidgetHostViewAura::Destroy() {
|
|
|
| void RenderWidgetHostViewAura::SetTooltipText(const string16& tooltip_text) {
|
| tooltip_ = tooltip_text;
|
| - aura::RootWindow* root_window = window_->GetRootWindow();
|
| + aura::Window* root_window = window_->GetRootWindow();
|
| aura::client::TooltipClient* tooltip_client =
|
| aura::client::GetTooltipClient(root_window);
|
| if (tooltip_client) {
|
| @@ -1158,7 +1158,7 @@ void RenderWidgetHostViewAura::SelectionBoundsChanged(
|
| }
|
|
|
| void RenderWidgetHostViewAura::ScrollOffsetChanged() {
|
| - aura::RootWindow* root = window_->GetRootWindow();
|
| + aura::Window* root = window_->GetRootWindow();
|
| if (!root)
|
| return;
|
| aura::client::CursorClient* cursor_client =
|
| @@ -1393,7 +1393,7 @@ void RenderWidgetHostViewAura::UpdateConstrainedWindowRects(
|
| void RenderWidgetHostViewAura::UpdateCutoutRects() {
|
| if (!window_->GetRootWindow())
|
| return;
|
| - HWND parent = window_->GetRootWindow()->GetAcceleratedWidget();
|
| + HWND parent = window_->GetDispatcher()->GetAcceleratedWidget();
|
| CutoutRectsParams params;
|
| params.widget = this;
|
| params.cutout_rects.assign(transient_rects_.begin(), transient_rects_.end());
|
| @@ -2123,10 +2123,10 @@ gfx::Rect RenderWidgetHostViewAura::GetBoundsInRootWindow() {
|
| RECT window_rect = {0};
|
|
|
| aura::Window* top_level = window_->GetToplevelWindow();
|
| - aura::RootWindow* root_window = top_level->GetRootWindow();
|
| - if (!root_window)
|
| + aura::WindowEventDispatcher* dispatcher = top_level->GetDispatcher();
|
| + if (!dispatcher)
|
| return top_level->GetBoundsInScreen();
|
| - HWND hwnd = root_window->GetAcceleratedWidget();
|
| + HWND hwnd = dispatcher->GetAcceleratedWidget();
|
| ::GetWindowRect(hwnd, &window_rect);
|
| gfx::Rect rect(window_rect);
|
|
|
| @@ -2158,16 +2158,16 @@ void RenderWidgetHostViewAura::ProcessAckedTouchEvent(
|
| SCREEN_COORDINATES))
|
| return;
|
|
|
| - aura::RootWindow* root = window_->GetRootWindow();
|
| - // |root| is NULL during tests.
|
| - if (!root)
|
| + aura::WindowEventDispatcher* dispatcher = window_->GetDispatcher();
|
| + // |dispatcher| is NULL during tests.
|
| + if (!dispatcher)
|
| return;
|
|
|
| ui::EventResult result = (ack_result ==
|
| INPUT_EVENT_ACK_STATE_CONSUMED) ? ui::ER_HANDLED : ui::ER_UNHANDLED;
|
| for (ScopedVector<ui::TouchEvent>::iterator iter = events.begin(),
|
| end = events.end(); iter != end; ++iter) {
|
| - root->ProcessedTouchEvent((*iter), window_, result);
|
| + dispatcher->ProcessedTouchEvent((*iter), window_, result);
|
| }
|
| }
|
|
|
| @@ -2212,7 +2212,7 @@ gfx::GLSurfaceHandle RenderWidgetHostViewAura::GetCompositingSurface() {
|
| }
|
|
|
| bool RenderWidgetHostViewAura::LockMouse() {
|
| - aura::RootWindow* root_window = window_->GetRootWindow();
|
| + aura::Window* root_window = window_->GetRootWindow();
|
| if (!root_window)
|
| return false;
|
|
|
| @@ -2240,7 +2240,7 @@ bool RenderWidgetHostViewAura::LockMouse() {
|
| }
|
|
|
| void RenderWidgetHostViewAura::UnlockMouse() {
|
| - aura::RootWindow* root_window = window_->GetRootWindow();
|
| + aura::Window* root_window = window_->GetRootWindow();
|
| if (!mouse_locked_ || !root_window)
|
| return;
|
|
|
| @@ -2349,7 +2349,7 @@ gfx::Rect RenderWidgetHostViewAura::ConvertRectToScreen(
|
| gfx::Point origin = rect.origin();
|
| gfx::Point end = gfx::Point(rect.right(), rect.bottom());
|
|
|
| - aura::RootWindow* root_window = window_->GetRootWindow();
|
| + aura::Window* root_window = window_->GetRootWindow();
|
| if (!root_window)
|
| return rect;
|
| aura::client::ScreenPositionClient* screen_position_client =
|
| @@ -2369,7 +2369,7 @@ gfx::Rect RenderWidgetHostViewAura::ConvertRectFromScreen(
|
| gfx::Point origin = rect.origin();
|
| gfx::Point end = gfx::Point(rect.right(), rect.bottom());
|
|
|
| - aura::RootWindow* root_window = window_->GetRootWindow();
|
| + aura::Window* root_window = window_->GetRootWindow();
|
| if (root_window) {
|
| aura::client::ScreenPositionClient* screen_position_client =
|
| aura::client::GetScreenPositionClient(root_window);
|
| @@ -2615,7 +2615,7 @@ void RenderWidgetHostViewAura::OnWindowDestroying() {
|
| if (!window_->GetRootWindow() || host_->is_hidden()) {
|
| parent = ui::GetHiddenWindow();
|
| } else {
|
| - parent = window_->GetRootWindow()->GetAcceleratedWidget();
|
| + parent = window_->GetDispatcher()->GetAcceleratedWidget();
|
| }
|
| LPARAM lparam = reinterpret_cast<LPARAM>(this);
|
| EnumChildWindows(parent, WindowDestroyingCallback, lparam);
|
| @@ -2819,9 +2819,9 @@ void RenderWidgetHostViewAura::OnMouseEvent(ui::MouseEvent* event) {
|
| // We get mouse wheel/scroll messages even if we are not in the foreground.
|
| // So here we check if we have any owned popup windows in the foreground and
|
| // dismiss them.
|
| - aura::RootWindow* root_window = window_->GetRootWindow();
|
| - if (root_window) {
|
| - HWND parent = root_window->GetAcceleratedWidget();
|
| + aura::WindowEventDispatcher* dispatcher = window_->GetDispatcher();
|
| + if (dispatcher) {
|
| + HWND parent = dispatcher->GetAcceleratedWidget();
|
| HWND toplevel_hwnd = ::GetAncestor(parent, GA_ROOT);
|
| EnumThreadWindows(GetCurrentThreadId(),
|
| DismissOwnedPopups,
|
| @@ -2976,10 +2976,10 @@ void RenderWidgetHostViewAura::OnGestureEvent(ui::GestureEvent* event) {
|
| // RenderWidgetHostViewAura, aura::client::ActivationDelegate implementation:
|
|
|
| bool RenderWidgetHostViewAura::ShouldActivate() const {
|
| - aura::RootWindow* root_window = window_->GetRootWindow();
|
| - if (!root_window)
|
| + aura::WindowEventDispatcher* dispatcher = window_->GetDispatcher();
|
| + if (!dispatcher)
|
| return true;
|
| - const ui::Event* event = root_window->current_event();
|
| + const ui::Event* event = dispatcher->current_event();
|
| if (!event)
|
| return true;
|
| return is_fullscreen_;
|
| @@ -2993,7 +2993,7 @@ void RenderWidgetHostViewAura::OnWindowActivated(aura::Window* gained_active,
|
| aura::Window* lost_active) {
|
| DCHECK(window_ == gained_active || window_ == lost_active);
|
| if (window_ == gained_active) {
|
| - const ui::Event* event = window_->GetRootWindow()->current_event();
|
| + const ui::Event* event = window_->GetDispatcher()->current_event();
|
| if (event && PointerEventActivates(*event))
|
| host_->OnPointerEventActivate();
|
| }
|
| @@ -3233,8 +3233,8 @@ RenderWidgetHostViewAura::~RenderWidgetHostViewAura() {
|
| #if defined(OS_WIN)
|
| transient_observer_.reset();
|
| #endif
|
| - if (window_->GetRootWindow())
|
| - window_->GetRootWindow()->RemoveRootWindowObserver(this);
|
| + if (window_->GetDispatcher())
|
| + window_->GetDispatcher()->RemoveRootWindowObserver(this);
|
| UnlockMouse();
|
| if (popup_type_ != WebKit::WebPopupTypeNone && popup_parent_host_view_) {
|
| DCHECK(popup_parent_host_view_->popup_child_host_view_ == NULL ||
|
| @@ -3265,10 +3265,12 @@ RenderWidgetHostViewAura::~RenderWidgetHostViewAura() {
|
| void RenderWidgetHostViewAura::UpdateCursorIfOverSelf() {
|
| const gfx::Point screen_point =
|
| gfx::Screen::GetScreenFor(GetNativeView())->GetCursorScreenPoint();
|
| - aura::RootWindow* root_window = window_->GetRootWindow();
|
| + aura::Window* root_window = window_->GetRootWindow();
|
| if (!root_window)
|
| return;
|
|
|
| + aura::WindowEventDispatcher* dispatcher = root_window->GetDispatcher();
|
| +
|
| gfx::Rect screen_rect = GetViewBounds();
|
| gfx::Point local_point = screen_point;
|
| local_point.Offset(-screen_rect.x(), -screen_rect.y());
|
| @@ -3277,7 +3279,7 @@ void RenderWidgetHostViewAura::UpdateCursorIfOverSelf() {
|
| // If there's another toplevel window above us at this point (for example a
|
| // menu), we don't want to update the cursor.
|
| POINT windows_point = { screen_point.x(), screen_point.y() };
|
| - if (root_window->GetAcceleratedWidget() != ::WindowFromPoint(windows_point))
|
| + if (dispatcher->GetAcceleratedWidget() != ::WindowFromPoint(windows_point))
|
| return;
|
| #endif
|
| if (root_window->GetEventHandlerForPoint(local_point) != window_)
|
| @@ -3296,7 +3298,7 @@ void RenderWidgetHostViewAura::UpdateCursorIfOverSelf() {
|
| }
|
|
|
| ui::InputMethod* RenderWidgetHostViewAura::GetInputMethod() const {
|
| - aura::RootWindow* root_window = window_->GetRootWindow();
|
| + aura::Window* root_window = window_->GetRootWindow();
|
| if (!root_window)
|
| return NULL;
|
| return root_window->GetProperty(aura::client::kRootWindowInputMethodKey);
|
| @@ -3405,7 +3407,7 @@ void RenderWidgetHostViewAura::AddOnCommitCallbackAndDisableLocks(
|
| }
|
|
|
| void RenderWidgetHostViewAura::AddedToRootWindow() {
|
| - window_->GetRootWindow()->AddRootWindowObserver(this);
|
| + window_->GetDispatcher()->AddRootWindowObserver(this);
|
| host_->ParentChanged(GetNativeViewId());
|
| UpdateScreenInfo(window_);
|
| if (popup_type_ != WebKit::WebPopupTypeNone)
|
| @@ -3428,7 +3430,7 @@ void RenderWidgetHostViewAura::RemovingFromRootWindow() {
|
| cursor_client->RemoveObserver(this);
|
|
|
| event_filter_for_popup_exit_.reset();
|
| - window_->GetRootWindow()->RemoveRootWindowObserver(this);
|
| + window_->GetDispatcher()->RemoveRootWindowObserver(this);
|
| host_->ParentChanged(0);
|
| ui::Compositor* compositor = GetCompositor();
|
| if (current_surface_.get()) {
|
| @@ -3447,8 +3449,8 @@ void RenderWidgetHostViewAura::RemovingFromRootWindow() {
|
| }
|
|
|
| ui::Compositor* RenderWidgetHostViewAura::GetCompositor() const {
|
| - aura::RootWindow* root_window = window_->GetRootWindow();
|
| - return root_window ? root_window->compositor() : NULL;
|
| + aura::WindowEventDispatcher* dispatcher = window_->GetDispatcher();
|
| + return dispatcher ? dispatcher->compositor() : NULL;
|
| }
|
|
|
| void RenderWidgetHostViewAura::DetachFromInputMethod() {
|
|
|