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

Unified Diff: ui/aura_shell/test/test_activation_delegate.h

Issue 8894018: 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_shell/stacking_controller_unittest.cc ('k') | ui/aura_shell/test/test_activation_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura_shell/test/test_activation_delegate.h
===================================================================
--- ui/aura_shell/test/test_activation_delegate.h (revision 0)
+++ ui/aura_shell/test/test_activation_delegate.h (revision 0)
@@ -0,0 +1,59 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_AURA_SHELL_TEST_TEST_ACTIVATION_DELEGATE_H_
+#define UI_AURA_SHELL_TEST_TEST_ACTIVATION_DELEGATE_H_
+#pragma once
+
+#include "base/compiler_specific.h"
+#include "base/logging.h"
+#include "ui/aura/client/activation_delegate.h"
+
+namespace aura {
+class Window;
+}
+
+namespace aura_shell {
+namespace test {
+
+// A test ActivationDelegate that can be used to track activation changes for
+// an aura::Window.
+class TestActivationDelegate : public aura::ActivationDelegate {
+ public:
+ TestActivationDelegate();
+ explicit TestActivationDelegate(bool activate);
+
+ // Associates this delegate with a Window.
+ void SetWindow(aura::Window* window);
+
+ bool window_was_active() const { return window_was_active_; }
+ 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;
+ window_was_active_ = false;
+ }
+
+ // Overridden from ActivationDelegate:
+ virtual bool ShouldActivate(aura::Event* event) OVERRIDE;
+ virtual void OnActivated() OVERRIDE;
+ virtual void OnLostActive() OVERRIDE;
+
+ private:
+ aura::Window* window_;
+ bool window_was_active_;
+ bool activate_;
+ int activated_count_;
+ int lost_active_count_;
+ int should_activate_count_;
+
+ DISALLOW_COPY_AND_ASSIGN(TestActivationDelegate);
+};
+
+} // namespace test
+} // namespace aura_shell
+
+#endif // UI_AURA_SHELL_TEST_TEST_ACTIVATION_DELEGATE_H_
Property changes on: ui\aura_shell\test\test_activation_delegate.h
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « ui/aura_shell/stacking_controller_unittest.cc ('k') | ui/aura_shell/test/test_activation_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698