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 #include "chrome/browser/ui/settings_window_manager.h" | 5 #include "chrome/browser/ui/settings_window_manager.h" |
6 | 6 |
7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
8 #include "chrome/browser/ui/browser_finder.h" | 8 #include "chrome/browser/ui/browser_finder.h" |
9 #include "chrome/browser/ui/browser_finder.h" | 9 #include "chrome/browser/ui/browser_finder.h" |
10 #include "chrome/browser/ui/browser_navigator.h" | 10 #include "chrome/browser/ui/browser_navigator.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 observers_, OnNewSettingsWindow(params.browser)); | 67 observers_, OnNewSettingsWindow(params.browser)); |
68 } | 68 } |
69 | 69 |
70 Browser* SettingsWindowManager::FindBrowserForProfile(Profile* profile) { | 70 Browser* SettingsWindowManager::FindBrowserForProfile(Profile* profile) { |
71 ProfileSessionMap::iterator iter = settings_session_map_.find(profile); | 71 ProfileSessionMap::iterator iter = settings_session_map_.find(profile); |
72 if (iter != settings_session_map_.end()) | 72 if (iter != settings_session_map_.end()) |
73 return chrome::FindBrowserWithID(iter->second); | 73 return chrome::FindBrowserWithID(iter->second); |
74 return NULL; | 74 return NULL; |
75 } | 75 } |
76 | 76 |
| 77 bool SettingsWindowManager::IsSettingsBrowser(Browser* browser) const { |
| 78 ProfileSessionMap::const_iterator iter = |
| 79 settings_session_map_.find(browser->profile()); |
| 80 return (iter != settings_session_map_.end() && |
| 81 iter->second == browser->session_id().id()); |
| 82 } |
| 83 |
77 SettingsWindowManager::SettingsWindowManager() { | 84 SettingsWindowManager::SettingsWindowManager() { |
78 } | 85 } |
79 | 86 |
80 SettingsWindowManager::~SettingsWindowManager() { | 87 SettingsWindowManager::~SettingsWindowManager() { |
81 } | 88 } |
82 | 89 |
83 } // namespace chrome | 90 } // namespace chrome |
OLD | NEW |