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

Side by Side Diff: ui/aura/test/test_activation_client.cc

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 unified diff | Download patch | Annotate | Revision Log
« 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "ui/aura/test/test_activation_client.h"
6
7 #include "ui/aura/window.h"
8
9 namespace aura {
10 namespace test {
11
12 ////////////////////////////////////////////////////////////////////////////////
13 // TestActivationClient, public:
14
15 TestActivationClient::TestActivationClient() : active_window_(NULL) {
16 ActivationClient::SetActivationClient(this);
17 }
18
19 TestActivationClient::~TestActivationClient() {
20 }
21
22 ////////////////////////////////////////////////////////////////////////////////
23 // TestActivationClient, ActivationClient implementation:
24
25 void TestActivationClient::ActivateWindow(Window* window) {
26 if (active_window_)
27 active_window_->RemoveObserver(this);
28 active_window_ = window;
29 active_window_->AddObserver(this);
30 }
31
32 void TestActivationClient::DeactivateWindow(Window* window) {
33 if (window == active_window_) {
34 if (active_window_)
35 active_window_->RemoveObserver(this);
36 active_window_ = NULL;
37 }
38 }
39
40 Window* TestActivationClient::GetActiveWindow() {
41 return active_window_;
42 }
43
44 bool TestActivationClient::CanFocusWindow(Window* window) const {
45 return true;
46 }
47
48 ////////////////////////////////////////////////////////////////////////////////
49 // TestActivationClient, WindowObserver implementation:
50
51 void TestActivationClient::OnWindowDestroyed(Window* window) {
52 if (window == active_window_) {
53 window->RemoveObserver(this);
54 active_window_ = NULL;
55 }
56 }
57
58 } // namespace test
59 } // namespace aura
OLDNEW
« 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