Chromium Code Reviews| 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/background/background_contents_service.h" | 5 #include "chrome/browser/background/background_contents_service.h" |
| 6 | 6 |
| 7 #include "apps/app_load_service.h" | 7 #include "apps/app_load_service.h" |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 122 if (!service->GetAppBackgroundContents( | 122 if (!service->GetAppBackgroundContents( |
| 123 base::ASCIIToUTF16(copied_extension_id))) { | 123 base::ASCIIToUTF16(copied_extension_id))) { |
| 124 service->LoadBackgroundContentsForExtension(profile_, | 124 service->LoadBackgroundContentsForExtension(profile_, |
| 125 copied_extension_id); | 125 copied_extension_id); |
| 126 } | 126 } |
| 127 } else if (is_platform_app_) { | 127 } else if (is_platform_app_) { |
| 128 apps::AppLoadService::Get(profile_)-> | 128 apps::AppLoadService::Get(profile_)-> |
| 129 RestartApplication(copied_extension_id); | 129 RestartApplication(copied_extension_id); |
| 130 } else { | 130 } else { |
| 131 extensions::ExtensionSystem::Get(profile_)->extension_service()-> | 131 extensions::ExtensionSystem::Get(profile_)->extension_service()-> |
| 132 ReloadExtension(copied_extension_id); | 132 ReloadExtension(copied_extension_id, true); |
|
Devlin
2014/07/02 17:46:50
all of these should have anonymous bool comments..
gpdavis
2014/07/02 19:13:54
Not a problem! This is why I suggested overloadin
Devlin
2014/07/02 19:16:57
Our usual tactic for this is something like:
Exten
| |
| 133 } | 133 } |
| 134 | 134 |
| 135 // Closing the crash notification balloon for the app/extension here should | 135 // Closing the crash notification balloon for the app/extension here should |
| 136 // be OK, but it causes a crash on Mac, see: http://crbug.com/78167 | 136 // be OK, but it causes a crash on Mac, see: http://crbug.com/78167 |
| 137 ScheduleCloseBalloon(copied_extension_id); | 137 ScheduleCloseBalloon(copied_extension_id); |
| 138 } | 138 } |
| 139 | 139 |
| 140 virtual bool HasClickedListener() OVERRIDE { return true; } | 140 virtual bool HasClickedListener() OVERRIDE { return true; } |
| 141 | 141 |
| 142 virtual std::string id() const OVERRIDE { | 142 virtual std::string id() const OVERRIDE { |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 230 !extension_registry) { | 230 !extension_registry) { |
| 231 return; | 231 return; |
| 232 } | 232 } |
| 233 | 233 |
| 234 if (!extension_registry->GetExtensionById( | 234 if (!extension_registry->GetExtensionById( |
| 235 extension_id, extensions::ExtensionRegistry::TERMINATED)) { | 235 extension_id, extensions::ExtensionRegistry::TERMINATED)) { |
| 236 // Either the app/extension was uninstalled by policy or it has since | 236 // Either the app/extension was uninstalled by policy or it has since |
| 237 // been restarted successfully by someone else (the user). | 237 // been restarted successfully by someone else (the user). |
| 238 return; | 238 return; |
| 239 } | 239 } |
| 240 extension_system->extension_service()->ReloadExtension(extension_id); | 240 extension_system->extension_service()->ReloadExtension(extension_id, true); |
| 241 } | 241 } |
| 242 | 242 |
| 243 } // namespace | 243 } // namespace |
| 244 | 244 |
| 245 // Keys for the information we store about individual BackgroundContents in | 245 // Keys for the information we store about individual BackgroundContents in |
| 246 // prefs. There is one top-level DictionaryValue (stored at | 246 // prefs. There is one top-level DictionaryValue (stored at |
| 247 // prefs::kRegisteredBackgroundContents). Information about each | 247 // prefs::kRegisteredBackgroundContents). Information about each |
| 248 // BackgroundContents is stored under that top-level DictionaryValue, keyed | 248 // BackgroundContents is stored under that top-level DictionaryValue, keyed |
| 249 // by the parent application ID for easy lookup. | 249 // by the parent application ID for easy lookup. |
| 250 // | 250 // |
| (...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 786 bool user_gesture, | 786 bool user_gesture, |
| 787 bool* was_blocked) { | 787 bool* was_blocked) { |
| 788 Browser* browser = chrome::FindLastActiveWithProfile( | 788 Browser* browser = chrome::FindLastActiveWithProfile( |
| 789 Profile::FromBrowserContext(new_contents->GetBrowserContext()), | 789 Profile::FromBrowserContext(new_contents->GetBrowserContext()), |
| 790 chrome::GetActiveDesktop()); | 790 chrome::GetActiveDesktop()); |
| 791 if (browser) { | 791 if (browser) { |
| 792 chrome::AddWebContents(browser, NULL, new_contents, disposition, | 792 chrome::AddWebContents(browser, NULL, new_contents, disposition, |
| 793 initial_pos, user_gesture, was_blocked); | 793 initial_pos, user_gesture, was_blocked); |
| 794 } | 794 } |
| 795 } | 795 } |
| OLD | NEW |