NaCl docs: add sanitizers to GSoC ideas
[chromium-blink-merge.git] / chrome / browser / ui / settings_window_manager.h
blob5c5ec7b0f32f0d8bdf2399c4bdc3adaa463fed94
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_SETTINGS_WINDOW_MANAGER_H_
6 #define CHROME_BROWSER_UI_SETTINGS_WINDOW_MANAGER_H_
8 #include <map>
9 #include <string>
11 #include "base/memory/singleton.h"
12 #include "base/observer_list.h"
13 #include "components/sessions/session_id.h"
15 class Browser;
16 class GURL;
17 class Profile;
19 namespace chrome {
21 class SettingsWindowManagerObserver;
23 // Class for managing settings windows when --enable-settings-window is enabled.
24 // TODO(stevenjb): Remove flag comment if enabled by default.
26 class SettingsWindowManager {
27 public:
28 static SettingsWindowManager* GetInstance();
30 void AddObserver(SettingsWindowManagerObserver* observer);
31 void RemoveObserver(SettingsWindowManagerObserver* observer);
33 // Shows a chrome:// page (e.g. Settings, About) in an an existing system
34 // Browser window for |profile| or creates a new one.
35 void ShowChromePageForProfile(Profile* profile, const GURL& gurl);
37 // If a Browser settings window for |profile| has already been created,
38 // returns it, otherwise returns NULL.
39 Browser* FindBrowserForProfile(Profile* profile);
41 // Returns true if |browser| is a settings window.
42 bool IsSettingsBrowser(Browser* browser) const;
44 private:
45 friend struct DefaultSingletonTraits<SettingsWindowManager>;
46 typedef std::map<Profile*, SessionID::id_type> ProfileSessionMap;
48 SettingsWindowManager();
49 ~SettingsWindowManager();
51 ObserverList<SettingsWindowManagerObserver> observers_;
52 ProfileSessionMap settings_session_map_;
54 DISALLOW_COPY_AND_ASSIGN(SettingsWindowManager);
57 } // namespace chrome
59 #endif // CHROME_BROWSER_UI_SETTINGS_WINDOW_MANAGER_H_