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

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

Issue 1098103002: [chrome/browser/apps] favor DCHECK_CURRENTLY_ON for better logs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « chrome/browser/apps/app_url_redirector.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 12 matching lines...) Expand all
23 using content::BrowserThread; 23 using content::BrowserThread;
24 using content::WebContents; 24 using content::WebContents;
25 using extensions::Extension; 25 using extensions::Extension;
26 26
27 namespace { 27 namespace {
28 28
29 bool LaunchEphemeralApp( 29 bool LaunchEphemeralApp(
30 const std::string& app_id, 30 const std::string& app_id,
31 content::WebContents* source, 31 content::WebContents* source,
32 const navigation_interception::NavigationParams& params) { 32 const navigation_interception::NavigationParams& params) {
33 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 33 DCHECK_CURRENTLY_ON(BrowserThread::UI);
34 34
35 // Redirect top-level navigations only. 35 // Redirect top-level navigations only.
36 if (source->IsSubframe()) 36 if (source->IsSubframe())
37 return false; 37 return false;
38 38
39 Profile* profile = 39 Profile* profile =
40 Profile::FromBrowserContext(source->GetBrowserContext()); 40 Profile::FromBrowserContext(source->GetBrowserContext());
41 if (!profile) 41 if (!profile)
42 return false; 42 return false;
43 43
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 return NULL; 92 return NULL;
93 93
94 std::string app_id(request->url().ExtractFileName()); 94 std::string app_id(request->url().ExtractFileName());
95 if (!crx_file::id_util::IdIsValid(app_id)) 95 if (!crx_file::id_util::IdIsValid(app_id))
96 return NULL; 96 return NULL;
97 97
98 return new navigation_interception::InterceptNavigationResourceThrottle( 98 return new navigation_interception::InterceptNavigationResourceThrottle(
99 request, 99 request,
100 base::Bind(&LaunchEphemeralApp, app_id)); 100 base::Bind(&LaunchEphemeralApp, app_id));
101 } 101 }
OLDNEW
« no previous file with comments | « chrome/browser/apps/app_url_redirector.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698