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

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

Issue 7388009: Canary versions no longer always remove protocol handlers at startup. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Fixed up comment. Created 9 years, 5 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
« no previous file with comments | « chrome/browser/shell_integration.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/mac_util.h" 7 #include "base/mac/mac_util.h"
8 #include "base/mac/foundation_util.h" 8 #include "base/mac/foundation_util.h"
9 #include "chrome/common/chrome_version_info.h" 9 #include "chrome/common/chrome_version_info.h"
10 #import "third_party/mozilla/NSWorkspace+Utils.h" 10 #import "third_party/mozilla/NSWorkspace+Utils.h"
(...skipping 20 matching lines...) Expand all
31 return true; 31 return true;
32 } 32 }
33 33
34 // Sets Chromium as the default application to be used by the operating system 34 // Sets Chromium as the default application to be used by the operating system
35 // for the given protocol. This applies only for the current user. Returns false 35 // for the given protocol. This applies only for the current user. Returns false
36 // if this cannot be done, or if the operation fails. 36 // if this cannot be done, or if the operation fails.
37 bool ShellIntegration::SetAsDefaultProtocolClient(const std::string& protocol) { 37 bool ShellIntegration::SetAsDefaultProtocolClient(const std::string& protocol) {
38 if (protocol.empty()) 38 if (protocol.empty())
39 return false; 39 return false;
40 40
41 if (!CanSetAsDefaultProtocolClient(protocol)) 41 if (!CanSetAsDefaultProtocolClient())
42 return false; 42 return false;
43 43
44 // We really do want the main bundle here, not base::mac::MainAppBundle(), 44 // We really do want the main bundle here, not base::mac::MainAppBundle(),
45 // which is the bundle for the framework. 45 // which is the bundle for the framework.
46 NSString* identifier = [[NSBundle mainBundle] bundleIdentifier]; 46 NSString* identifier = [[NSBundle mainBundle] bundleIdentifier];
47 if (!identifier) 47 if (!identifier)
48 return false; 48 return false;
49 49
50 NSString* protocol_ns = [NSString stringWithUTF8String:protocol.c_str()]; 50 NSString* protocol_ns = [NSString stringWithUTF8String:protocol.c_str()];
51 OSStatus return_code = 51 OSStatus return_code =
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 // We really do want the main bundle here, not base::mac::MainAppBundle(), 120 // We really do want the main bundle here, not base::mac::MainAppBundle(),
121 // which is the bundle for the framework. 121 // which is the bundle for the framework.
122 NSString* my_identifier = [[NSBundle mainBundle] bundleIdentifier]; 122 NSString* my_identifier = [[NSBundle mainBundle] bundleIdentifier];
123 if (!my_identifier) 123 if (!my_identifier)
124 return UNKNOWN_DEFAULT_WEB_CLIENT; 124 return UNKNOWN_DEFAULT_WEB_CLIENT;
125 125
126 NSString* protocol_ns = [NSString stringWithUTF8String:protocol.c_str()]; 126 NSString* protocol_ns = [NSString stringWithUTF8String:protocol.c_str()];
127 return IsIdentifierDefaultProtocolClient(my_identifier, protocol_ns) ? 127 return IsIdentifierDefaultProtocolClient(my_identifier, protocol_ns) ?
128 IS_DEFAULT_WEB_CLIENT : NOT_DEFAULT_WEB_CLIENT; 128 IS_DEFAULT_WEB_CLIENT : NOT_DEFAULT_WEB_CLIENT;
129 } 129 }
OLDNEW
« no previous file with comments | « chrome/browser/shell_integration.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698