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

Unified Diff: chrome/browser/shell_integration_mac.mm

Issue 200025: Allow the default browser check to return "unknown" and reflect that in the UI. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 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_mac.mm
===================================================================
--- chrome/browser/shell_integration_mac.mm (revision 25499)
+++ chrome/browser/shell_integration_mac.mm (working copy)
@@ -22,7 +22,7 @@
bool IsIdentifierDefaultBrowser(NSString* identifier) {
NSString* defaultBrowser =
[[NSWorkspace sharedWorkspace] defaultBrowserIdentifier];
- if (!identifier || !defaultBrowser)
+ if (!defaultBrowser)
return false;
// We need to ensure we do the comparison case-insensitive as LS doesn't
// persist the case of our bundle id.
@@ -33,14 +33,17 @@
} // namespace
-// Returns true if this instance of Chromium is the default browser. (Defined
-// as being the handler for the http/https protocols... we don't want to
-// report false here if the user has simply chosen to open HTML files in a
-// text editor and ftp links with a FTP client).
-bool ShellIntegration::IsDefaultBrowser() {
+// Attempt to determine if this instance of Chrome is the default browser and
+// return the appropriate state. (Defined as being the handler for HTTP/HTTPS
+// protocols; we don't want to report "no" here if the user has simply chosen
+// to open HTML files in a text editor and FTP links with an FTP client.)
+ShellIntegration::DefaultBrowserState ShellIntegration::IsDefaultBrowser() {
NSBundle* mainBundle = mac_util::MainAppBundle();
NSString* myIdentifier = [mainBundle bundleIdentifier];
Evan Martin 2009/09/04 22:46:15 Why can this return null now after your change?
Mike Mammarella 2009/09/04 22:56:27 Presumably it could have before as well; I just mo
- return IsIdentifierDefaultBrowser(myIdentifier);
+ if (!myIdentifier)
+ return UNKNOWN_DEFAULT_BROWSER;
+ return IsIdentifierDefaultBrowser(myIdentifier) ? IS_DEFAULT_BROWSER
+ : NOT_DEFAULT_BROWSER;
}
// Returns true if Firefox is the default browser for the current user.

Powered by Google App Engine
This is Rietveld 408576698