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

Unified Diff: ash/shell/shell_main.cc

Issue 9703026: Makes the maximize/restore button handling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Incorporate review feedback Created 8 years, 9 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/shell.cc ('k') | ash/shell/window_type_launcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shell/shell_main.cc
diff --git a/ash/shell/shell_main.cc b/ash/shell/shell_main.cc
index b56cfe0f1b2949972fc4c1b429cb077773509beb..3ba1285344ad8be577a1099bd61c20697c8ec18c 100644
--- a/ash/shell/shell_main.cc
+++ b/ash/shell/shell_main.cc
@@ -23,6 +23,7 @@
#include "base/message_loop.h"
#include "grit/ui_resources.h"
#include "ui/aura/env.h"
+#include "ui/aura/client/window_types.h"
#include "ui/aura/root_window.h"
#include "ui/aura/window_observer.h"
#include "ui/base/resource/resource_bundle.h"
@@ -72,8 +73,20 @@ class WindowWatcher : public aura::WindowObserver {
return i != id_to_window_.end() ? i->second : NULL;
}
+ ash::LauncherID GetIDByWindow(aura::Window* window) const {
+ for (IDToWindow::const_iterator i = id_to_window_.begin();
+ i != id_to_window_.end(); ++i) {
+ if (i->second == window)
+ return i->first;
+ }
+ return 0; // TODO: add a constant for this.
+ }
+
// aura::WindowObserver overrides:
virtual void OnWindowAdded(aura::Window* new_window) OVERRIDE {
+ if (new_window->type() != aura::client::WINDOW_TYPE_NORMAL)
+ return;
+
static int image_count = 0;
ash::LauncherModel* model = ash::Shell::GetInstance()->launcher()->model();
ash::LauncherItem item;
@@ -152,6 +165,10 @@ class LauncherDelegateImpl : public ash::LauncherDelegate {
return NULL;
}
+ virtual ash::LauncherID GetIDByWindow(aura::Window* window) OVERRIDE {
+ return watcher_->GetIDByWindow(window);
+ }
+
private:
// Used to update Launcher. Owned by main.
WindowWatcher* watcher_;
« no previous file with comments | « ash/shell.cc ('k') | ash/shell/window_type_launcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698