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

Unified Diff: chrome/browser/extensions/api/wm/wm_utils.h

Issue 10803037: [WIP] ash/extensions: Add experimental extension support for window-management in ash. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge-152100 Created 8 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 | « chrome/browser/extensions/api/wm/wm_api.cc ('k') | chrome/browser/extensions/api/wm/wm_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/wm/wm_utils.h
diff --git a/chrome/browser/extensions/api/wm/wm_utils.h b/chrome/browser/extensions/api/wm/wm_utils.h
new file mode 100644
index 0000000000000000000000000000000000000000..cdad83033c24bbe614968183a67f122dabdc457b
--- /dev/null
+++ b/chrome/browser/extensions/api/wm/wm_utils.h
@@ -0,0 +1,70 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_EXTENSIONS_API_WM_WM_UTILS_H_
+#define CHROME_BROWSER_EXTENSIONS_API_WM_WM_UTILS_H_
+
+#include <list>
+#include <map>
+#include <vector>
+
+#include "base/memory/singleton.h"
+
+namespace aura {
+class Window;
+}
+
+namespace extensions {
+namespace api {
+
+namespace experimental_wm {
+class AshWindow;
+}
+
+namespace wm {
+
+class WindowIdTracker {
+ private:
+ WindowIdTracker();
+ ~WindowIdTracker();
+
+ public:
+ static WindowIdTracker* GetInstance();
+
+ int WindowExtensionId(const aura::Window* window);
+
+ const aura::Window* ExtensionIdWindow(int extension_id);
+
+ int TrackWindow(const aura::Window* window);
+
+ void UntrackWindow(const aura::Window* window);
+
+ void ActivateWindow(const aura::Window* window);
+
+ std::vector<const aura::Window*> AllWindows(bool activation);
+
+ private:
+ // Requirement for Signleton
+ friend struct DefaultSingletonTraits<WindowIdTracker>;
+
+ std::list<const aura::Window*> activation_order_;
+ std::list<const aura::Window*> creation_order_;
+ std::map<int, const aura::Window*> reverse_lookup_;
+ std::map<const aura::Window*, int> lookup_;
+ int next_window_id_;
+
+ DISALLOW_COPY_AND_ASSIGN(WindowIdTracker);
+};
+
+namespace utils {
+
+void AuraWindowToExtensionWindow(const aura::Window* window,
+ experimental_wm::AshWindow* extension_window);
+
+} // namespace utils
+} // namespace wm
+} // namespace api
+} // namespace extensions
+
+#endif // CHROME_BROWSER_EXTENSIONS_API_WM_WM_UTILS_H_
« no previous file with comments | « chrome/browser/extensions/api/wm/wm_api.cc ('k') | chrome/browser/extensions/api/wm/wm_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698