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

Unified Diff: components/exo/shell_surface.cc

Issue 2242283002: Add an adapter layer (WMHelper) between exo and ash. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update Created 4 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 side-by-side diff with in-line comments
Download patch
Index: components/exo/shell_surface.cc
diff --git a/components/exo/shell_surface.cc b/components/exo/shell_surface.cc
index 72f11c53c45055919cd6cbcda9f83703788b3c8d..dab4234e8aec6486c341578cab1a8734618cb9c0 100644
--- a/components/exo/shell_surface.cc
+++ b/components/exo/shell_surface.cc
@@ -9,7 +9,6 @@
#include "ash/common/wm/window_resizer.h"
#include "ash/common/wm/window_state.h"
#include "ash/common/wm/window_state_delegate.h"
-#include "ash/shell.h"
#include "ash/wm/window_state_aura.h"
#include "ash/wm/window_util.h"
#include "base/logging.h"
@@ -20,6 +19,7 @@
#include "base/trace_event/trace_event_argument.h"
#include "components/exo/surface.h"
#include "ui/aura/client/aura_constants.h"
+#include "ui/aura/client/cursor_client.h"
#include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_property.h"
@@ -34,7 +34,6 @@
#include "ui/wm/core/shadow_controller.h"
#include "ui/wm/core/shadow_types.h"
#include "ui/wm/core/window_util.h"
-#include "ui/wm/public/activation_client.h"
DECLARE_WINDOW_PROPERTY_TYPE(std::string*)
@@ -254,7 +253,7 @@ ShellSurface::ShellSurface(Surface* surface,
initial_bounds_(initial_bounds),
activatable_(activatable),
container_(container) {
- ash::Shell::GetInstance()->activation_client()->AddObserver(this);
+ WMHelper::GetInstance()->AddActivationObserver(this);
surface_->SetSurfaceDelegate(this);
surface_->AddSurfaceObserver(this);
surface_->window()->Show();
@@ -281,7 +280,7 @@ ShellSurface::~ShellSurface() {
widget_->Hide();
widget_->CloseNow();
}
- ash::Shell::GetInstance()->activation_client()->RemoveObserver(this);
+ WMHelper::GetInstance()->RemoveActivationObserver(this);
if (parent_)
parent_->RemoveObserver(this);
if (surface_) {
@@ -796,10 +795,9 @@ void ShellSurface::OnWindowDestroying(aura::Window* window) {
}
////////////////////////////////////////////////////////////////////////////////
-// aura::client::ActivationChangeObserver overrides:
+// WMHelper::ActivationObserver overrides:
void ShellSurface::OnWindowActivated(
- aura::client::ActivationChangeObserver::ActivationReason reason,
aura::Window* gained_active,
aura::Window* lost_active) {
if (!widget_)
@@ -906,8 +904,7 @@ void ShellSurface::CreateShellSurfaceWidget(ui::WindowShowState show_state) {
params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW;
params.show_state = show_state;
// Make shell surface a transient child if |parent_| has been set.
- params.parent = parent_ ? parent_ :
- ash::Shell::GetContainer(ash::Shell::GetTargetRootWindow(), container_);
+ params.parent = parent_ ? parent_ : WMHelper::GetContainer(container_);
params.bounds = initial_bounds_;
bool activatable = activatable_;
// ShellSurfaces in system modal container are only activatable if input
@@ -1070,7 +1067,7 @@ void ShellSurface::AttemptToStartDrag(int component) {
pending_origin_offset_ = gfx::Vector2d();
resize_component_ = pending_resize_component_;
- ash::Shell::GetInstance()->AddPreTargetHandler(this);
+ WMHelper::GetInstance()->AddPreTargetHandler(this);
widget_->GetNativeWindow()->SetCapture();
// Notify client that resizing state has changed.
@@ -1089,7 +1086,7 @@ void ShellSurface::EndDrag(bool revert) {
else
resizer_->CompleteDrag();
- ash::Shell::GetInstance()->RemovePreTargetHandler(this);
+ WMHelper::GetInstance()->RemovePreTargetHandler(this);
widget_->GetNativeWindow()->ReleaseCapture();
resizer_.reset();

Powered by Google App Engine
This is Rietveld 408576698