OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_EXTERNAL_PROTOCOL_HANDLER_H_ |
6 #define CHROME_BROWSER_EXTERNAL_PROTOCOL_HANDLER_H_ | 6 #define CHROME_BROWSER_EXTERNAL_PROTOCOL_HANDLER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 // NOTE: You should Not call this function directly unless you are sure the | 62 // NOTE: You should Not call this function directly unless you are sure the |
63 // url you have has been checked against the blacklist, and has been escaped. | 63 // url you have has been checked against the blacklist, and has been escaped. |
64 // All calls to this function should originate in some way from LaunchUrl. | 64 // All calls to this function should originate in some way from LaunchUrl. |
65 // This will execute on the file thread. | 65 // This will execute on the file thread. |
66 static void LaunchUrlWithoutSecurityCheck(const GURL& url); | 66 static void LaunchUrlWithoutSecurityCheck(const GURL& url); |
67 | 67 |
68 // Prepopulates the dictionary with known protocols to deny or allow, if | 68 // Prepopulates the dictionary with known protocols to deny or allow, if |
69 // preferences for them do not already exist. | 69 // preferences for them do not already exist. |
70 static void PrepopulateDictionary(DictionaryValue* win_pref); | 70 static void PrepopulateDictionary(DictionaryValue* win_pref); |
71 | 71 |
72 // Called when the user interacts with a web page. | 72 // Allows LaunchUrl to proceed with launching an external protocol handler. |
73 static void OnUserGesture(); | 73 // This is typically triggered by a user gesture, but is also called for |
| 74 // each extension API function. Note that each call to LaunchUrl resets |
| 75 // the state to false (not allowed). |
| 76 static void PermitLaunchUrl(); |
74 }; | 77 }; |
75 | 78 |
76 #endif // CHROME_BROWSER_EXTERNAL_PROTOCOL_HANDLER_H_ | 79 #endif // CHROME_BROWSER_EXTERNAL_PROTOCOL_HANDLER_H_ |
OLD | NEW |