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

Unified Diff: ui/aura/test/test_activation_client.cc

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/test/test_activation_client.h ('k') | ui/aura/test/test_stacking_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/test/test_activation_client.cc
===================================================================
--- ui/aura/test/test_activation_client.cc (revision 0)
+++ ui/aura/test/test_activation_client.cc (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.
+
+#include "ui/aura/test/test_activation_client.h"
+
+#include "ui/aura/window.h"
+
+namespace aura {
+namespace test {
+
+////////////////////////////////////////////////////////////////////////////////
+// TestActivationClient, public:
+
+TestActivationClient::TestActivationClient() : active_window_(NULL) {
+ ActivationClient::SetActivationClient(this);
+}
+
+TestActivationClient::~TestActivationClient() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// TestActivationClient, ActivationClient implementation:
+
+void TestActivationClient::ActivateWindow(Window* window) {
+ if (active_window_)
+ active_window_->RemoveObserver(this);
+ active_window_ = window;
+ active_window_->AddObserver(this);
+}
+
+void TestActivationClient::DeactivateWindow(Window* window) {
+ if (window == active_window_) {
+ if (active_window_)
+ active_window_->RemoveObserver(this);
+ active_window_ = NULL;
+ }
+}
+
+Window* TestActivationClient::GetActiveWindow() {
+ return active_window_;
+}
+
+bool TestActivationClient::CanFocusWindow(Window* window) const {
+ return true;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// TestActivationClient, WindowObserver implementation:
+
+void TestActivationClient::OnWindowDestroyed(Window* window) {
+ if (window == active_window_) {
+ window->RemoveObserver(this);
+ active_window_ = NULL;
+ }
+}
+
+} // namespace test
+} // namespace aura
Property changes on: ui\aura\test\test_activation_client.cc
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « ui/aura/test/test_activation_client.h ('k') | ui/aura/test/test_stacking_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698