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

Side by Side Diff: ui/aura/test/test_window_delegate.h

Issue 8570011: Aura: windows in aura should honor Widget::InitParams::accept_events (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: minor changes Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | ui/aura/test/test_window_delegate.cc » ('j') | ui/aura/window_delegate.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef UI_AURA_TEST_TEST_WINDOW_DELEGATE_H_ 5 #ifndef UI_AURA_TEST_TEST_WINDOW_DELEGATE_H_
6 #define UI_AURA_TEST_TEST_WINDOW_DELEGATE_H_ 6 #define UI_AURA_TEST_TEST_WINDOW_DELEGATE_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "third_party/skia/include/core/SkColor.h" 10 #include "third_party/skia/include/core/SkColor.h"
11 #include "ui/aura/window_delegate.h" 11 #include "ui/aura/window_delegate.h"
12 12
13 namespace aura { 13 namespace aura {
14 namespace test { 14 namespace test {
15 15
16 // WindowDelegate implementation with all methods stubbed out. 16 // WindowDelegate implementation with all methods stubbed out.
17 class TestWindowDelegate : public WindowDelegate { 17 class TestWindowDelegate : public WindowDelegate {
18 public: 18 public:
19 TestWindowDelegate(); 19 TestWindowDelegate();
20 virtual ~TestWindowDelegate(); 20 virtual ~TestWindowDelegate();
21 21
22 void set_accept_events(bool accept_events) { accept_events_ = accept_events; }
23
22 // Overridden from WindowDelegate: 24 // Overridden from WindowDelegate:
23 virtual void OnBoundsChanged(const gfx::Rect& old_bounds, 25 virtual void OnBoundsChanged(const gfx::Rect& old_bounds,
24 const gfx::Rect& new_bounds); 26 const gfx::Rect& new_bounds);
25 virtual void OnFocus() OVERRIDE; 27 virtual void OnFocus() OVERRIDE;
26 virtual void OnBlur() OVERRIDE; 28 virtual void OnBlur() OVERRIDE;
27 virtual bool OnKeyEvent(KeyEvent* event) OVERRIDE; 29 virtual bool OnKeyEvent(KeyEvent* event) OVERRIDE;
28 virtual gfx::NativeCursor GetCursor(const gfx::Point& point) OVERRIDE; 30 virtual gfx::NativeCursor GetCursor(const gfx::Point& point) OVERRIDE;
29 virtual int GetNonClientComponent(const gfx::Point& point) const OVERRIDE; 31 virtual int GetNonClientComponent(const gfx::Point& point) const OVERRIDE;
30 virtual bool OnMouseEvent(MouseEvent* event) OVERRIDE; 32 virtual bool OnMouseEvent(MouseEvent* event) OVERRIDE;
31 virtual ui::TouchStatus OnTouchEvent(TouchEvent* event) OVERRIDE; 33 virtual ui::TouchStatus OnTouchEvent(TouchEvent* event) OVERRIDE;
32 virtual bool ShouldActivate(Event* event) OVERRIDE; 34 virtual bool ShouldActivate(Event* event) OVERRIDE;
35 virtual bool ShouldAcceptEvents() OVERRIDE;
33 virtual void OnActivated() OVERRIDE; 36 virtual void OnActivated() OVERRIDE;
34 virtual void OnLostActive() OVERRIDE; 37 virtual void OnLostActive() OVERRIDE;
35 virtual void OnCaptureLost() OVERRIDE; 38 virtual void OnCaptureLost() OVERRIDE;
36 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; 39 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
37 virtual void OnWindowDestroying() OVERRIDE; 40 virtual void OnWindowDestroying() OVERRIDE;
38 virtual void OnWindowDestroyed() OVERRIDE; 41 virtual void OnWindowDestroyed() OVERRIDE;
39 virtual void OnWindowVisibilityChanged(bool visible) OVERRIDE; 42 virtual void OnWindowVisibilityChanged(bool visible) OVERRIDE;
40 43
41 private: 44 private:
45 bool accept_events_;
46
42 DISALLOW_COPY_AND_ASSIGN(TestWindowDelegate); 47 DISALLOW_COPY_AND_ASSIGN(TestWindowDelegate);
43 }; 48 };
44 49
45 // A simple WindowDelegate implementation for these tests. It owns itself 50 // A simple WindowDelegate implementation for these tests. It owns itself
46 // (deletes itself when the Window it is attached to is destroyed). 51 // (deletes itself when the Window it is attached to is destroyed).
47 class ColorTestWindowDelegate : public TestWindowDelegate { 52 class ColorTestWindowDelegate : public TestWindowDelegate {
48 public: 53 public:
49 explicit ColorTestWindowDelegate(SkColor color); 54 explicit ColorTestWindowDelegate(SkColor color);
50 virtual ~ColorTestWindowDelegate(); 55 virtual ~ColorTestWindowDelegate();
51 56
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 int lost_active_count_; 92 int lost_active_count_;
88 int should_activate_count_; 93 int should_activate_count_;
89 94
90 DISALLOW_COPY_AND_ASSIGN(ActivateWindowDelegate); 95 DISALLOW_COPY_AND_ASSIGN(ActivateWindowDelegate);
91 }; 96 };
92 97
93 } // namespace test 98 } // namespace test
94 } // namespace aura 99 } // namespace aura
95 100
96 #endif // UI_AURA_TEST_TEST_WINDOW_DELEGATE_H_ 101 #endif // UI_AURA_TEST_TEST_WINDOW_DELEGATE_H_
OLDNEW
« no previous file with comments | « no previous file | ui/aura/test/test_window_delegate.cc » ('j') | ui/aura/window_delegate.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698