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

Side by Side Diff: chrome/browser/ui/android/external_protocol_dialog_android.cc

Issue 1091253008: Fix an issue that external protocol in subframes are not handled on Android (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 (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/external_protocol/external_protocol_handler.h" 5 #include "chrome/browser/external_protocol/external_protocol_handler.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/browser/external_protocol/external_protocol_handler.h"
9 #include "chrome/browser/tab_contents/tab_util.h"
10 #include "components/navigation_interception/intercept_navigation_delegate.h"
11 #include "components/navigation_interception/navigation_params.h"
12 #include "content/public/browser/web_contents.h"
13 #include "content/public/common/referrer.h"
14 #include "ui/base/page_transition_types.h"
15
16 using content::WebContents;
8 17
9 // static 18 // static
10 void ExternalProtocolHandler::RunExternalProtocolDialog( 19 void ExternalProtocolHandler::RunExternalProtocolDialog(
11 const GURL& url, int render_process_host_id, int routing_id) { 20 const GURL& url, int render_process_host_id, int routing_id,
12 // Chrome on Android uses a throttle-based mechansim to intercept links 21 ui::PageTransition page_transition) {
13 // so that the user may choose to run an Android application instead of 22 WebContents* web_contents = tab_util::GetWebContentsByID(
14 // loading the link in the browser. The throttle is also used to handle 23 render_process_host_id, routing_id);
15 // external protocols, so this code should not be reachable. 24 if (!web_contents)
16 NOTREACHED(); 25 return;
26 navigation_interception::InterceptNavigationDelegate* delegate =
27 navigation_interception::InterceptNavigationDelegate::Get(web_contents);
28 if (!delegate)
29 return;
30
31 navigation_interception::NavigationParams navigation_params(
32 url,
33 content::Referrer(),
34 true, // has_user_gesture
35 false, // is_post, doesn't matter here.
36 page_transition,
37 false, // is_redirect, doesn't matter here.
38 true); // is_external_protocol
39 delegate->ShouldIgnoreNavigation(navigation_params);
17 } 40 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698