OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_EXTENSIONS_SHELL_WINDOW_REGISTRY_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_SHELL_WINDOW_REGISTRY_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_SHELL_WINDOW_REGISTRY_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_SHELL_WINDOW_REGISTRY_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 // a convenience wrapper around ShellWindowRegistryFactory::GetForProfile. | 51 // a convenience wrapper around ShellWindowRegistryFactory::GetForProfile. |
52 static ShellWindowRegistry* Get(Profile* profile); | 52 static ShellWindowRegistry* Get(Profile* profile); |
53 | 53 |
54 void AddShellWindow(ShellWindow* shell_window); | 54 void AddShellWindow(ShellWindow* shell_window); |
55 void RemoveShellWindow(ShellWindow* shell_window); | 55 void RemoveShellWindow(ShellWindow* shell_window); |
56 | 56 |
57 void AddObserver(Observer* observer); | 57 void AddObserver(Observer* observer); |
58 void RemoveObserver(Observer* observer); | 58 void RemoveObserver(Observer* observer); |
59 | 59 |
60 // Returns a set of windows owned by the application identified by app_id. | 60 // Returns a set of windows owned by the application identified by app_id. |
61 ShellWindowSet GetShellWindowsForApp(const std::string app_id) const; | 61 ShellWindowSet GetShellWindowsForApp(const std::string& app_id) const; |
62 const ShellWindowSet& shell_windows() const { return shell_windows_; } | 62 const ShellWindowSet& shell_windows() const { return shell_windows_; } |
63 | 63 |
64 // Helper functions to find shell windows with particular attributes. | 64 // Helper functions to find shell windows with particular attributes. |
65 ShellWindow* GetShellWindowForRenderViewHost( | 65 ShellWindow* GetShellWindowForRenderViewHost( |
66 content::RenderViewHost* render_view_host) const; | 66 content::RenderViewHost* render_view_host) const; |
67 ShellWindow* GetShellWindowForNativeWindow(gfx::NativeWindow window) const; | 67 ShellWindow* GetShellWindowForNativeWindow(gfx::NativeWindow window) const; |
68 | 68 |
69 private: | 69 private: |
70 class Factory : public ProfileKeyedServiceFactory { | 70 class Factory : public ProfileKeyedServiceFactory { |
71 public: | 71 public: |
(...skipping 11 matching lines...) Expand all Loading... |
83 Profile* profile) const OVERRIDE; | 83 Profile* profile) const OVERRIDE; |
84 virtual bool ServiceIsCreatedWithProfile() OVERRIDE; | 84 virtual bool ServiceIsCreatedWithProfile() OVERRIDE; |
85 virtual bool ServiceIsNULLWhileTesting() OVERRIDE; | 85 virtual bool ServiceIsNULLWhileTesting() OVERRIDE; |
86 }; | 86 }; |
87 | 87 |
88 ShellWindowSet shell_windows_; | 88 ShellWindowSet shell_windows_; |
89 ObserverList<Observer> observers_; | 89 ObserverList<Observer> observers_; |
90 }; | 90 }; |
91 | 91 |
92 #endif // CHROME_BROWSER_EXTENSIONS_SHELL_WINDOW_REGISTRY_H_ | 92 #endif // CHROME_BROWSER_EXTENSIONS_SHELL_WINDOW_REGISTRY_H_ |
OLD | NEW |