OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "mojo/services/window_manager/window_manager_app.h" | 5 #include "mojo/services/window_manager/window_manager_app.h" |
6 | 6 |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "mojo/aura/aura_init.h" | 9 #include "mojo/aura/aura_init.h" |
10 #include "mojo/public/cpp/application/application_connection.h" | 10 #include "mojo/public/cpp/application/application_connection.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 // these windows. (The aura WindowTargeter won't allow a delegate-less window | 30 // these windows. (The aura WindowTargeter won't allow a delegate-less window |
31 // to be the target of an event, since the window delegate is considered the | 31 // to be the target of an event, since the window delegate is considered the |
32 // "target handler"). | 32 // "target handler"). |
33 class DummyDelegate : public aura::WindowDelegate { | 33 class DummyDelegate : public aura::WindowDelegate { |
34 public: | 34 public: |
35 DummyDelegate() {} | 35 DummyDelegate() {} |
36 virtual ~DummyDelegate() {} | 36 virtual ~DummyDelegate() {} |
37 | 37 |
38 private: | 38 private: |
39 // WindowDelegate overrides: | 39 // WindowDelegate overrides: |
40 virtual gfx::Size GetMinimumSize() const OVERRIDE { return gfx::Size(); } | 40 virtual gfx::Size GetMinimumSize() const override { return gfx::Size(); } |
41 virtual gfx::Size GetMaximumSize() const OVERRIDE { return gfx::Size(); } | 41 virtual gfx::Size GetMaximumSize() const override { return gfx::Size(); } |
42 virtual void OnBoundsChanged(const gfx::Rect& old_bounds, | 42 virtual void OnBoundsChanged(const gfx::Rect& old_bounds, |
43 const gfx::Rect& new_bounds) OVERRIDE {} | 43 const gfx::Rect& new_bounds) override {} |
44 virtual gfx::NativeCursor GetCursor(const gfx::Point& point) OVERRIDE { | 44 virtual gfx::NativeCursor GetCursor(const gfx::Point& point) override { |
45 return gfx::kNullCursor; | 45 return gfx::kNullCursor; |
46 } | 46 } |
47 virtual int GetNonClientComponent(const gfx::Point& point) const OVERRIDE { | 47 virtual int GetNonClientComponent(const gfx::Point& point) const override { |
48 return HTCAPTION; | 48 return HTCAPTION; |
49 } | 49 } |
50 virtual bool ShouldDescendIntoChildForEventHandling( | 50 virtual bool ShouldDescendIntoChildForEventHandling( |
51 aura::Window* child, | 51 aura::Window* child, |
52 const gfx::Point& location) OVERRIDE { return true; } | 52 const gfx::Point& location) override { return true; } |
53 virtual bool CanFocus() OVERRIDE { return true; } | 53 virtual bool CanFocus() override { return true; } |
54 virtual void OnCaptureLost() OVERRIDE {} | 54 virtual void OnCaptureLost() override {} |
55 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE {} | 55 virtual void OnPaint(gfx::Canvas* canvas) override {} |
56 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE {} | 56 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) override {} |
57 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE {} | 57 virtual void OnWindowDestroying(aura::Window* window) override {} |
58 virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE {} | 58 virtual void OnWindowDestroyed(aura::Window* window) override {} |
59 virtual void OnWindowTargetVisibilityChanged(bool visible) OVERRIDE {} | 59 virtual void OnWindowTargetVisibilityChanged(bool visible) override {} |
60 virtual bool HasHitTestMask() const OVERRIDE { return false; } | 60 virtual bool HasHitTestMask() const override { return false; } |
61 virtual void GetHitTestMask(gfx::Path* mask) const OVERRIDE {} | 61 virtual void GetHitTestMask(gfx::Path* mask) const override {} |
62 | 62 |
63 DISALLOW_COPY_AND_ASSIGN(DummyDelegate); | 63 DISALLOW_COPY_AND_ASSIGN(DummyDelegate); |
64 }; | 64 }; |
65 | 65 |
66 namespace { | 66 namespace { |
67 | 67 |
68 DEFINE_WINDOW_PROPERTY_KEY(View*, kViewKey, NULL); | 68 DEFINE_WINDOW_PROPERTY_KEY(View*, kViewKey, NULL); |
69 | 69 |
70 Id GetIdForWindow(aura::Window* window) { | 70 Id GetIdForWindow(aura::Window* window) { |
71 return window ? WindowManagerApp::GetViewForWindow(window)->id() : 0; | 71 return window ? WindowManagerApp::GetViewForWindow(window)->id() : 0; |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 ViewIdToWindowMap::iterator it = view_id_to_window_map_.find(view->id()); | 333 ViewIdToWindowMap::iterator it = view_id_to_window_map_.find(view->id()); |
334 DCHECK(it != view_id_to_window_map_.end()); | 334 DCHECK(it != view_id_to_window_map_.end()); |
335 scoped_ptr<aura::Window> window(it->second); | 335 scoped_ptr<aura::Window> window(it->second); |
336 view_id_to_window_map_.erase(it); | 336 view_id_to_window_map_.erase(it); |
337 View::Children::const_iterator child = view->children().begin(); | 337 View::Children::const_iterator child = view->children().begin(); |
338 for (; child != view->children().end(); ++child) | 338 for (; child != view->children().end(); ++child) |
339 UnregisterSubtree(*child); | 339 UnregisterSubtree(*child); |
340 } | 340 } |
341 | 341 |
342 } // namespace mojo | 342 } // namespace mojo |
OLD | NEW |