| 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 "chrome/browser/shell_integration.h" | 10 #include "chrome/browser/shell_integration.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 // url you have has been checked against the blacklist, and has been escaped. | 89 // url you have has been checked against the blacklist, and has been escaped. |
| 90 // All calls to this function should originate in some way from LaunchUrl. | 90 // All calls to this function should originate in some way from LaunchUrl. |
| 91 static void LaunchUrlWithoutSecurityCheck(const GURL& url, | 91 static void LaunchUrlWithoutSecurityCheck(const GURL& url, |
| 92 int render_process_host_id, | 92 int render_process_host_id, |
| 93 int tab_contents_id); | 93 int tab_contents_id); |
| 94 | 94 |
| 95 // Prepopulates the dictionary with known protocols to deny or allow, if | 95 // Prepopulates the dictionary with known protocols to deny or allow, if |
| 96 // preferences for them do not already exist. | 96 // preferences for them do not already exist. |
| 97 static void PrepopulateDictionary(base::DictionaryValue* win_pref); | 97 static void PrepopulateDictionary(base::DictionaryValue* win_pref); |
| 98 | 98 |
| 99 // Allows LaunchUrl to proceed with launching an external protocol handler. | 99 class ScopedUserGesture { |
| 100 // This is typically triggered by a user gesture, but is also called for | 100 public: |
| 101 // each extension API function. Note that each call to LaunchUrl resets | 101 ScopedUserGesture(); |
| 102 // the state to false (not allowed). | 102 ~ScopedUserGesture(); |
| 103 static void PermitLaunchUrl(); | 103 private: |
| 104 DISALLOW_COPY_AND_ASSIGN(ScopedUserGesture); |
| 105 }; |
| 106 |
| 107 private: |
| 108 DISALLOW_COPY_AND_ASSIGN(ExternalProtocolHandler); |
| 104 }; | 109 }; |
| 105 | 110 |
| 111 |
| 106 #endif // CHROME_BROWSER_EXTERNAL_PROTOCOL_EXTERNAL_PROTOCOL_HANDLER_H_ | 112 #endif // CHROME_BROWSER_EXTERNAL_PROTOCOL_EXTERNAL_PROTOCOL_HANDLER_H_ |
| OLD | NEW |