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

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

Issue 32943006: [Refactor] Replace kFullscreenUsesMinimalChromeKey with WindowState::hide_shelf_when_fullscreen() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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
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/shelf/shelf_layout_manager.h" 5 #include "ash/shelf/shelf_layout_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <cstring> 9 #include <cstring>
10 #include <string> 10 #include <string>
11 #include <vector> 11 #include <vector>
12 12
13 #include "ash/ash_switches.h" 13 #include "ash/ash_switches.h"
14 #include "ash/launcher/launcher.h" 14 #include "ash/launcher/launcher.h"
15 #include "ash/launcher/launcher_types.h" 15 #include "ash/launcher/launcher_types.h"
16 #include "ash/root_window_controller.h" 16 #include "ash/root_window_controller.h"
17 #include "ash/screen_ash.h" 17 #include "ash/screen_ash.h"
18 #include "ash/session_state_delegate.h" 18 #include "ash/session_state_delegate.h"
19 #include "ash/shelf/shelf_bezel_event_filter.h" 19 #include "ash/shelf/shelf_bezel_event_filter.h"
20 #include "ash/shelf/shelf_layout_manager_observer.h" 20 #include "ash/shelf/shelf_layout_manager_observer.h"
21 #include "ash/shelf/shelf_widget.h" 21 #include "ash/shelf/shelf_widget.h"
22 #include "ash/shell.h" 22 #include "ash/shell.h"
23 #include "ash/shell_window_ids.h" 23 #include "ash/shell_window_ids.h"
24 #include "ash/system/status_area_widget.h" 24 #include "ash/system/status_area_widget.h"
25 #include "ash/wm/gestures/shelf_gesture_handler.h" 25 #include "ash/wm/gestures/shelf_gesture_handler.h"
26 #include "ash/wm/lock_state_controller.h" 26 #include "ash/wm/lock_state_controller.h"
27 #include "ash/wm/mru_window_tracker.h" 27 #include "ash/wm/mru_window_tracker.h"
28 #include "ash/wm/window_animations.h" 28 #include "ash/wm/window_animations.h"
29 #include "ash/wm/window_properties.h"
30 #include "ash/wm/window_state.h" 29 #include "ash/wm/window_state.h"
31 #include "ash/wm/window_util.h" 30 #include "ash/wm/window_util.h"
32 #include "ash/wm/workspace_controller.h" 31 #include "ash/wm/workspace_controller.h"
33 #include "base/auto_reset.h" 32 #include "base/auto_reset.h"
34 #include "base/command_line.h" 33 #include "base/command_line.h"
35 #include "base/command_line.h" 34 #include "base/command_line.h"
36 #include "base/i18n/rtl.h" 35 #include "base/i18n/rtl.h"
37 #include "base/strings/string_number_conversions.h" 36 #include "base/strings/string_number_conversions.h"
38 #include "base/strings/string_util.h" 37 #include "base/strings/string_util.h"
39 #include "ui/aura/client/activation_client.h" 38 #include "ui/aura/client/activation_client.h"
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 GetAlignment() == SHELF_ALIGNMENT_TOP; 536 GetAlignment() == SHELF_ALIGNMENT_TOP;
538 } 537 }
539 538
540 bool ShelfLayoutManager::FullscreenWithMinimalChrome() const { 539 bool ShelfLayoutManager::FullscreenWithMinimalChrome() const {
541 RootWindowController* controller = GetRootWindowController(root_window_); 540 RootWindowController* controller = GetRootWindowController(root_window_);
542 if (!controller) 541 if (!controller)
543 return false; 542 return false;
544 const aura::Window* window = controller->GetTopmostFullscreenWindow(); 543 const aura::Window* window = controller->GetTopmostFullscreenWindow();
545 if (!window) 544 if (!window)
546 return false; 545 return false;
547 if (!window->GetProperty(kFullscreenUsesMinimalChromeKey)) 546 return wm::GetWindowState(window)->fullscreen_type() ==
548 return false; 547 wm::FULLSCREEN_TYPE_IMMERSIVE_MINIMAL_CHROME;
oshima 2013/10/25 15:21:32 Is this only place this fullscreen type is used in
549 return true;
550 } 548 }
551 549
552 // static 550 // static
553 ShelfLayoutManager* ShelfLayoutManager::ForLauncher(aura::Window* window) { 551 ShelfLayoutManager* ShelfLayoutManager::ForLauncher(aura::Window* window) {
554 ShelfWidget* shelf = RootWindowController::ForLauncher(window)->shelf(); 552 ShelfWidget* shelf = RootWindowController::ForLauncher(window)->shelf();
555 return shelf ? shelf->shelf_layout_manager() : NULL; 553 return shelf ? shelf->shelf_layout_manager() : NULL;
556 } 554 }
557 555
558 //////////////////////////////////////////////////////////////////////////////// 556 ////////////////////////////////////////////////////////////////////////////////
559 // ShelfLayoutManager, private: 557 // ShelfLayoutManager, private:
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after
1159 return gfx::Insets(0, distance, 0, 0); 1157 return gfx::Insets(0, distance, 0, 0);
1160 case SHELF_ALIGNMENT_TOP: 1158 case SHELF_ALIGNMENT_TOP:
1161 return gfx::Insets(0, 0, distance, 0); 1159 return gfx::Insets(0, 0, distance, 0);
1162 } 1160 }
1163 NOTREACHED(); 1161 NOTREACHED();
1164 return gfx::Insets(); 1162 return gfx::Insets();
1165 } 1163 }
1166 1164
1167 } // namespace internal 1165 } // namespace internal
1168 } // namespace ash 1166 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698