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

Unified Diff: ash/common/wm_shell.h

Issue 2194353002: mash: Migrate ScopedTargetRootWindow to //ash/common (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: non-virtual Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/common/scoped_root_window_for_new_windows.cc ('k') | ash/common/wm_shell.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/wm_shell.h
diff --git a/ash/common/wm_shell.h b/ash/common/wm_shell.h
index 79968ecf6f5c37f1942d14d18ca44d4879a8d057..4ecfacceec864d1db7bffecfce46a8ebf03334dd 100644
--- a/ash/common/wm_shell.h
+++ b/ash/common/wm_shell.h
@@ -111,6 +111,11 @@ class ASH_EXPORT WmShell {
return new_window_delegate_.get();
}
+ // NOTE: Prefer ScopedRootWindowForNewWindows when setting temporarily.
+ void set_root_window_for_new_windows(WmWindow* root) {
+ root_window_for_new_windows_ = root;
+ }
+
ShelfDelegate* shelf_delegate() { return shelf_delegate_.get(); }
ShelfModel* shelf_model() { return shelf_model_.get(); }
@@ -146,9 +151,10 @@ class ASH_EXPORT WmShell {
virtual WmWindow* GetRootWindowForDisplayId(int64_t display_id) = 0;
// Returns the root window that newly created windows should be added to.
+ // Value can be temporarily overridden using ScopedRootWindowForNewWindows.
// NOTE: this returns the root, newly created window should be added to the
// appropriate container in the returned window.
- virtual WmWindow* GetRootWindowForNewWindows() = 0;
+ WmWindow* GetRootWindowForNewWindows();
// Retuns the display info associated with |display_id|.
// TODO(msw): Remove this when DisplayManager has been moved. crbug.com/622480
@@ -321,6 +327,7 @@ class ASH_EXPORT WmShell {
private:
friend class AcceleratorControllerTest;
+ friend class ScopedRootWindowForNewWindows;
friend class Shell;
static WmShell* instance_;
@@ -349,6 +356,10 @@ class ASH_EXPORT WmShell {
base::ObserverList<LockStateObserver> lock_state_observers_;
+ // See comment for GetRootWindowForNewWindows().
+ WmWindow* root_window_for_new_windows_ = nullptr;
+ WmWindow* scoped_root_window_for_new_windows_ = nullptr;
+
bool simulate_modal_window_open_for_testing_ = false;
#if defined(OS_CHROMEOS)
« no previous file with comments | « ash/common/scoped_root_window_for_new_windows.cc ('k') | ash/common/wm_shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698