| 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/browser_process.h" | 5 #include "chrome/browser/browser_process.h" |
| 6 #include "chrome/browser/extensions/shell_window_registry.h" | 6 #include "chrome/browser/extensions/shell_window_registry.h" |
| 7 #include "chrome/browser/profiles/profile_dependency_manager.h" | 7 #include "chrome/browser/profiles/profile_dependency_manager.h" |
| 8 #include "chrome/browser/profiles/profile_manager.h" | 8 #include "chrome/browser/profiles/profile_manager.h" |
| 9 #include "chrome/browser/ui/extensions/native_app_window.h" | 9 #include "chrome/browser/ui/extensions/native_app_window.h" |
| 10 #include "chrome/browser/ui/extensions/shell_window.h" | 10 #include "chrome/browser/ui/extensions/shell_window.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 FOR_EACH_OBSERVER(Observer, observers_, OnShellWindowAdded(shell_window)); | 60 FOR_EACH_OBSERVER(Observer, observers_, OnShellWindowAdded(shell_window)); |
| 61 } | 61 } |
| 62 | 62 |
| 63 void ShellWindowRegistry::ShellWindowIconChanged(ShellWindow* shell_window) { | 63 void ShellWindowRegistry::ShellWindowIconChanged(ShellWindow* shell_window) { |
| 64 shell_windows_.insert(shell_window); | 64 shell_windows_.insert(shell_window); |
| 65 FOR_EACH_OBSERVER(Observer, observers_, | 65 FOR_EACH_OBSERVER(Observer, observers_, |
| 66 OnShellWindowIconChanged(shell_window)); | 66 OnShellWindowIconChanged(shell_window)); |
| 67 } | 67 } |
| 68 | 68 |
| 69 void ShellWindowRegistry::RemoveShellWindow(ShellWindow* shell_window) { | 69 void ShellWindowRegistry::RemoveShellWindow(ShellWindow* shell_window) { |
| 70 size_t num_erased = shell_windows_.erase(shell_window); | 70 shell_windows_.erase(shell_window); |
| 71 if (num_erased > 0) | 71 FOR_EACH_OBSERVER(Observer, observers_, OnShellWindowRemoved(shell_window)); |
| 72 FOR_EACH_OBSERVER(Observer, observers_, OnShellWindowRemoved(shell_window)); | |
| 73 } | 72 } |
| 74 | 73 |
| 75 void ShellWindowRegistry::AddObserver(Observer* observer) { | 74 void ShellWindowRegistry::AddObserver(Observer* observer) { |
| 76 observers_.AddObserver(observer); | 75 observers_.AddObserver(observer); |
| 77 } | 76 } |
| 78 | 77 |
| 79 void ShellWindowRegistry::RemoveObserver(Observer* observer) { | 78 void ShellWindowRegistry::RemoveObserver(Observer* observer) { |
| 80 observers_.RemoveObserver(observer); | 79 observers_.RemoveObserver(observer); |
| 81 } | 80 } |
| 82 | 81 |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 | 216 |
| 218 bool ShellWindowRegistry::Factory::ServiceIsCreatedWithProfile() const { | 217 bool ShellWindowRegistry::Factory::ServiceIsCreatedWithProfile() const { |
| 219 return true; | 218 return true; |
| 220 } | 219 } |
| 221 | 220 |
| 222 bool ShellWindowRegistry::Factory::ServiceIsNULLWhileTesting() const { | 221 bool ShellWindowRegistry::Factory::ServiceIsNULLWhileTesting() const { |
| 223 return false; | 222 return false; |
| 224 } | 223 } |
| 225 | 224 |
| 226 } // namespace extensions | 225 } // namespace extensions |
| OLD | NEW |