| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/ash/launcher/chrome_launcher_controller.h" | 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 2125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2136 Profile::FromBrowserContext(web_contents->GetBrowserContext()); | 2136 Profile::FromBrowserContext(web_contents->GetBrowserContext()); |
| 2137 return profile->IsOffTheRecord() && !profile->IsGuestSession() && | 2137 return profile->IsOffTheRecord() && !profile->IsGuestSession() && |
| 2138 !profile->IsSystemProfile(); | 2138 !profile->IsSystemProfile(); |
| 2139 } | 2139 } |
| 2140 | 2140 |
| 2141 void ChromeLauncherController::CloseWindowedAppsFromRemovedExtension( | 2141 void ChromeLauncherController::CloseWindowedAppsFromRemovedExtension( |
| 2142 const std::string& app_id, | 2142 const std::string& app_id, |
| 2143 const Profile* profile) { | 2143 const Profile* profile) { |
| 2144 // This function cannot rely on the controller's enumeration functionality | 2144 // This function cannot rely on the controller's enumeration functionality |
| 2145 // since the extension has already be unloaded. | 2145 // since the extension has already be unloaded. |
| 2146 const BrowserList* ash_browser_list = | 2146 const BrowserList* browser_list = BrowserList::GetInstance(); |
| 2147 BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_ASH); | |
| 2148 std::vector<Browser*> browser_to_close; | 2147 std::vector<Browser*> browser_to_close; |
| 2149 for (BrowserList::const_reverse_iterator | 2148 for (BrowserList::const_reverse_iterator it = |
| 2150 it = ash_browser_list->begin_last_active(); | 2149 browser_list->begin_last_active(); |
| 2151 it != ash_browser_list->end_last_active(); ++it) { | 2150 it != browser_list->end_last_active(); ++it) { |
| 2152 Browser* browser = *it; | 2151 Browser* browser = *it; |
| 2153 if (!browser->is_type_tabbed() && browser->is_type_popup() && | 2152 if (!browser->is_type_tabbed() && browser->is_type_popup() && |
| 2154 browser->is_app() && | 2153 browser->is_app() && |
| 2155 app_id == | 2154 app_id == |
| 2156 web_app::GetExtensionIdFromApplicationName(browser->app_name()) && | 2155 web_app::GetExtensionIdFromApplicationName(browser->app_name()) && |
| 2157 profile == browser->profile()) { | 2156 profile == browser->profile()) { |
| 2158 browser_to_close.push_back(browser); | 2157 browser_to_close.push_back(browser); |
| 2159 } | 2158 } |
| 2160 } | 2159 } |
| 2161 while (!browser_to_close.empty()) { | 2160 while (!browser_to_close.empty()) { |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2226 void ChromeLauncherController::ReleaseProfile() { | 2225 void ChromeLauncherController::ReleaseProfile() { |
| 2227 if (app_sync_ui_state_) | 2226 if (app_sync_ui_state_) |
| 2228 app_sync_ui_state_->RemoveObserver(this); | 2227 app_sync_ui_state_->RemoveObserver(this); |
| 2229 | 2228 |
| 2230 extensions::ExtensionRegistry::Get(profile_)->RemoveObserver(this); | 2229 extensions::ExtensionRegistry::Get(profile_)->RemoveObserver(this); |
| 2231 | 2230 |
| 2232 PrefServiceSyncableFromProfile(profile_)->RemoveObserver(this); | 2231 PrefServiceSyncableFromProfile(profile_)->RemoveObserver(this); |
| 2233 | 2232 |
| 2234 pref_change_registrar_.RemoveAll(); | 2233 pref_change_registrar_.RemoveAll(); |
| 2235 } | 2234 } |
| OLD | NEW |