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

Unified Diff: ui/aura/test/test_window_delegate.h

Issue 8926004: Revert 114095 - Move the concept of Activation to the Shell. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/aura/test/test_stacking_client.cc ('k') | ui/aura/test/test_window_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/test/test_window_delegate.h
===================================================================
--- ui/aura/test/test_window_delegate.h (revision 114098)
+++ ui/aura/test/test_window_delegate.h (working copy)
@@ -31,6 +31,9 @@
virtual bool OnMouseEvent(MouseEvent* event) OVERRIDE;
virtual ui::TouchStatus OnTouchEvent(TouchEvent* event) OVERRIDE;
virtual bool CanFocus() OVERRIDE;
+ virtual bool ShouldActivate(Event* event) OVERRIDE;
+ virtual void OnActivated() OVERRIDE;
+ virtual void OnLostActive() OVERRIDE;
virtual void OnCaptureLost() OVERRIDE;
virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
virtual void OnWindowDestroying() OVERRIDE;
@@ -62,6 +65,33 @@
DISALLOW_COPY_AND_ASSIGN(ColorTestWindowDelegate);
};
+class ActivateWindowDelegate : public TestWindowDelegate {
+ public:
+ ActivateWindowDelegate();
+ explicit ActivateWindowDelegate(bool activate);
+
+ void set_activate(bool v) { activate_ = v; }
+ int activated_count() const { return activated_count_; }
+ int lost_active_count() const { return lost_active_count_; }
+ int should_activate_count() const { return should_activate_count_; }
+ void Clear() {
+ activated_count_ = lost_active_count_ = should_activate_count_ = 0;
+ }
+
+ // Overridden from TestWindowDelegate:
+ virtual bool ShouldActivate(Event* event) OVERRIDE;
+ virtual void OnActivated() OVERRIDE;
+ virtual void OnLostActive() OVERRIDE;
+
+ private:
+ bool activate_;
+ int activated_count_;
+ int lost_active_count_;
+ int should_activate_count_;
+
+ DISALLOW_COPY_AND_ASSIGN(ActivateWindowDelegate);
+};
+
} // namespace test
} // namespace aura
« no previous file with comments | « ui/aura/test/test_stacking_client.cc ('k') | ui/aura/test/test_window_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698