Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(432)

Side by Side Diff: chrome/browser/extensions/shell_window_registry.cc

Issue 12210107: Fix issue 174250, crash when reloading packaged app. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: comments Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 shell_windows_.erase(shell_window); 70 size_t num_erased = shell_windows_.erase(shell_window);
71 FOR_EACH_OBSERVER(Observer, observers_, OnShellWindowRemoved(shell_window)); 71 if (num_erased > 0)
72 FOR_EACH_OBSERVER(Observer, observers_, OnShellWindowRemoved(shell_window));
72 } 73 }
73 74
74 void ShellWindowRegistry::AddObserver(Observer* observer) { 75 void ShellWindowRegistry::AddObserver(Observer* observer) {
75 observers_.AddObserver(observer); 76 observers_.AddObserver(observer);
76 } 77 }
77 78
78 void ShellWindowRegistry::RemoveObserver(Observer* observer) { 79 void ShellWindowRegistry::RemoveObserver(Observer* observer) {
79 observers_.RemoveObserver(observer); 80 observers_.RemoveObserver(observer);
80 } 81 }
81 82
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 217
217 bool ShellWindowRegistry::Factory::ServiceIsCreatedWithProfile() const { 218 bool ShellWindowRegistry::Factory::ServiceIsCreatedWithProfile() const {
218 return true; 219 return true;
219 } 220 }
220 221
221 bool ShellWindowRegistry::Factory::ServiceIsNULLWhileTesting() const { 222 bool ShellWindowRegistry::Factory::ServiceIsNULLWhileTesting() const {
222 return false; 223 return false;
223 } 224 }
224 225
225 } // namespace extensions 226 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/platform_app_browsertest.cc ('k') | chrome/browser/ui/cocoa/extensions/native_app_window_cocoa.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698