Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7842)

Unified Diff: chrome/browser/shell_integration.h

Issue 10453041: Support for interactive set-chrome-as-default in Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: A style fix Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/shell_integration.h
diff --git a/chrome/browser/shell_integration.h b/chrome/browser/shell_integration.h
index 3a0b3ab052689e444505d79ece8d3f1a2fb7df73..4d81ff242bccfce0c28a087bc41a23a0a8c7607d 100644
--- a/chrome/browser/shell_integration.h
+++ b/chrome/browser/shell_integration.h
@@ -23,16 +23,30 @@ class ShellIntegration {
// false if this operation fails.
static bool SetAsDefaultBrowser();
+ // Initializes an OS shell flow which (if followed by the user) should set
+ // Chrome as the default browser. Returns false if the flow cannot be
+ // initialized or if it is not supported (introduced for Windows 8).
+ static bool StartSetAsDefaultBrowserInteractive();
grt (UTC plus 2) 2012/05/28 20:47:02 The name "StartBlaBlah" makes me think that this m
motek. 2012/05/31 21:59:04 Done.
+
// Sets Chrome as the default client application for the given protocol
// (only for the current user). Returns false if this operation fails.
static bool SetAsDefaultProtocolClient(const std::string& protocol);
- // Returns true if the running browser can be set as the default browser.
- static bool CanSetAsDefaultBrowser();
+ // In Windows 8 a browser can be made default-in-metro only in an interactive
+ // flow. We will distinguish between two types of permissions here to avoid
+ // forcing the user into UI interaction when this should not be done.
+ enum DefaultSettingsChangePermission {
+ CHANGE_DEFAULT_NOT_ALLOWED = 0,
+ CHANGE_DEFAULT_UNATTENDED,
+ CHANGE_DEFAULT_INTERACTIVE,
+ };
+
+ // Returns requirements for making the running browser the user's default.
+ static DefaultSettingsChangePermission CanSetAsDefaultBrowser();
- // Returns true if the running browser can be set as the default client
- // application for specific protocols.
- static bool CanSetAsDefaultProtocolClient();
+ // Returns requirements for making the running browser the user's default
+ // client application for specific protocols.
+ static DefaultSettingsChangePermission CanSetAsDefaultProtocolClient();
// On Linux, it may not be possible to determine or set the default browser
// on some desktop environments or configurations. So, we use this enum and

Powered by Google App Engine
This is Rietveld 408576698