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

Side by Side Diff: ash/wm/shelf_layout_manager.cc

Issue 10852003: Changes all non-workspace code to talk to WorkspaceManager via (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more constness Created 8 years, 4 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 | « ash/wm/shelf_layout_manager.h ('k') | ash/wm/workspace/workspace_event_filter_unittest.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) 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 "ash/wm/shelf_layout_manager.h" 5 #include "ash/wm/shelf_layout_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/launcher/launcher.h" 9 #include "ash/launcher/launcher.h"
10 #include "ash/screen_ash.h" 10 #include "ash/screen_ash.h"
11 #include "ash/shell.h" 11 #include "ash/shell.h"
12 #include "ash/shell_delegate.h" 12 #include "ash/shell_delegate.h"
13 #include "ash/shell_window_ids.h" 13 #include "ash/shell_window_ids.h"
14 #include "ash/system/status_area_widget.h" 14 #include "ash/system/status_area_widget.h"
15 #include "ash/system/tray/system_tray.h" 15 #include "ash/system/tray/system_tray.h"
16 #include "ash/system/web_notification/web_notification_tray.h" 16 #include "ash/system/web_notification/web_notification_tray.h"
17 #include "ash/wm/workspace/workspace_manager.h" 17 #include "ash/wm/workspace_controller.h"
18 #include "base/auto_reset.h" 18 #include "base/auto_reset.h"
19 #include "base/i18n/rtl.h" 19 #include "base/i18n/rtl.h"
20 #include "ui/aura/client/activation_client.h" 20 #include "ui/aura/client/activation_client.h"
21 #include "ui/aura/event.h" 21 #include "ui/aura/event.h"
22 #include "ui/aura/event_filter.h" 22 #include "ui/aura/event_filter.h"
23 #include "ui/aura/root_window.h" 23 #include "ui/aura/root_window.h"
24 #include "ui/compositor/layer.h" 24 #include "ui/compositor/layer.h"
25 #include "ui/compositor/layer_animation_observer.h" 25 #include "ui/compositor/layer_animation_observer.h"
26 #include "ui/compositor/layer_animator.h" 26 #include "ui/compositor/layer_animator.h"
27 #include "ui/compositor/scoped_layer_animation_settings.h" 27 #include "ui/compositor/scoped_layer_animation_settings.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 //////////////////////////////////////////////////////////////////////////////// 122 ////////////////////////////////////////////////////////////////////////////////
123 // ShelfLayoutManager, public: 123 // ShelfLayoutManager, public:
124 124
125 ShelfLayoutManager::ShelfLayoutManager(views::Widget* status) 125 ShelfLayoutManager::ShelfLayoutManager(views::Widget* status)
126 : root_window_(Shell::GetPrimaryRootWindow()), 126 : root_window_(Shell::GetPrimaryRootWindow()),
127 in_layout_(false), 127 in_layout_(false),
128 auto_hide_behavior_(SHELF_AUTO_HIDE_BEHAVIOR_DEFAULT), 128 auto_hide_behavior_(SHELF_AUTO_HIDE_BEHAVIOR_DEFAULT),
129 alignment_(SHELF_ALIGNMENT_BOTTOM), 129 alignment_(SHELF_ALIGNMENT_BOTTOM),
130 launcher_(NULL), 130 launcher_(NULL),
131 status_(status), 131 status_(status),
132 workspace_manager_(NULL), 132 workspace_controller_(NULL),
133 window_overlaps_shelf_(false) { 133 window_overlaps_shelf_(false) {
134 Shell::GetInstance()->AddShellObserver(this); 134 Shell::GetInstance()->AddShellObserver(this);
135 aura::client::GetActivationClient(root_window_)->AddObserver(this); 135 aura::client::GetActivationClient(root_window_)->AddObserver(this);
136 } 136 }
137 137
138 ShelfLayoutManager::~ShelfLayoutManager() { 138 ShelfLayoutManager::~ShelfLayoutManager() {
139 FOR_EACH_OBSERVER(Observer, observers_, WillDeleteShelf()); 139 FOR_EACH_OBSERVER(Observer, observers_, WillDeleteShelf());
140 Shell::GetInstance()->RemoveShellObserver(this); 140 Shell::GetInstance()->RemoveShellObserver(this);
141 aura::client::GetActivationClient(root_window_)->RemoveObserver(this); 141 aura::client::GetActivationClient(root_window_)->RemoveObserver(this);
142 } 142 }
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 Shell::GetPrimaryRootWindow(), 224 Shell::GetPrimaryRootWindow(),
225 target_bounds.work_area_insets); 225 target_bounds.work_area_insets);
226 UpdateHitTestBounds(); 226 UpdateHitTestBounds();
227 } 227 }
228 228
229 void ShelfLayoutManager::UpdateVisibilityState() { 229 void ShelfLayoutManager::UpdateVisibilityState() {
230 ShellDelegate* delegate = Shell::GetInstance()->delegate(); 230 ShellDelegate* delegate = Shell::GetInstance()->delegate();
231 if (delegate && delegate->IsScreenLocked()) { 231 if (delegate && delegate->IsScreenLocked()) {
232 SetState(VISIBLE); 232 SetState(VISIBLE);
233 } else { 233 } else {
234 WorkspaceManager::WindowState window_state( 234 WorkspaceWindowState window_state(workspace_controller_->GetWindowState());
235 workspace_manager_->GetWindowState());
236 switch (window_state) { 235 switch (window_state) {
237 case WorkspaceManager::WINDOW_STATE_FULL_SCREEN: 236 case WORKSPACE_WINDOW_STATE_FULL_SCREEN:
238 SetState(HIDDEN); 237 SetState(HIDDEN);
239 break; 238 break;
240 239
241 case WorkspaceManager::WINDOW_STATE_MAXIMIZED: 240 case WORKSPACE_WINDOW_STATE_MAXIMIZED:
242 SetState(auto_hide_behavior_ != SHELF_AUTO_HIDE_BEHAVIOR_NEVER ? 241 SetState(auto_hide_behavior_ != SHELF_AUTO_HIDE_BEHAVIOR_NEVER ?
243 AUTO_HIDE : VISIBLE); 242 AUTO_HIDE : VISIBLE);
244 break; 243 break;
245 244
246 case WorkspaceManager::WINDOW_STATE_WINDOW_OVERLAPS_SHELF: 245 case WORKSPACE_WINDOW_STATE_WINDOW_OVERLAPS_SHELF:
247 case WorkspaceManager::WINDOW_STATE_DEFAULT: 246 case WORKSPACE_WINDOW_STATE_DEFAULT:
248 SetState(auto_hide_behavior_ == SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS ? 247 SetState(auto_hide_behavior_ == SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS ?
249 AUTO_HIDE : VISIBLE); 248 AUTO_HIDE : VISIBLE);
250 SetWindowOverlapsShelf(window_state == 249 SetWindowOverlapsShelf(window_state ==
251 WorkspaceManager::WINDOW_STATE_WINDOW_OVERLAPS_SHELF); 250 WORKSPACE_WINDOW_STATE_WINDOW_OVERLAPS_SHELF);
252 } 251 }
253 } 252 }
254 } 253 }
255 254
256 void ShelfLayoutManager::UpdateAutoHideState() { 255 void ShelfLayoutManager::UpdateAutoHideState() {
257 AutoHideState auto_hide_state = 256 AutoHideState auto_hide_state =
258 CalculateAutoHideState(state_.visibility_state); 257 CalculateAutoHideState(state_.visibility_state);
259 if (auto_hide_state != state_.auto_hide_state) { 258 if (auto_hide_state != state_.auto_hide_state) {
260 if (auto_hide_state == AUTO_HIDE_HIDDEN) { 259 if (auto_hide_state == AUTO_HIDE_HIDDEN) {
261 // Hides happen immediately. 260 // Hides happen immediately.
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 int ShelfLayoutManager::GetWorkAreaSize(const State& state, int size) const { 599 int ShelfLayoutManager::GetWorkAreaSize(const State& state, int size) const {
601 if (state.visibility_state == VISIBLE) 600 if (state.visibility_state == VISIBLE)
602 return size; 601 return size;
603 if (state.visibility_state == AUTO_HIDE) 602 if (state.visibility_state == AUTO_HIDE)
604 return kAutoHideSize; 603 return kAutoHideSize;
605 return 0; 604 return 0;
606 } 605 }
607 606
608 } // namespace internal 607 } // namespace internal
609 } // namespace ash 608 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/shelf_layout_manager.h ('k') | ash/wm/workspace/workspace_event_filter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698