| 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 "base/at_exit.h" | 5 #include "base/at_exit.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/i18n/icu_util.h" | 7 #include "base/i18n/icu_util.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "third_party/skia/include/core/SkXfermode.h" | 10 #include "third_party/skia/include/core/SkXfermode.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 explicit DemoWindowDelegate(SkColor color) : color_(color) {} | 35 explicit DemoWindowDelegate(SkColor color) : color_(color) {} |
| 36 | 36 |
| 37 // Overridden from WindowDelegate: | 37 // Overridden from WindowDelegate: |
| 38 virtual gfx::Size GetMinimumSize() const OVERRIDE { | 38 virtual gfx::Size GetMinimumSize() const OVERRIDE { |
| 39 return gfx::Size(); | 39 return gfx::Size(); |
| 40 } | 40 } |
| 41 virtual void OnBoundsChanged(const gfx::Rect& old_bounds, | 41 virtual void OnBoundsChanged(const gfx::Rect& old_bounds, |
| 42 const gfx::Rect& new_bounds) OVERRIDE {} | 42 const gfx::Rect& new_bounds) OVERRIDE {} |
| 43 virtual void OnFocus(aura::Window* old_focused_window) OVERRIDE {} | 43 virtual void OnFocus(aura::Window* old_focused_window) OVERRIDE {} |
| 44 virtual void OnBlur() OVERRIDE {} | 44 virtual void OnBlur() OVERRIDE {} |
| 45 virtual bool OnKeyEvent(ui::KeyEvent* event) OVERRIDE { | |
| 46 return false; | |
| 47 } | |
| 48 virtual gfx::NativeCursor GetCursor(const gfx::Point& point) OVERRIDE { | 45 virtual gfx::NativeCursor GetCursor(const gfx::Point& point) OVERRIDE { |
| 49 return gfx::kNullCursor; | 46 return gfx::kNullCursor; |
| 50 } | 47 } |
| 51 virtual int GetNonClientComponent(const gfx::Point& point) const OVERRIDE { | 48 virtual int GetNonClientComponent(const gfx::Point& point) const OVERRIDE { |
| 52 return HTCAPTION; | 49 return HTCAPTION; |
| 53 } | 50 } |
| 54 virtual bool ShouldDescendIntoChildForEventHandling( | 51 virtual bool ShouldDescendIntoChildForEventHandling( |
| 55 aura::Window* child, | 52 aura::Window* child, |
| 56 const gfx::Point& location) OVERRIDE { | 53 const gfx::Point& location) OVERRIDE { |
| 57 return true; | 54 return true; |
| 58 } | 55 } |
| 59 virtual bool OnMouseEvent(ui::MouseEvent* event) OVERRIDE { | |
| 60 return true; | |
| 61 } | |
| 62 virtual ui::TouchStatus OnTouchEvent(ui::TouchEvent* event) OVERRIDE { | |
| 63 return ui::TOUCH_STATUS_END; | |
| 64 } | |
| 65 virtual ui::EventResult OnGestureEvent( | |
| 66 ui::GestureEvent* event) OVERRIDE { | |
| 67 return ui::ER_UNHANDLED; | |
| 68 } | |
| 69 virtual bool CanFocus() OVERRIDE { return true; } | 56 virtual bool CanFocus() OVERRIDE { return true; } |
| 70 virtual void OnCaptureLost() OVERRIDE {} | 57 virtual void OnCaptureLost() OVERRIDE {} |
| 71 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE { | 58 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE { |
| 72 canvas->DrawColor(color_, SkXfermode::kSrc_Mode); | 59 canvas->DrawColor(color_, SkXfermode::kSrc_Mode); |
| 73 } | 60 } |
| 74 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE {} | 61 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE {} |
| 75 virtual void OnWindowDestroying() OVERRIDE {} | 62 virtual void OnWindowDestroying() OVERRIDE {} |
| 76 virtual void OnWindowDestroyed() OVERRIDE {} | 63 virtual void OnWindowDestroyed() OVERRIDE {} |
| 77 virtual void OnWindowTargetVisibilityChanged(bool visible) OVERRIDE {} | 64 virtual void OnWindowTargetVisibilityChanged(bool visible) OVERRIDE {} |
| 78 virtual bool HasHitTestMask() const OVERRIDE { return false; } | 65 virtual bool HasHitTestMask() const OVERRIDE { return false; } |
| 79 virtual void GetHitTestMask(gfx::Path* mask) const OVERRIDE {} | 66 virtual void GetHitTestMask(gfx::Path* mask) const OVERRIDE {} |
| 80 | 67 |
| 68 // Overridden from ui::EventHandler: |
| 69 virtual ui::EventResult OnKeyEvent(ui::KeyEvent* event) OVERRIDE { |
| 70 return ui::ER_UNHANDLED; |
| 71 } |
| 72 virtual ui::EventResult OnMouseEvent(ui::MouseEvent* event) OVERRIDE { |
| 73 return ui::ER_HANDLED; |
| 74 } |
| 75 virtual ui::TouchStatus OnTouchEvent(ui::TouchEvent* event) OVERRIDE { |
| 76 return ui::TOUCH_STATUS_END; |
| 77 } |
| 78 virtual ui::EventResult OnGestureEvent(ui::GestureEvent* event) OVERRIDE { |
| 79 return ui::ER_UNHANDLED; |
| 80 } |
| 81 |
| 81 private: | 82 private: |
| 82 SkColor color_; | 83 SkColor color_; |
| 83 | 84 |
| 84 DISALLOW_COPY_AND_ASSIGN(DemoWindowDelegate); | 85 DISALLOW_COPY_AND_ASSIGN(DemoWindowDelegate); |
| 85 }; | 86 }; |
| 86 | 87 |
| 87 class DemoStackingClient : public aura::client::StackingClient { | 88 class DemoStackingClient : public aura::client::StackingClient { |
| 88 public: | 89 public: |
| 89 explicit DemoStackingClient(aura::RootWindow* root_window) | 90 explicit DemoStackingClient(aura::RootWindow* root_window) |
| 90 : root_window_(root_window) { | 91 : root_window_(root_window) { |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 window3.Show(); | 161 window3.Show(); |
| 161 window3.SetParent(&window2); | 162 window3.SetParent(&window2); |
| 162 | 163 |
| 163 root_window->ShowRootWindow(); | 164 root_window->ShowRootWindow(); |
| 164 MessageLoopForUI::current()->Run(); | 165 MessageLoopForUI::current()->Run(); |
| 165 | 166 |
| 166 ui::CompositorTestSupport::Terminate(); | 167 ui::CompositorTestSupport::Terminate(); |
| 167 | 168 |
| 168 return 0; | 169 return 0; |
| 169 } | 170 } |
| OLD | NEW |