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
3 // found in the LICENSE file.
5 #include "chrome/browser/external_protocol/external_protocol_handler.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"
16 using content::WebContents
;
19 void ExternalProtocolHandler::RunExternalProtocolDialog(
21 int render_process_host_id
,
23 ui::PageTransition page_transition
,
24 bool has_user_gesture
) {
25 WebContents
* web_contents
= tab_util::GetWebContentsByID(
26 render_process_host_id
, routing_id
);
29 navigation_interception::InterceptNavigationDelegate
* delegate
=
30 navigation_interception::InterceptNavigationDelegate::Get(web_contents
);
34 navigation_interception::NavigationParams
navigation_params(
37 has_user_gesture
, // has_user_gesture
38 false, // is_post, doesn't matter here.
40 false, // is_redirect, doesn't matter here.
41 true, // is_external_protocol
42 false); // is_main_frame
43 delegate
->ShouldIgnoreNavigation(navigation_params
);