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

Unified Diff: ash/shell/window_watcher.cc

Issue 11017079: Remove Shell::shelf()|status_area_widget()|launcher() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
Index: ash/shell/window_watcher.cc
diff --git a/ash/shell/window_watcher.cc b/ash/shell/window_watcher.cc
index d37e8c85b7250a9b07164216582528237c0ceff9..0f2b6847084b744c53148a2734c284c1ce241a93 100644
--- a/ash/shell/window_watcher.cc
+++ b/ash/shell/window_watcher.cc
@@ -9,6 +9,7 @@
#include "ash/shell.h"
#include "ash/shell_window_ids.h"
#include "ash/wm/workspace_controller.h"
+#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
namespace ash {
@@ -44,9 +45,9 @@ class WindowWatcher::WorkspaceWindowWatcher : public aura::WindowObserver {
};
WindowWatcher::WindowWatcher()
- : window_(ash::Shell::GetInstance()->launcher()->window_container()),
+ : window_(Launcher::ForPrimaryDisplay()->window_container()),
panel_container_(ash::Shell::GetContainer(
- Shell::GetPrimaryRootWindow(),
+ window_->GetRootWindow(),
internal::kShellWindowId_PanelContainer)) {
if (internal::WorkspaceController::IsWorkspace2Enabled())
workspace_window_watcher_.reset(new WorkspaceWindowWatcher(this));
@@ -82,7 +83,7 @@ void WindowWatcher::OnWindowAdded(aura::Window* new_window) {
return;
static int image_count = 0;
- ash::LauncherModel* model = ash::Shell::GetInstance()->launcher()->model();
+ ash::LauncherModel* model = Launcher::ForPrimaryDisplay()->model();
ash::LauncherItem item;
item.type = ash::TYPE_TABBED;
id_to_window_[model->next_id()] = new_window;
@@ -105,8 +106,7 @@ void WindowWatcher::OnWillRemoveWindow(aura::Window* window) {
for (IDToWindow::iterator i = id_to_window_.begin();
i != id_to_window_.end(); ++i) {
if (i->second == window) {
- ash::LauncherModel* model =
- ash::Shell::GetInstance()->launcher()->model();
+ ash::LauncherModel* model = Launcher::ForPrimaryDisplay()->model();
int index = model->ItemIndexByID(i->first);
DCHECK_NE(-1, index);
model->RemoveItemAt(index);

Powered by Google App Engine
This is Rietveld 408576698