| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_EXTERNAL_PROTOCOL_EXTERNAL_PROTOCOL_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_EXTERNAL_PROTOCOL_EXTERNAL_PROTOCOL_HANDLER_H_ |
| 6 #define CHROME_BROWSER_EXTERNAL_PROTOCOL_EXTERNAL_PROTOCOL_HANDLER_H_ | 6 #define CHROME_BROWSER_EXTERNAL_PROTOCOL_EXTERNAL_PROTOCOL_HANDLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 // Checks to see if the protocol is allowed, if it is whitelisted, | 58 // Checks to see if the protocol is allowed, if it is whitelisted, |
| 59 // the application associated with the protocol is launched on the io thread, | 59 // the application associated with the protocol is launched on the io thread, |
| 60 // if it is blacklisted, returns silently. Otherwise, an | 60 // if it is blacklisted, returns silently. Otherwise, an |
| 61 // ExternalProtocolDialog is created asking the user. If the user accepts, | 61 // ExternalProtocolDialog is created asking the user. If the user accepts, |
| 62 // LaunchUrlWithoutSecurityCheck is called on the io thread and the | 62 // LaunchUrlWithoutSecurityCheck is called on the io thread and the |
| 63 // application is launched. | 63 // application is launched. |
| 64 // Must run on the UI thread. | 64 // Must run on the UI thread. |
| 65 // Allowing use of a delegate to facilitate unit testing. | 65 // Allowing use of a delegate to facilitate unit testing. |
| 66 static void LaunchUrlWithDelegate(const GURL& url, | 66 static void LaunchUrlWithDelegate(const GURL& url, |
| 67 int render_process_host_id, | 67 int render_process_host_id, |
| 68 int tab_contents_id, | 68 int render_view_routing_id, |
| 69 ui::PageTransition page_transition, | 69 ui::PageTransition page_transition, |
| 70 bool has_user_gesture, | 70 bool has_user_gesture, |
| 71 Delegate* delegate); | 71 Delegate* delegate); |
| 72 | 72 |
| 73 // Starts a url using the external protocol handler with the help | 73 // Starts a url using the external protocol handler with the help |
| 74 // of shellexecute. Should only be called if the protocol is whitelisted | 74 // of shellexecute. Should only be called if the protocol is whitelisted |
| 75 // (checked in LaunchUrl) or if the user explicitly allows it. (By selecting | 75 // (checked in LaunchUrl) or if the user explicitly allows it. (By selecting |
| 76 // "Launch Application" in an ExternalProtocolDialog.) It is assumed that the | 76 // "Launch Application" in an ExternalProtocolDialog.) It is assumed that the |
| 77 // url has already been escaped, which happens in LaunchUrl. | 77 // url has already been escaped, which happens in LaunchUrl. |
| 78 // NOTE: You should Not call this function directly unless you are sure the | 78 // NOTE: You should Not call this function directly unless you are sure the |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 int render_process_host_id, | 114 int render_process_host_id, |
| 115 int routing_id, | 115 int routing_id, |
| 116 ui::PageTransition page_transition, | 116 ui::PageTransition page_transition, |
| 117 bool has_user_gesture); | 117 bool has_user_gesture); |
| 118 | 118 |
| 119 private: | 119 private: |
| 120 DISALLOW_COPY_AND_ASSIGN(ExternalProtocolHandler); | 120 DISALLOW_COPY_AND_ASSIGN(ExternalProtocolHandler); |
| 121 }; | 121 }; |
| 122 | 122 |
| 123 #endif // CHROME_BROWSER_EXTERNAL_PROTOCOL_EXTERNAL_PROTOCOL_HANDLER_H_ | 123 #endif // CHROME_BROWSER_EXTERNAL_PROTOCOL_EXTERNAL_PROTOCOL_HANDLER_H_ |
| OLD | NEW |