| 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/native_app_window.h" | 7 #include "chrome/browser/ui/extensions/native_app_window.h" |
| 8 #include "chrome/browser/ui/extensions/shell_window.h" | 8 #include "chrome/browser/ui/extensions/shell_window.h" |
| 9 #include "chrome/common/extensions/extension.h" | 9 #include "chrome/common/extensions/extension.h" |
| 10 #include "content/public/browser/notification_types.h" | 10 #include "content/public/browser/notification_types.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 // static | 51 // static |
| 52 ShellWindowRegistry* ShellWindowRegistry::Get(Profile* profile) { | 52 ShellWindowRegistry* ShellWindowRegistry::Get(Profile* profile) { |
| 53 return Factory::GetForProfile(profile); | 53 return Factory::GetForProfile(profile); |
| 54 } | 54 } |
| 55 | 55 |
| 56 void ShellWindowRegistry::AddShellWindow(ShellWindow* shell_window) { | 56 void ShellWindowRegistry::AddShellWindow(ShellWindow* shell_window) { |
| 57 shell_windows_.insert(shell_window); | 57 shell_windows_.insert(shell_window); |
| 58 FOR_EACH_OBSERVER(Observer, observers_, OnShellWindowAdded(shell_window)); | 58 FOR_EACH_OBSERVER(Observer, observers_, OnShellWindowAdded(shell_window)); |
| 59 } | 59 } |
| 60 | 60 |
| 61 void ShellWindowRegistry::ShellWindowIconChanged(ShellWindow* shell_window) { |
| 62 shell_windows_.insert(shell_window); |
| 63 FOR_EACH_OBSERVER(Observer, observers_, |
| 64 OnShellWindowIconChanged(shell_window)); |
| 65 } |
| 66 |
| 61 void ShellWindowRegistry::RemoveShellWindow(ShellWindow* shell_window) { | 67 void ShellWindowRegistry::RemoveShellWindow(ShellWindow* shell_window) { |
| 62 shell_windows_.erase(shell_window); | 68 shell_windows_.erase(shell_window); |
| 63 FOR_EACH_OBSERVER(Observer, observers_, OnShellWindowRemoved(shell_window)); | 69 FOR_EACH_OBSERVER(Observer, observers_, OnShellWindowRemoved(shell_window)); |
| 64 } | 70 } |
| 65 | 71 |
| 66 void ShellWindowRegistry::AddObserver(Observer* observer) { | 72 void ShellWindowRegistry::AddObserver(Observer* observer) { |
| 67 observers_.AddObserver(observer); | 73 observers_.AddObserver(observer); |
| 68 } | 74 } |
| 69 | 75 |
| 70 void ShellWindowRegistry::RemoveObserver(Observer* observer) { | 76 void ShellWindowRegistry::RemoveObserver(Observer* observer) { |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 | 184 |
| 179 bool ShellWindowRegistry::Factory::ServiceIsCreatedWithProfile() const { | 185 bool ShellWindowRegistry::Factory::ServiceIsCreatedWithProfile() const { |
| 180 return true; | 186 return true; |
| 181 } | 187 } |
| 182 | 188 |
| 183 bool ShellWindowRegistry::Factory::ServiceIsNULLWhileTesting() const { | 189 bool ShellWindowRegistry::Factory::ServiceIsNULLWhileTesting() const { |
| 184 return false; | 190 return false; |
| 185 } | 191 } |
| 186 | 192 |
| 187 } // namespace extensions | 193 } // namespace extensions |
| OLD | NEW |