Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 "base/logging.h" | 5 #include "base/logging.h" |
| 6 #include "chrome/browser/android/tab_android.h" | 6 #include "chrome/browser/android/tab_android.h" |
| 7 #include "chrome/browser/external_protocol/external_protocol_handler.h" | 7 #include "chrome/browser/external_protocol/external_protocol_handler.h" |
| 8 #include "chrome/browser/tab_contents/tab_util.h" | 8 #include "chrome/browser/tab_contents/tab_util.h" |
| 9 #include "content/public/browser/web_contents.h" | 9 #include "content/public/browser/web_contents.h" |
| 10 | 10 |
| 11 using content::WebContents; | 11 using content::WebContents; |
| 12 | 12 |
| 13 // static | 13 // static |
| 14 void ExternalProtocolHandler::RunExternalProtocolDialog( | 14 void ExternalProtocolHandler::RunExternalProtocolDialog( |
| 15 const GURL& url, int render_process_host_id, int routing_id) { | 15 const GURL& url, int render_process_host_id, int routing_id) { |
| 16 WebContents* web_contents = tab_util::GetWebContentsByID( | 16 // Chrome on Android uses a throttle-based mechansim to intercept links |
| 17 render_process_host_id, routing_id); | 17 // so that the user may choose to run an Android application instead of |
| 18 if (web_contents) { | 18 // loading the link in the browser. This mechanism also handles external |
| 19 TabAndroid* tab = TabAndroid::FromWebContents(web_contents); | 19 // protocols, so we don't need to do anything here. |
|
mkosiba (inactive)
2012/10/25 09:02:12
NOTREACHED?
John Knottenbelt
2012/10/25 16:17:27
Done.
| |
| 20 if (tab) | |
| 21 return tab->RunExternalProtocolDialog(url); | |
| 22 } | |
| 23 } | 20 } |
| OLD | NEW |