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

Side by Side Diff: ui/aura_shell/shell.cc

Issue 8817018: Implement cycle window forward/backward by keyboard shortcuts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 'Move IsLocked to Shell' 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_shell/shell.h ('k') | ui/aura_shell/shell_accelerator_controller.cc » ('j') | 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) 2011 The Chromium Authors. All rights reserved. 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 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_shell/shell.h" 5 #include "ui/aura_shell/shell.h"
6 6
7 #include <algorithm>
8
7 #include "base/bind.h" 9 #include "base/bind.h"
8 #include "base/command_line.h" 10 #include "base/command_line.h"
9 #include "ui/aura/aura_switches.h" 11 #include "ui/aura/aura_switches.h"
10 #include "ui/aura/client/aura_constants.h" 12 #include "ui/aura/client/aura_constants.h"
11 #include "ui/aura/client/drag_drop_client.h" 13 #include "ui/aura/client/drag_drop_client.h"
12 #include "ui/aura/root_window.h" 14 #include "ui/aura/root_window.h"
13 #include "ui/aura/layout_manager.h" 15 #include "ui/aura/layout_manager.h"
14 #include "ui/aura/window.h" 16 #include "ui/aura/window.h"
15 #include "ui/aura/window_types.h" 17 #include "ui/aura/window_types.h"
16 #include "ui/aura_shell/app_list.h" 18 #include "ui/aura_shell/app_list.h"
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 if (workspace_controller_.get()) 276 if (workspace_controller_.get())
275 workspace_controller_->ToggleOverview(); 277 workspace_controller_->ToggleOverview();
276 } 278 }
277 279
278 void Shell::ToggleAppList() { 280 void Shell::ToggleAppList() {
279 if (!app_list_.get()) 281 if (!app_list_.get())
280 app_list_.reset(new internal::AppList); 282 app_list_.reset(new internal::AppList);
281 app_list_->SetVisible(!app_list_->IsVisible()); 283 app_list_->SetVisible(!app_list_->IsVisible());
282 } 284 }
283 285
286 // Returns true if the screen is locked.
287 bool Shell::IsScreenLocked() const {
288 const aura::Window* lock_screen_container = GetContainer(
289 internal::kShellWindowId_LockScreenContainer);
290 const aura::Window::Windows& lock_screen_windows =
291 lock_screen_container->children();
292 aura::Window::Windows::const_iterator lock_screen_it =
293 std::find_if(lock_screen_windows.begin(), lock_screen_windows.end(),
294 std::mem_fun(&aura::Window::IsVisible));
295 if (lock_screen_it != lock_screen_windows.end())
296 return true;
297
298 const aura::Window* lock_modal_container = GetContainer(
Ben Goodger (Google) 2011/12/11 21:54:05 I don't believe it's possible to return true from
mazda 2011/12/12 04:53:33 This returns true in the line 240 of shell_unittes
299 internal::kShellWindowId_LockModalContainer);
300 const aura::Window::Windows& lock_modal_windows =
301 lock_modal_container->children();
302 aura::Window::Windows::const_iterator lock_modal_it =
303 std::find_if(lock_modal_windows.begin(), lock_modal_windows.end(),
304 std::mem_fun(&aura::Window::IsVisible));
305 if (lock_modal_it != lock_modal_windows.end())
306 return true;
307
308 return false;
309 }
310
284 //////////////////////////////////////////////////////////////////////////////// 311 ////////////////////////////////////////////////////////////////////////////////
285 // Shell, private: 312 // Shell, private:
286 313
287 void Shell::EnableWorkspaceManager() { 314 void Shell::EnableWorkspaceManager() {
288 aura::Window* default_container = 315 aura::Window* default_container =
289 GetContainer(internal::kShellWindowId_DefaultContainer); 316 GetContainer(internal::kShellWindowId_DefaultContainer);
290 317
291 workspace_controller_.reset( 318 workspace_controller_.reset(
292 new internal::WorkspaceController(default_container)); 319 new internal::WorkspaceController(default_container));
293 workspace_controller_->SetLauncherModel(launcher_->model()); 320 workspace_controller_->SetLauncherModel(launcher_->model());
294 default_container->SetEventFilter( 321 default_container->SetEventFilter(
295 new internal::DefaultContainerEventFilter(default_container)); 322 new internal::DefaultContainerEventFilter(default_container));
296 default_container->SetLayoutManager( 323 default_container->SetLayoutManager(
297 new internal::DefaultContainerLayoutManager( 324 new internal::DefaultContainerLayoutManager(
298 workspace_controller_->workspace_manager())); 325 workspace_controller_->workspace_manager()));
299 } 326 }
300 327
301 } // namespace aura_shell 328 } // namespace aura_shell
OLDNEW
« no previous file with comments | « ui/aura_shell/shell.h ('k') | ui/aura_shell/shell_accelerator_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698