| 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 #ifndef CHROME_BROWSER_SHELL_INTEGRATION_H_ | 5 #ifndef CHROME_BROWSER_SHELL_INTEGRATION_H_ |
| 6 #define CHROME_BROWSER_SHELL_INTEGRATION_H_ | 6 #define CHROME_BROWSER_SHELL_INTEGRATION_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 // Chrome as the default browser. Returns false if the flow cannot be | 26 // Chrome as the default browser. Returns false if the flow cannot be |
| 27 // initialized, if it is not supported (introduced for Windows 8) or if the | 27 // initialized, if it is not supported (introduced for Windows 8) or if the |
| 28 // user cancels the operation. This is a blocking call and requires a FILE | 28 // user cancels the operation. This is a blocking call and requires a FILE |
| 29 // thread. | 29 // thread. |
| 30 static bool SetAsDefaultBrowserInteractive(); | 30 static bool SetAsDefaultBrowserInteractive(); |
| 31 | 31 |
| 32 // Sets Chrome as the default client application for the given protocol | 32 // Sets Chrome as the default client application for the given protocol |
| 33 // (only for the current user). Returns false if this operation fails. | 33 // (only for the current user). Returns false if this operation fails. |
| 34 static bool SetAsDefaultProtocolClient(const std::string& protocol); | 34 static bool SetAsDefaultProtocolClient(const std::string& protocol); |
| 35 | 35 |
| 36 // Initiates an OS shell flow which (if followed by the user) should set |
| 37 // Chrome as the default handler for |protocol|. Returns false if the flow |
| 38 // cannot be initialized, if it is not supported (introduced for Windows 8) |
| 39 // or if the user cancels the operation. This is a blocking call and requires |
| 40 // a FILE thread. |
| 41 static bool SetAsDefaultProtocolClientInteractive( |
| 42 const std::string& protocol); |
| 43 |
| 36 // In Windows 8 a browser can be made default-in-metro only in an interactive | 44 // In Windows 8 a browser can be made default-in-metro only in an interactive |
| 37 // flow. We will distinguish between two types of permissions here to avoid | 45 // flow. We will distinguish between two types of permissions here to avoid |
| 38 // forcing the user into UI interaction when this should not be done. | 46 // forcing the user into UI interaction when this should not be done. |
| 39 enum DefaultWebClientSetPermission { | 47 enum DefaultWebClientSetPermission { |
| 40 SET_DEFAULT_NOT_ALLOWED = 0, | 48 SET_DEFAULT_NOT_ALLOWED = 0, |
| 41 SET_DEFAULT_UNATTENDED, | 49 SET_DEFAULT_UNATTENDED, |
| 42 SET_DEFAULT_INTERACTIVE, | 50 SET_DEFAULT_INTERACTIVE, |
| 43 }; | 51 }; |
| 44 | 52 |
| 45 // Returns requirements for making the running browser the user's default. | 53 // Returns requirements for making the running browser the user's default. |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 // Set Chrome as the default handler for this protocol. | 294 // Set Chrome as the default handler for this protocol. |
| 287 virtual bool SetAsDefault(bool interactive_permitted) OVERRIDE; | 295 virtual bool SetAsDefault(bool interactive_permitted) OVERRIDE; |
| 288 | 296 |
| 289 std::string protocol_; | 297 std::string protocol_; |
| 290 | 298 |
| 291 DISALLOW_COPY_AND_ASSIGN(DefaultProtocolClientWorker); | 299 DISALLOW_COPY_AND_ASSIGN(DefaultProtocolClientWorker); |
| 292 }; | 300 }; |
| 293 }; | 301 }; |
| 294 | 302 |
| 295 #endif // CHROME_BROWSER_SHELL_INTEGRATION_H_ | 303 #endif // CHROME_BROWSER_SHELL_INTEGRATION_H_ |
| OLD | NEW |