OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/ui/views/aura/aura_init.h" | 5 #include "chrome/browser/ui/views/aura/aura_init.h" |
6 | 6 |
7 #include "chrome/browser/ui/views/chrome_views_delegate.h" | 7 #include "chrome/browser/ui/views/chrome_views_delegate.h" |
8 #include "ui/aura/desktop.h" | 8 #include "ui/aura/desktop.h" |
| 9 #include "ui/aura/hit_test.h" |
9 #include "ui/aura/window_delegate.h" | 10 #include "ui/aura/window_delegate.h" |
10 #include "ui/gfx/canvas_skia.h" | 11 #include "ui/gfx/canvas_skia.h" |
11 #include "views/view.h" | 12 #include "views/view.h" |
12 #include "views/widget/widget.h" | 13 #include "views/widget/widget.h" |
13 | 14 |
14 namespace browser { | 15 namespace browser { |
15 | 16 |
16 namespace { | 17 namespace { |
17 | 18 |
18 // Trivial WindowDelegate implementation that draws a colored background. | 19 // Trivial WindowDelegate implementation that draws a colored background. |
19 class DemoWindowDelegate : public aura::WindowDelegate { | 20 class DemoWindowDelegate : public aura::WindowDelegate { |
20 public: | 21 public: |
21 explicit DemoWindowDelegate(SkColor color) : color_(color) {} | 22 explicit DemoWindowDelegate(SkColor color) : color_(color) {} |
22 | 23 |
23 // Overridden from aura::WindowDelegate: | 24 // Overridden from aura::WindowDelegate: |
| 25 virtual void OnBoundsChanged(const gfx::Rect& old_bounds, |
| 26 const gfx::Rect& new_bounds) OVERRIDE {} |
24 virtual void OnFocus() OVERRIDE {} | 27 virtual void OnFocus() OVERRIDE {} |
25 virtual void OnBlur() OVERRIDE {} | 28 virtual void OnBlur() OVERRIDE {} |
26 virtual bool OnKeyEvent(aura::KeyEvent* event) OVERRIDE { | 29 virtual bool OnKeyEvent(aura::KeyEvent* event) OVERRIDE { |
27 return false; | 30 return false; |
28 } | 31 } |
29 virtual int GetNonClientComponent(const gfx::Point& point) const OVERRIDE { | 32 virtual int GetNonClientComponent(const gfx::Point& point) const OVERRIDE { |
30 return HTCLIENT; | 33 return HTCLIENT; |
31 } | 34 } |
32 virtual bool OnMouseEvent(aura::MouseEvent* event) OVERRIDE { | 35 virtual bool OnMouseEvent(aura::MouseEvent* event) OVERRIDE { |
33 return true; | 36 return true; |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 DemoWindowDelegate* window_delegate1 = new DemoWindowDelegate(SK_ColorBLUE); | 90 DemoWindowDelegate* window_delegate1 = new DemoWindowDelegate(SK_ColorBLUE); |
88 aura::Window* window1 = new aura::Window(window_delegate1); | 91 aura::Window* window1 = new aura::Window(window_delegate1); |
89 window1->set_id(1); | 92 window1->set_id(1); |
90 window1->Init(); | 93 window1->Init(); |
91 window1->SetBounds(gfx::Rect(100, 100, 400, 400), 0); | 94 window1->SetBounds(gfx::Rect(100, 100, 400, 400), 0); |
92 window1->SetVisibility(aura::Window::VISIBILITY_SHOWN); | 95 window1->SetVisibility(aura::Window::VISIBILITY_SHOWN); |
93 window1->SetParent(NULL); | 96 window1->SetParent(NULL); |
94 } | 97 } |
95 | 98 |
96 } // namespace browser | 99 } // namespace browser |
OLD | NEW |