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

Side by Side Diff: chrome/browser/apps/app_url_redirector.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
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/app_url_redirector.h" 5 #include "chrome/browser/apps/app_url_redirector.h"
6 6
7 #include "apps/launcher.h" 7 #include "apps/launcher.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "chrome/browser/prerender/prerender_contents.h" 10 #include "chrome/browser/prerender/prerender_contents.h"
(...skipping 19 matching lines...) Expand all
30 using extensions::UrlHandlers; 30 using extensions::UrlHandlers;
31 using extensions::UrlHandlerInfo; 31 using extensions::UrlHandlerInfo;
32 32
33 namespace { 33 namespace {
34 34
35 bool LaunchAppWithUrl( 35 bool LaunchAppWithUrl(
36 const scoped_refptr<const Extension> app, 36 const scoped_refptr<const Extension> app,
37 const std::string& handler_id, 37 const std::string& handler_id,
38 content::WebContents* source, 38 content::WebContents* source,
39 const navigation_interception::NavigationParams& params) { 39 const navigation_interception::NavigationParams& params) {
40 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 40 DCHECK_CURRENTLY_ON(BrowserThread::UI);
41 41
42 // Redirect top-level navigations only. This excludes iframes and webviews 42 // Redirect top-level navigations only. This excludes iframes and webviews
43 // in particular. 43 // in particular.
44 if (source->IsSubframe()) { 44 if (source->IsSubframe()) {
45 DVLOG(1) << "Cancel redirection: source is a subframe"; 45 DVLOG(1) << "Cancel redirection: source is a subframe";
46 return false; 46 return false;
47 } 47 }
48 48
49 // If prerendering, don't launch the app but abort the navigation. 49 // If prerendering, don't launch the app but abort the navigation.
50 prerender::PrerenderContents* prerender_contents = 50 prerender::PrerenderContents* prerender_contents =
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 request, 120 request,
121 base::Bind(&LaunchAppWithUrl, 121 base::Bind(&LaunchAppWithUrl,
122 scoped_refptr<const Extension>(*iter), 122 scoped_refptr<const Extension>(*iter),
123 handler->id)); 123 handler->id));
124 } 124 }
125 } 125 }
126 126
127 DVLOG(1) << "Skipping redirection: no matching app handler found"; 127 DVLOG(1) << "Skipping redirection: no matching app handler found";
128 return NULL; 128 return NULL;
129 } 129 }
OLDNEW
« no previous file with comments | « chrome/browser/apps/app_shim/app_shim_host_manager_mac.mm ('k') | chrome/browser/apps/ephemeral_app_throttle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698