Chromium Code Reviews| Index: chrome/browser/shell_integration.h |
| diff --git a/chrome/browser/shell_integration.h b/chrome/browser/shell_integration.h |
| index e71dbfed73fc4b1031f31c99b648f8dc9751cb5e..5e2d8005e79043306992d14512fb0cd145959094 100644 |
| --- a/chrome/browser/shell_integration.h |
| +++ b/chrome/browser/shell_integration.h |
| @@ -34,6 +34,11 @@ bool SetAsDefaultBrowser(); |
| // shown and this method returns true. |
| bool SetAsDefaultBrowserInteractive(); |
| +// Initiates the interaction with the system settings for the default browser. |
| +// The function takes care of making sure |on_finished_callback| will get called |
| +// exactly once when the interaction is finished. |
| +void SetAsDefaultBrowserUsingSystemSettings(base::Closure on_finished_callback); |
|
grt (UTC plus 2)
2016/03/29 16:45:02
nit: pass callbacks by const-ref
Patrick Monette
2016/03/29 17:43:08
Done.
|
| + |
| // Sets Chrome as the default client application for the given protocol |
| // (only for the current user). Returns false if this operation fails. |
| bool SetAsDefaultProtocolClient(const std::string& protocol); |
| @@ -56,6 +61,8 @@ enum DefaultWebClientSetPermission { |
| SET_DEFAULT_UNATTENDED, |
| // On Windows 8, a browser can be made default only in an interactive flow. |
| SET_DEFAULT_INTERACTIVE, |
| + // On Windows 10+, the system settings page for default apps is opened. |
| + SET_DEFAULT_OPEN_SETTINGS, |
| }; |
| // Returns requirements for making the running browser the user's default. |
| @@ -232,7 +239,9 @@ class DefaultWebClientWorker |
| // Implementation of CheckIsDefault() and SetAsDefault() for subclasses. |
| virtual DefaultWebClientState CheckIsDefaultImpl() = 0; |
| - virtual void SetAsDefaultImpl() = 0; |
| + |
| + // Subclasses MUST make sure the callback is executed. |
| + virtual void SetAsDefaultImpl(base::Closure on_finished_callback) = 0; |
| // Reports the result for the set-as-default operation. |
| void ReportSetDefaultResult(DefaultWebClientState state); |
| @@ -268,7 +277,7 @@ class DefaultBrowserWorker : public DefaultWebClientWorker { |
| DefaultWebClientState CheckIsDefaultImpl() override; |
| // Set Chrome as the default browser. |
| - void SetAsDefaultImpl() override; |
| + void SetAsDefaultImpl(base::Closure on_finished_callback) override; |
| DISALLOW_COPY_AND_ASSIGN(DefaultBrowserWorker); |
| }; |
| @@ -292,7 +301,7 @@ class DefaultProtocolClientWorker : public DefaultWebClientWorker { |
| DefaultWebClientState CheckIsDefaultImpl() override; |
| // Set Chrome as the default handler for this protocol. |
| - void SetAsDefaultImpl() override; |
| + void SetAsDefaultImpl(base::Closure on_finished_callback) override; |
| std::string protocol_; |