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 #include "chrome/browser/extensions/shell_window_registry.h" | 5 #include "chrome/browser/extensions/shell_window_registry.h" |
6 #include "chrome/browser/profiles/profile_dependency_manager.h" | 6 #include "chrome/browser/profiles/profile_dependency_manager.h" |
7 #include "chrome/browser/ui/extensions/shell_window.h" | 7 #include "chrome/browser/ui/extensions/shell_window.h" |
8 #include "chrome/common/extensions/extension.h" | 8 #include "chrome/common/extensions/extension.h" |
9 #include "content/public/browser/render_view_host.h" | 9 #include "content/public/browser/render_view_host.h" |
10 #include "content/public/browser/web_contents.h" | 10 #include "content/public/browser/web_contents.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 void ShellWindowRegistry::AddObserver(Observer* observer) { | 31 void ShellWindowRegistry::AddObserver(Observer* observer) { |
32 observers_.AddObserver(observer); | 32 observers_.AddObserver(observer); |
33 } | 33 } |
34 | 34 |
35 void ShellWindowRegistry::RemoveObserver(Observer* observer) { | 35 void ShellWindowRegistry::RemoveObserver(Observer* observer) { |
36 observers_.RemoveObserver(observer); | 36 observers_.RemoveObserver(observer); |
37 } | 37 } |
38 | 38 |
39 ShellWindowRegistry::ShellWindowSet ShellWindowRegistry::GetShellWindowsForApp( | 39 ShellWindowRegistry::ShellWindowSet ShellWindowRegistry::GetShellWindowsForApp( |
40 const std::string app_id) const { | 40 const std::string& app_id) const { |
41 ShellWindowSet app_windows; | 41 ShellWindowSet app_windows; |
42 for (ShellWindowSet::const_iterator i = shell_windows_.begin(); | 42 for (ShellWindowSet::const_iterator i = shell_windows_.begin(); |
43 i != shell_windows_.end(); ++i) { | 43 i != shell_windows_.end(); ++i) { |
44 if ((*i)->extension()->id() == app_id) | 44 if ((*i)->extension()->id() == app_id) |
45 app_windows.insert(*i); | 45 app_windows.insert(*i); |
46 } | 46 } |
47 return app_windows; | 47 return app_windows; |
48 } | 48 } |
49 | 49 |
50 ShellWindow* ShellWindowRegistry::GetShellWindowForRenderViewHost( | 50 ShellWindow* ShellWindowRegistry::GetShellWindowForRenderViewHost( |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 return new ShellWindowRegistry(); | 96 return new ShellWindowRegistry(); |
97 } | 97 } |
98 | 98 |
99 bool ShellWindowRegistry::Factory::ServiceIsCreatedWithProfile() { | 99 bool ShellWindowRegistry::Factory::ServiceIsCreatedWithProfile() { |
100 return true; | 100 return true; |
101 } | 101 } |
102 | 102 |
103 bool ShellWindowRegistry::Factory::ServiceIsNULLWhileTesting() { | 103 bool ShellWindowRegistry::Factory::ServiceIsNULLWhileTesting() { |
104 return false; | 104 return false; |
105 } | 105 } |
OLD | NEW |