OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #import "chrome/browser/web_applications/web_app_mac.h" | 5 #import "chrome/browser/web_applications/web_app_mac.h" |
6 | 6 |
7 #import <Carbon/Carbon.h> | 7 #import <Carbon/Carbon.h> |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
| 12 #include "base/files/file_enumerator.h" |
12 #include "base/files/scoped_temp_dir.h" | 13 #include "base/files/scoped_temp_dir.h" |
13 #include "base/mac/bundle_locations.h" | 14 #include "base/mac/bundle_locations.h" |
14 #include "base/mac/foundation_util.h" | 15 #include "base/mac/foundation_util.h" |
15 #include "base/mac/launch_services_util.h" | 16 #include "base/mac/launch_services_util.h" |
16 #include "base/mac/mac_logging.h" | 17 #include "base/mac/mac_logging.h" |
17 #include "base/mac/mac_util.h" | 18 #include "base/mac/mac_util.h" |
18 #include "base/mac/scoped_cftyperef.h" | 19 #include "base/mac/scoped_cftyperef.h" |
19 #include "base/memory/scoped_nsobject.h" | 20 #include "base/memory/scoped_nsobject.h" |
20 #include "base/strings/sys_string_conversions.h" | 21 #include "base/strings/sys_string_conversions.h" |
21 #include "base/string_util.h" | 22 #include "base/string_util.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 | 136 |
136 // Given the path to an app bundle, return the resources directory. | 137 // Given the path to an app bundle, return the resources directory. |
137 base::FilePath GetResourcesPath(const base::FilePath& app_path) { | 138 base::FilePath GetResourcesPath(const base::FilePath& app_path) { |
138 return app_path.Append("Contents").Append("Resources"); | 139 return app_path.Append("Contents").Append("Resources"); |
139 } | 140 } |
140 | 141 |
141 bool HasExistingExtensionShim(const base::FilePath& destination_directory, | 142 bool HasExistingExtensionShim(const base::FilePath& destination_directory, |
142 const std::string& extension_id, | 143 const std::string& extension_id, |
143 const base::FilePath& own_basename) { | 144 const base::FilePath& own_basename) { |
144 // Check if there any any other shims for the same extension. | 145 // Check if there any any other shims for the same extension. |
145 file_util::FileEnumerator enumerator(destination_directory, | 146 base::FileEnumerator enumerator(destination_directory, |
146 false /* recursive */, | 147 false /* recursive */, |
147 file_util::FileEnumerator::DIRECTORIES); | 148 base::FileEnumerator::DIRECTORIES); |
148 for (base::FilePath shim_path = enumerator.Next(); | 149 for (base::FilePath shim_path = enumerator.Next(); |
149 !shim_path.empty(); shim_path = enumerator.Next()) { | 150 !shim_path.empty(); shim_path = enumerator.Next()) { |
150 if (shim_path.BaseName() != own_basename && | 151 if (shim_path.BaseName() != own_basename && |
151 EndsWith(shim_path.RemoveExtension().value(), | 152 EndsWith(shim_path.RemoveExtension().value(), |
152 extension_id, | 153 extension_id, |
153 true /* case_sensitive */)) { | 154 true /* case_sensitive */)) { |
154 return true; | 155 return true; |
155 } | 156 } |
156 } | 157 } |
157 | 158 |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 const base::FilePath& web_app_path, | 456 const base::FilePath& web_app_path, |
456 const string16& old_app_title, | 457 const string16& old_app_title, |
457 const ShellIntegration::ShortcutInfo& shortcut_info) { | 458 const ShellIntegration::ShortcutInfo& shortcut_info) { |
458 // TODO(benwells): Implement this when shortcuts / weblings are enabled on | 459 // TODO(benwells): Implement this when shortcuts / weblings are enabled on |
459 // mac. | 460 // mac. |
460 } | 461 } |
461 | 462 |
462 } // namespace internals | 463 } // namespace internals |
463 | 464 |
464 } // namespace web_app | 465 } // namespace web_app |
OLD | NEW |