| OLD | NEW |
| 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 "ash/root_window_controller.h" | 5 #include "ash/root_window_controller.h" |
| 6 | 6 |
| 7 #include <queue> | 7 #include <queue> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/ash_constants.h" | 10 #include "ash/ash_constants.h" |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 container->SetEventTargeter(scoped_ptr<ui::EventTargeter>( | 206 container->SetEventTargeter(scoped_ptr<ui::EventTargeter>( |
| 207 new ::wm::EasyResizeWindowTargeter(container, mouse_extend, | 207 new ::wm::EasyResizeWindowTargeter(container, mouse_extend, |
| 208 touch_extend))); | 208 touch_extend))); |
| 209 } | 209 } |
| 210 | 210 |
| 211 // A window delegate which does nothing. Used to create a window that | 211 // A window delegate which does nothing. Used to create a window that |
| 212 // is a event target, but do nothing. | 212 // is a event target, but do nothing. |
| 213 class EmptyWindowDelegate : public aura::WindowDelegate { | 213 class EmptyWindowDelegate : public aura::WindowDelegate { |
| 214 public: | 214 public: |
| 215 EmptyWindowDelegate() {} | 215 EmptyWindowDelegate() {} |
| 216 virtual ~EmptyWindowDelegate() {} | 216 ~EmptyWindowDelegate() override {} |
| 217 | 217 |
| 218 // aura::WindowDelegate overrides: | 218 // aura::WindowDelegate overrides: |
| 219 virtual gfx::Size GetMinimumSize() const override { | 219 gfx::Size GetMinimumSize() const override { return gfx::Size(); } |
| 220 return gfx::Size(); | 220 gfx::Size GetMaximumSize() const override { return gfx::Size(); } |
| 221 } | 221 void OnBoundsChanged(const gfx::Rect& old_bounds, |
| 222 virtual gfx::Size GetMaximumSize() const override { | 222 const gfx::Rect& new_bounds) override {} |
| 223 return gfx::Size(); | 223 gfx::NativeCursor GetCursor(const gfx::Point& point) override { |
| 224 } | |
| 225 virtual void OnBoundsChanged(const gfx::Rect& old_bounds, | |
| 226 const gfx::Rect& new_bounds) override { | |
| 227 } | |
| 228 virtual gfx::NativeCursor GetCursor(const gfx::Point& point) override { | |
| 229 return gfx::kNullCursor; | 224 return gfx::kNullCursor; |
| 230 } | 225 } |
| 231 virtual int GetNonClientComponent( | 226 int GetNonClientComponent(const gfx::Point& point) const override { |
| 232 const gfx::Point& point) const override { | |
| 233 return HTNOWHERE; | 227 return HTNOWHERE; |
| 234 } | 228 } |
| 235 virtual bool ShouldDescendIntoChildForEventHandling( | 229 bool ShouldDescendIntoChildForEventHandling( |
| 236 aura::Window* child, | 230 aura::Window* child, |
| 237 const gfx::Point& location) override { | 231 const gfx::Point& location) override { |
| 238 return false; | 232 return false; |
| 239 } | 233 } |
| 240 virtual bool CanFocus() override { | 234 bool CanFocus() override { return false; } |
| 241 return false; | 235 void OnCaptureLost() override {} |
| 242 } | 236 void OnPaint(gfx::Canvas* canvas) override {} |
| 243 virtual void OnCaptureLost() override { | 237 void OnDeviceScaleFactorChanged(float device_scale_factor) override {} |
| 244 } | 238 void OnWindowDestroying(aura::Window* window) override {} |
| 245 virtual void OnPaint(gfx::Canvas* canvas) override { | 239 void OnWindowDestroyed(aura::Window* window) override { delete this; } |
| 246 } | 240 void OnWindowTargetVisibilityChanged(bool visible) override {} |
| 247 virtual void OnDeviceScaleFactorChanged( | 241 bool HasHitTestMask() const override { return false; } |
| 248 float device_scale_factor) override { | 242 void GetHitTestMask(gfx::Path* mask) const override {} |
| 249 } | |
| 250 virtual void OnWindowDestroying(aura::Window* window) override {} | |
| 251 virtual void OnWindowDestroyed(aura::Window* window) override { | |
| 252 delete this; | |
| 253 } | |
| 254 virtual void OnWindowTargetVisibilityChanged(bool visible) override { | |
| 255 } | |
| 256 virtual bool HasHitTestMask() const override { | |
| 257 return false; | |
| 258 } | |
| 259 virtual void GetHitTestMask(gfx::Path* mask) const override {} | |
| 260 | 243 |
| 261 private: | 244 private: |
| 262 DISALLOW_COPY_AND_ASSIGN(EmptyWindowDelegate); | 245 DISALLOW_COPY_AND_ASSIGN(EmptyWindowDelegate); |
| 263 }; | 246 }; |
| 264 | 247 |
| 265 } // namespace | 248 } // namespace |
| 266 | 249 |
| 267 void RootWindowController::CreateForPrimaryDisplay(AshWindowTreeHost* host) { | 250 void RootWindowController::CreateForPrimaryDisplay(AshWindowTreeHost* host) { |
| 268 RootWindowController* controller = new RootWindowController(host); | 251 RootWindowController* controller = new RootWindowController(host); |
| 269 controller->Init(RootWindowController::PRIMARY, | 252 controller->Init(RootWindowController::PRIMARY, |
| (...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1068 else | 1051 else |
| 1069 DisableTouchHudProjection(); | 1052 DisableTouchHudProjection(); |
| 1070 } | 1053 } |
| 1071 | 1054 |
| 1072 RootWindowController* GetRootWindowController( | 1055 RootWindowController* GetRootWindowController( |
| 1073 const aura::Window* root_window) { | 1056 const aura::Window* root_window) { |
| 1074 return root_window ? GetRootWindowSettings(root_window)->controller : NULL; | 1057 return root_window ? GetRootWindowSettings(root_window)->controller : NULL; |
| 1075 } | 1058 } |
| 1076 | 1059 |
| 1077 } // namespace ash | 1060 } // namespace ash |
| OLD | NEW |