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

Side by Side Diff: ash/shell.h

Issue 37733003: Make GetRootWindow() return a Window instead of a RootWindow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: First cut for review/trybots 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 #ifndef ASH_SHELL_H_ 5 #ifndef ASH_SHELL_H_
6 #define ASH_SHELL_H_ 6 #define ASH_SHELL_H_
7 7
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 static void DeleteInstance(); 183 static void DeleteInstance();
184 184
185 // Returns the root window controller for the primary root window. 185 // Returns the root window controller for the primary root window.
186 // TODO(oshima): move this to |RootWindowController| 186 // TODO(oshima): move this to |RootWindowController|
187 static internal::RootWindowController* GetPrimaryRootWindowController(); 187 static internal::RootWindowController* GetPrimaryRootWindowController();
188 188
189 // Returns all root window controllers. 189 // Returns all root window controllers.
190 // TODO(oshima): move this to |RootWindowController| 190 // TODO(oshima): move this to |RootWindowController|
191 static RootWindowControllerList GetAllRootWindowControllers(); 191 static RootWindowControllerList GetAllRootWindowControllers();
192 192
193 // Returns the primary RootWindow. The primary RootWindow is the one 193 // Returns the primary root Window. The primary root Window is the one that
194 // that has a launcher. 194 // has a launcher.
195 static aura::RootWindow* GetPrimaryRootWindow(); 195 static aura::Window* GetPrimaryRootWindow();
196 196
197 // Returns a RootWindow when used as a target when creating a new window. 197 // Returns a root Window when used as a target when creating a new window.
198 // The root window of the active window is used in most cases, but can 198 // The root window of the active window is used in most cases, but can
199 // be overridden by using ScopedTargetRootWindow(). 199 // be overridden by using ScopedTargetRootWindow().
200 // If you want to get a RootWindow of the active window, just use 200 // If you want to get the root Window of the active window, just use
201 // |wm::GetActiveWindow()->GetRootWindow()|. 201 // |wm::GetActiveWindow()->GetRootWindow()|.
202 static aura::RootWindow* GetTargetRootWindow(); 202 static aura::Window* GetTargetRootWindow();
203 203
204 // Returns the global Screen object that's always active in ash. 204 // Returns the global Screen object that's always active in ash.
205 static gfx::Screen* GetScreen(); 205 static gfx::Screen* GetScreen();
206 206
207 // Returns all root windows. 207 // Returns all root windows.
208 static RootWindowList GetAllRootWindows(); 208 static RootWindowList GetAllRootWindows();
209 209
210 static aura::Window* GetContainer(aura::RootWindow* root_window, 210 static aura::Window* GetContainer(aura::Window* root_window,
211 int container_id); 211 int container_id);
212 static const aura::Window* GetContainer(const aura::RootWindow* root_window, 212 static const aura::Window* GetContainer(const aura::Window* root_window,
213 int container_id); 213 int container_id);
214 214
215 // Returns the list of containers that match |container_id| in 215 // Returns the list of containers that match |container_id| in
216 // all root windows. If |priority_root| is given, the container 216 // all root windows. If |priority_root| is given, the container
217 // in the |priority_root| will be inserted at the top of the list. 217 // in the |priority_root| will be inserted at the top of the list.
218 static std::vector<aura::Window*> GetContainersFromAllRootWindows( 218 static std::vector<aura::Window*> GetContainersFromAllRootWindows(
219 int container_id, 219 int container_id,
220 aura::RootWindow* priority_root); 220 aura::Window* priority_root);
221 221
222 void set_target_root_window(aura::RootWindow* target_root_window) { 222 void set_target_root_window(aura::Window* target_root_window) {
223 target_root_window_ = target_root_window; 223 target_root_window_ = target_root_window;
224 } 224 }
225 225
226 // Shows the context menu for the background and launcher at 226 // Shows the context menu for the background and launcher at
227 // |location_in_screen| (in screen coordinates). 227 // |location_in_screen| (in screen coordinates).
228 void ShowContextMenu(const gfx::Point& location_in_screen, 228 void ShowContextMenu(const gfx::Point& location_in_screen,
229 ui::MenuSourceType source_type); 229 ui::MenuSourceType source_type);
230 230
231 // Toggles the app list. |window| specifies in which display the app 231 // Toggles the app list. |window| specifies in which display the app
232 // list should be shown. If this is NULL, the active root window 232 // list should be shown. If this is NULL, the active root window
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 ScreenAsh* screen() { return screen_; } 398 ScreenAsh* screen() { return screen_; }
399 399
400 // Force the shelf to query for it's current visibility state. 400 // Force the shelf to query for it's current visibility state.
401 void UpdateShelfVisibility(); 401 void UpdateShelfVisibility();
402 402
403 // TODO(oshima): Define an interface to access shelf/launcher 403 // TODO(oshima): Define an interface to access shelf/launcher
404 // state, or just use Launcher. 404 // state, or just use Launcher.
405 405
406 // Sets/gets the shelf auto-hide behavior on |root_window|. 406 // Sets/gets the shelf auto-hide behavior on |root_window|.
407 void SetShelfAutoHideBehavior(ShelfAutoHideBehavior behavior, 407 void SetShelfAutoHideBehavior(ShelfAutoHideBehavior behavior,
408 aura::RootWindow* root_window); 408 aura::Window* root_window);
409 ShelfAutoHideBehavior GetShelfAutoHideBehavior( 409 ShelfAutoHideBehavior GetShelfAutoHideBehavior(
410 aura::RootWindow* root_window) const; 410 aura::Window* root_window) const;
411 411
412 // Sets/gets shelf's alignment on |root_window|. 412 // Sets/gets shelf's alignment on |root_window|.
413 void SetShelfAlignment(ShelfAlignment alignment, 413 void SetShelfAlignment(ShelfAlignment alignment,
414 aura::RootWindow* root_window); 414 aura::Window* root_window);
415 ShelfAlignment GetShelfAlignment(aura::RootWindow* root_window); 415 ShelfAlignment GetShelfAlignment(aura::Window* root_window);
416 416
417 // Dims or undims the screen. 417 // Dims or undims the screen.
418 void SetDimming(bool should_dim); 418 void SetDimming(bool should_dim);
419 419
420 // Notifies |observers_| when entering or exiting fullscreen mode in 420 // Notifies |observers_| when entering or exiting fullscreen mode in
421 // |root_window|. 421 // |root_window|.
422 void NotifyFullscreenStateChange(bool is_fullscreen, 422 void NotifyFullscreenStateChange(bool is_fullscreen,
423 aura::RootWindow* root_window); 423 aura::Window* root_window);
424 424
425 // Creates a modal background (a partially-opaque fullscreen window) 425 // Creates a modal background (a partially-opaque fullscreen window)
426 // on all displays for |window|. 426 // on all displays for |window|.
427 void CreateModalBackground(aura::Window* window); 427 void CreateModalBackground(aura::Window* window);
428 428
429 // Called when a modal window is removed. It will activate 429 // Called when a modal window is removed. It will activate
430 // another modal window if any, or remove modal screens 430 // another modal window if any, or remove modal screens
431 // on all displays. 431 // on all displays.
432 void OnModalWindowRemoved(aura::Window* removed); 432 void OnModalWindowRemoved(aura::Window* removed);
433 433
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 // If set before the Shell is initialized, the mouse cursor will be hidden 554 // If set before the Shell is initialized, the mouse cursor will be hidden
555 // when the screen is initially created. 555 // when the screen is initially created.
556 static bool initially_hide_cursor_; 556 static bool initially_hide_cursor_;
557 557
558 ScreenAsh* screen_; 558 ScreenAsh* screen_;
559 559
560 // When no explicit target display/RootWindow is given, new windows are 560 // When no explicit target display/RootWindow is given, new windows are
561 // created on |scoped_target_root_window_| , unless NULL in 561 // created on |scoped_target_root_window_| , unless NULL in
562 // which case they are created on |target_root_window_|. 562 // which case they are created on |target_root_window_|.
563 // |target_root_window_| never becomes NULL during the session. 563 // |target_root_window_| never becomes NULL during the session.
564 aura::RootWindow* target_root_window_; 564 aura::Window* target_root_window_;
565 aura::RootWindow* scoped_target_root_window_; 565 aura::Window* scoped_target_root_window_;
566 566
567 // The CompoundEventFilter owned by aura::Env object. 567 // The CompoundEventFilter owned by aura::Env object.
568 scoped_ptr<views::corewm::CompoundEventFilter> env_filter_; 568 scoped_ptr<views::corewm::CompoundEventFilter> env_filter_;
569 569
570 std::vector<WindowAndBoundsPair> to_restore_; 570 std::vector<WindowAndBoundsPair> to_restore_;
571 571
572 scoped_ptr<keyboard::KeyboardController> keyboard_controller_; 572 scoped_ptr<keyboard::KeyboardController> keyboard_controller_;
573 scoped_ptr<NestedDispatcherController> nested_dispatcher_controller_; 573 scoped_ptr<NestedDispatcherController> nested_dispatcher_controller_;
574 scoped_ptr<AcceleratorController> accelerator_controller_; 574 scoped_ptr<AcceleratorController> accelerator_controller_;
575 scoped_ptr<ShellDelegate> delegate_; 575 scoped_ptr<ShellDelegate> delegate_;
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 bool simulate_modal_window_open_for_testing_; 676 bool simulate_modal_window_open_for_testing_;
677 677
678 bool is_touch_hud_projection_enabled_; 678 bool is_touch_hud_projection_enabled_;
679 679
680 DISALLOW_COPY_AND_ASSIGN(Shell); 680 DISALLOW_COPY_AND_ASSIGN(Shell);
681 }; 681 };
682 682
683 } // namespace ash 683 } // namespace ash
684 684
685 #endif // ASH_SHELL_H_ 685 #endif // ASH_SHELL_H_
OLDNEW
« no previous file with comments | « ash/shelf/shelf_widget_unittest.cc ('k') | ash/shell.cc » ('j') | ui/aura/root_window.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698