| 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" |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 bool HasExistingExtensionShim(const base::FilePath& destination_directory, | 176 bool HasExistingExtensionShim(const base::FilePath& destination_directory, |
| 177 const std::string& extension_id, | 177 const std::string& extension_id, |
| 178 const base::FilePath& own_basename) { | 178 const base::FilePath& own_basename) { |
| 179 // Check if there any any other shims for the same extension. | 179 // Check if there any any other shims for the same extension. |
| 180 base::FileEnumerator enumerator(destination_directory, | 180 base::FileEnumerator enumerator(destination_directory, |
| 181 false /* recursive */, | 181 false /* recursive */, |
| 182 base::FileEnumerator::DIRECTORIES); | 182 base::FileEnumerator::DIRECTORIES); |
| 183 for (base::FilePath shim_path = enumerator.Next(); | 183 for (base::FilePath shim_path = enumerator.Next(); |
| 184 !shim_path.empty(); shim_path = enumerator.Next()) { | 184 !shim_path.empty(); shim_path = enumerator.Next()) { |
| 185 if (shim_path.BaseName() != own_basename && | 185 if (shim_path.BaseName() != own_basename && |
| 186 EndsWith(shim_path.RemoveExtension().value(), | 186 base::EndsWith(shim_path.RemoveExtension().value(), |
| 187 extension_id, | 187 extension_id, |
| 188 true /* case_sensitive */)) { | 188 true /* case_sensitive */)) { |
| 189 return true; | 189 return true; |
| 190 } | 190 } |
| 191 } | 191 } |
| 192 | 192 |
| 193 return false; | 193 return false; |
| 194 } | 194 } |
| 195 | 195 |
| 196 // Given the path to an app bundle, return the path to the Info.plist file. | 196 // Given the path to an app bundle, return the path to the Info.plist file. |
| (...skipping 1014 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1211 web_app::GetShortcutInfoForApp( | 1211 web_app::GetShortcutInfoForApp( |
| 1212 app, | 1212 app, |
| 1213 profile, | 1213 profile, |
| 1214 base::Bind(&web_app::CreateAppShortcutInfoLoaded, | 1214 base::Bind(&web_app::CreateAppShortcutInfoLoaded, |
| 1215 profile, | 1215 profile, |
| 1216 app, | 1216 app, |
| 1217 close_callback)); | 1217 close_callback)); |
| 1218 } | 1218 } |
| 1219 | 1219 |
| 1220 } // namespace chrome | 1220 } // namespace chrome |
| OLD | NEW |