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

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

Issue 9719037: Aura: Add non-browser windows into the list of "Alt + Tab" cycle list. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review fix Created 8 years, 8 months 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') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "ui/aura/test/test_activation_client.h" 5 #include "ui/aura/test/test_activation_client.h"
6 6
7 #include "ui/aura/client/activation_delegate.h" 7 #include "ui/aura/client/activation_delegate.h"
8 #include "ui/aura/root_window.h" 8 #include "ui/aura/root_window.h"
9 #include "ui/aura/window.h" 9 #include "ui/aura/window.h"
10 10
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 if (active_windows_.empty()) 52 if (active_windows_.empty())
53 return NULL; 53 return NULL;
54 return active_windows_.back(); 54 return active_windows_.back();
55 } 55 }
56 56
57 bool TestActivationClient::OnWillFocusWindow(Window* window, 57 bool TestActivationClient::OnWillFocusWindow(Window* window,
58 const Event* event) { 58 const Event* event) {
59 return true; 59 return true;
60 } 60 }
61 61
62 bool TestActivationClient::CanActivateWindow(Window* window) const {
63 return true;
64 }
65
62 //////////////////////////////////////////////////////////////////////////////// 66 ////////////////////////////////////////////////////////////////////////////////
63 // TestActivationClient, WindowObserver implementation: 67 // TestActivationClient, WindowObserver implementation:
64 68
65 void TestActivationClient::OnWindowDestroyed(Window* window) { 69 void TestActivationClient::OnWindowDestroyed(Window* window) {
66 if (window == GetActiveWindow()) { 70 if (window == GetActiveWindow()) {
67 window->RemoveObserver(this); 71 window->RemoveObserver(this);
68 active_windows_.pop_back(); 72 active_windows_.pop_back();
69 Window* next_active = GetActiveWindow(); 73 Window* next_active = GetActiveWindow();
70 if (next_active && aura::client::GetActivationDelegate(next_active)) 74 if (next_active && aura::client::GetActivationDelegate(next_active))
71 aura::client::GetActivationDelegate(next_active)->OnActivated(); 75 aura::client::GetActivationDelegate(next_active)->OnActivated();
72 return; 76 return;
73 } 77 }
74 78
75 RemoveActiveWindow(window); 79 RemoveActiveWindow(window);
76 } 80 }
77 81
78 void TestActivationClient::RemoveActiveWindow(Window* window) { 82 void TestActivationClient::RemoveActiveWindow(Window* window) {
79 for (unsigned int i = 0; i < active_windows_.size(); ++i) { 83 for (unsigned int i = 0; i < active_windows_.size(); ++i) {
80 if (active_windows_[i] == window) { 84 if (active_windows_[i] == window) {
81 active_windows_.erase(active_windows_.begin() + i); 85 active_windows_.erase(active_windows_.begin() + i);
82 window->RemoveObserver(this); 86 window->RemoveObserver(this);
83 return; 87 return;
84 } 88 }
85 } 89 }
86 } 90 }
87 91
88 } // namespace test 92 } // namespace test
89 } // namespace aura 93 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/test/test_activation_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698