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

Side by Side Diff: chrome/browser/shell_integration_mac.mm

Issue 6046009: Move base/mac_util.h to base/mac and use the base::mac namespace.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 #include "chrome/browser/shell_integration.h" 5 #include "chrome/browser/shell_integration.h"
6 6
7 #include "base/mac_util.h" 7 #include "base/mac/mac_util.h"
8 #import "third_party/mozilla/NSWorkspace+Utils.h" 8 #import "third_party/mozilla/NSWorkspace+Utils.h"
9 9
10 // Sets Chromium as default browser (only for current user). Returns false if 10 // Sets Chromium as default browser (only for current user). Returns false if
11 // this operation fails (which we can't check for). 11 // this operation fails (which we can't check for).
12 bool ShellIntegration::SetAsDefaultBrowser() { 12 bool ShellIntegration::SetAsDefaultBrowser() {
13 // We really do want the main bundle here, not mac_util::MainAppBundle(), 13 // We really do want the main bundle here, not base::mac::MainAppBundle(),
14 // which is the bundle for the framework. 14 // which is the bundle for the framework.
15 NSString* identifier = [[NSBundle mainBundle] bundleIdentifier]; 15 NSString* identifier = [[NSBundle mainBundle] bundleIdentifier];
16 [[NSWorkspace sharedWorkspace] setDefaultBrowserWithIdentifier:identifier]; 16 [[NSWorkspace sharedWorkspace] setDefaultBrowserWithIdentifier:identifier];
17 return true; 17 return true;
18 } 18 }
19 19
20 namespace { 20 namespace {
21 21
22 // Returns true if |identifier| is the bundle id of the default browser. 22 // Returns true if |identifier| is the bundle id of the default browser.
23 bool IsIdentifierDefaultBrowser(NSString* identifier) { 23 bool IsIdentifierDefaultBrowser(NSString* identifier) {
(...skipping 20 matching lines...) Expand all
44 if (!myIdentifier) 44 if (!myIdentifier)
45 return UNKNOWN_DEFAULT_BROWSER; 45 return UNKNOWN_DEFAULT_BROWSER;
46 return IsIdentifierDefaultBrowser(myIdentifier) ? IS_DEFAULT_BROWSER 46 return IsIdentifierDefaultBrowser(myIdentifier) ? IS_DEFAULT_BROWSER
47 : NOT_DEFAULT_BROWSER; 47 : NOT_DEFAULT_BROWSER;
48 } 48 }
49 49
50 // Returns true if Firefox is the default browser for the current user. 50 // Returns true if Firefox is the default browser for the current user.
51 bool ShellIntegration::IsFirefoxDefaultBrowser() { 51 bool ShellIntegration::IsFirefoxDefaultBrowser() {
52 return IsIdentifierDefaultBrowser(@"org.mozilla.firefox"); 52 return IsIdentifierDefaultBrowser(@"org.mozilla.firefox");
53 } 53 }
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/backing_store_mac.mm ('k') | chrome/browser/ui/cocoa/about_ipc_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698