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

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

Issue 339103002: Update the EphemeralAppLauncher for use by the webstorePrivate API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase again Created 6 years, 6 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_throttle.h" 5 #include "chrome/browser/apps/ephemeral_app_throttle.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "chrome/browser/apps/ephemeral_app_launcher.h" 8 #include "chrome/browser/apps/ephemeral_app_launcher.h"
9 #include "chrome/browser/extensions/extension_service.h" 9 #include "chrome/browser/extensions/extension_service.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 DCHECK(service); 45 DCHECK(service);
46 const Extension* extension = service->GetInstalledExtension(app_id); 46 const Extension* extension = service->GetInstalledExtension(app_id);
47 47
48 // Only launch apps. 48 // Only launch apps.
49 if (extension && !extension->is_app()) 49 if (extension && !extension->is_app())
50 return false; 50 return false;
51 51
52 // The EphemeralAppLauncher will handle launching of an existing app or 52 // The EphemeralAppLauncher will handle launching of an existing app or
53 // installing and launching a new ephemeral app. 53 // installing and launching a new ephemeral app.
54 scoped_refptr<EphemeralAppLauncher> installer = 54 scoped_refptr<EphemeralAppLauncher> installer =
55 EphemeralAppLauncher::CreateForLink(app_id, source); 55 EphemeralAppLauncher::CreateForWebContents(
56 app_id, source, EphemeralAppLauncher::LaunchCallback());
56 installer->Start(); 57 installer->Start();
57 return true; 58 return true;
58 } 59 }
59 60
60 } // namespace 61 } // namespace
61 62
62 // static 63 // static
63 content::ResourceThrottle* 64 content::ResourceThrottle*
64 EphemeralAppThrottle::MaybeCreateThrottleForLaunch( 65 EphemeralAppThrottle::MaybeCreateThrottleForLaunch(
65 net::URLRequest* request, 66 net::URLRequest* request,
(...skipping 24 matching lines...) Expand all
90 return NULL; 91 return NULL;
91 92
92 std::string app_id(request->url().ExtractFileName()); 93 std::string app_id(request->url().ExtractFileName());
93 if (!Extension::IdIsValid(app_id)) 94 if (!Extension::IdIsValid(app_id))
94 return NULL; 95 return NULL;
95 96
96 return new navigation_interception::InterceptNavigationResourceThrottle( 97 return new navigation_interception::InterceptNavigationResourceThrottle(
97 request, 98 request,
98 base::Bind(&LaunchEphemeralApp, app_id)); 99 base::Bind(&LaunchEphemeralApp, app_id));
99 } 100 }
OLDNEW
« no previous file with comments | « chrome/browser/apps/ephemeral_app_launcher_browsertest.cc ('k') | chrome/browser/extensions/extension_install_checker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698