Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 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_UI_SETTINGS_WINDOW_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_UI_SETTINGS_WINDOW_MANAGER_H_ |
| 6 #define CHROME_BROWSER_UI_SETTINGS_WINDOW_MANAGER_H_ | 6 #define CHROME_BROWSER_UI_SETTINGS_WINDOW_MANAGER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/memory/singleton.h" | 11 #include "base/memory/singleton.h" |
| 12 #include "base/observer_list.h" | 12 #include "base/observer_list.h" |
| 13 #include "chrome/browser/sessions/session_id.h" | 13 #include "chrome/browser/sessions/session_id.h" |
| 14 | 14 |
| 15 class Browser; | 15 class Browser; |
| 16 class GURL; | 16 class GURL; |
| 17 class Profile; | 17 class Profile; |
| 18 | 18 |
| 19 namespace chrome { | 19 namespace chrome { |
| 20 | 20 |
| 21 class SettingsWindowManagerObserver; | 21 class SettingsWindowManagerObserver; |
| 22 | 22 |
| 23 bool SettingsWindowEnabled(); | |
|
stevenjb
2014/06/05 21:59:05
I wouldn't expose this here, I would just create a
sky
2014/06/05 23:48:45
And name it IsSettingsWindowEnabled.
michaelpg
2014/06/06 21:09:49
Done. (uber_ui.cc, chrome_pages.cc)
| |
| 24 | |
| 23 // Class for managing settings windows when --enable-settings-window is enabled. | 25 // Class for managing settings windows when --enable-settings-window is enabled. |
| 24 // TODO(stevenjb): Remove flag comment if enabled by default. | 26 // TODO(stevenjb): Remove flag comment if enabled by default. |
| 25 | 27 |
| 26 class SettingsWindowManager { | 28 class SettingsWindowManager { |
| 27 public: | 29 public: |
| 28 static SettingsWindowManager* GetInstance(); | 30 static SettingsWindowManager* GetInstance(); |
| 29 | 31 |
| 30 void AddObserver(SettingsWindowManagerObserver* observer); | 32 void AddObserver(SettingsWindowManagerObserver* observer); |
| 31 void RemoveObserver(SettingsWindowManagerObserver* observer); | 33 void RemoveObserver(SettingsWindowManagerObserver* observer); |
| 32 | 34 |
| 33 // Shows a chrome:// page (e.g. Settings, History) in an an existing system | 35 // Shows a chrome:// page (e.g. Settings, Help) in an an existing system |
| 34 // Browser window for |profile| or creates a new one. | 36 // Browser window for |profile| or creates a new one. |
| 35 void ShowChromePageForProfile(Profile* profile, const GURL& gurl); | 37 void ShowChromePageForProfile(Profile* profile, const GURL& gurl); |
| 36 | 38 |
| 37 // If a Browser settings window for |profile| has already been created, | 39 // If a Browser settings window for |profile| has already been created, |
| 38 // returns it, otherwise returns NULL. | 40 // returns it, otherwise returns NULL. |
| 39 Browser* FindBrowserForProfile(Profile* profile); | 41 Browser* FindBrowserForProfile(Profile* profile); |
| 40 | 42 |
| 41 private: | 43 private: |
| 42 friend struct DefaultSingletonTraits<SettingsWindowManager>; | 44 friend struct DefaultSingletonTraits<SettingsWindowManager>; |
| 43 typedef std::map<Profile*, SessionID::id_type> ProfileSessionMap; | 45 typedef std::map<Profile*, SessionID::id_type> ProfileSessionMap; |
| 44 | 46 |
| 45 SettingsWindowManager(); | 47 SettingsWindowManager(); |
| 46 ~SettingsWindowManager(); | 48 ~SettingsWindowManager(); |
| 47 | 49 |
| 48 ObserverList<SettingsWindowManagerObserver> observers_; | 50 ObserverList<SettingsWindowManagerObserver> observers_; |
| 49 ProfileSessionMap settings_session_map_; | 51 ProfileSessionMap settings_session_map_; |
| 50 | 52 |
| 51 DISALLOW_COPY_AND_ASSIGN(SettingsWindowManager); | 53 DISALLOW_COPY_AND_ASSIGN(SettingsWindowManager); |
| 52 }; | 54 }; |
| 53 | 55 |
| 54 } // namespace chrome | 56 } // namespace chrome |
| 55 | 57 |
| 56 #endif // CHROME_BROWSER_UI_SETTINGS_WINDOW_MANAGER_H_ | 58 #endif // CHROME_BROWSER_UI_SETTINGS_WINDOW_MANAGER_H_ |
| OLD | NEW |