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

Side by Side Diff: chrome/browser/apps/ephemeral_app_launcher.cc

Issue 257153003: We have a problem in the process on destroying WebContentsImpl because (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: Rebased onto origin/master again, resolved conflicts Created 6 years, 7 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 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/apps/ephemeral_app_launcher.h" 5 #include "chrome/browser/apps/ephemeral_app_launcher.h"
6 6
7 #include "chrome/browser/extensions/extension_install_prompt.h" 7 #include "chrome/browser/extensions/extension_install_prompt.h"
8 #include "chrome/browser/extensions/extension_service.h" 8 #include "chrome/browser/extensions/extension_service.h"
9 #include "chrome/browser/extensions/extension_util.h" 9 #include "chrome/browser/extensions/extension_util.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 245
246 // If the installation succeeds, we reach this point as a result of 246 // If the installation succeeds, we reach this point as a result of
247 // chrome::NOTIFICATION_EXTENSION_INSTALLED, but this is broadcasted before 247 // chrome::NOTIFICATION_EXTENSION_INSTALLED, but this is broadcasted before
248 // ExtensionService has added the extension to its list of installed 248 // ExtensionService has added the extension to its list of installed
249 // extensions and is too early to launch the app. Instead, we will launch at 249 // extensions and is too early to launch the app. Instead, we will launch at
250 // EphemeralAppLauncher::OnExtensionLoaded(). 250 // EphemeralAppLauncher::OnExtensionLoaded().
251 // TODO(tmdiep): Refactor extensions/WebstoreInstaller or 251 // TODO(tmdiep): Refactor extensions/WebstoreInstaller or
252 // WebstoreStandaloneInstaller to support this cleanly. 252 // WebstoreStandaloneInstaller to support this cleanly.
253 } 253 }
254 254
255 void EphemeralAppLauncher::WebContentsDestroyed( 255 void EphemeralAppLauncher::WebContentsDestroyed() {
256 content::WebContents* web_contents) {
257 AbortInstall(); 256 AbortInstall();
258 } 257 }
259 258
260 void EphemeralAppLauncher::OnExtensionLoaded( 259 void EphemeralAppLauncher::OnExtensionLoaded(
261 content::BrowserContext* browser_context, 260 content::BrowserContext* browser_context,
262 const Extension* extension) { 261 const Extension* extension) {
263 if (extension->id() == id()) { 262 if (extension->id() == id()) {
264 LaunchApp(extension); 263 LaunchApp(extension);
265 WebstoreStandaloneInstaller::CompleteInstall(std::string()); 264 WebstoreStandaloneInstaller::CompleteInstall(std::string());
266 } 265 }
267 } 266 }
268 267
269 void EphemeralAppLauncher::ExtensionEnableFlowFinished() { 268 void EphemeralAppLauncher::ExtensionEnableFlowFinished() {
270 ExtensionService* extension_service = 269 ExtensionService* extension_service =
271 extensions::ExtensionSystem::Get(profile())->extension_service(); 270 extensions::ExtensionSystem::Get(profile())->extension_service();
272 DCHECK(extension_service); 271 DCHECK(extension_service);
273 272
274 const Extension* extension = extension_service->GetExtensionById(id(), false); 273 const Extension* extension = extension_service->GetExtensionById(id(), false);
275 if (extension) { 274 if (extension) {
276 LaunchApp(extension); 275 LaunchApp(extension);
277 WebstoreStandaloneInstaller::CompleteInstall(std::string()); 276 WebstoreStandaloneInstaller::CompleteInstall(std::string());
278 } else { 277 } else {
279 WebstoreStandaloneInstaller::CompleteInstall(kLaunchAbortedError); 278 WebstoreStandaloneInstaller::CompleteInstall(kLaunchAbortedError);
280 } 279 }
281 } 280 }
282 281
283 void EphemeralAppLauncher::ExtensionEnableFlowAborted(bool user_initiated) { 282 void EphemeralAppLauncher::ExtensionEnableFlowAborted(bool user_initiated) {
284 WebstoreStandaloneInstaller::CompleteInstall(kLaunchAbortedError); 283 WebstoreStandaloneInstaller::CompleteInstall(kLaunchAbortedError);
285 } 284 }
OLDNEW
« no previous file with comments | « chrome/browser/apps/ephemeral_app_launcher.h ('k') | chrome/browser/autofill/content_autofill_driver_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698