| 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_
|
|
|