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

Side by Side Diff: chrome/browser/web_applications/web_app_mac.mm

Issue 481433005: Extensions: Move id_util functions to crx_file component. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: revert last patchset. function returns Extension* and can't use an assert. Created 6 years, 4 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/ui/webui/extensions/chromeos/kiosk_apps_handler.cc ('k') | chrome/common/DEPS » ('j') | 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) 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 20 matching lines...) Expand all
31 #include "chrome/browser/browser_process.h" 31 #include "chrome/browser/browser_process.h"
32 #include "chrome/browser/profiles/profile.h" 32 #include "chrome/browser/profiles/profile.h"
33 #include "chrome/browser/profiles/profile_manager.h" 33 #include "chrome/browser/profiles/profile_manager.h"
34 #include "chrome/browser/shell_integration.h" 34 #include "chrome/browser/shell_integration.h"
35 #include "chrome/browser/ui/app_list/app_list_service.h" 35 #include "chrome/browser/ui/app_list/app_list_service.h"
36 #include "chrome/common/chrome_constants.h" 36 #include "chrome/common/chrome_constants.h"
37 #include "chrome/common/chrome_paths.h" 37 #include "chrome/common/chrome_paths.h"
38 #include "chrome/common/chrome_switches.h" 38 #include "chrome/common/chrome_switches.h"
39 #include "chrome/common/chrome_version_info.h" 39 #include "chrome/common/chrome_version_info.h"
40 #import "chrome/common/mac/app_mode_common.h" 40 #import "chrome/common/mac/app_mode_common.h"
41 #include "components/crx_file/id_util.h"
41 #include "content/public/browser/browser_thread.h" 42 #include "content/public/browser/browser_thread.h"
42 #include "extensions/browser/extension_registry.h" 43 #include "extensions/browser/extension_registry.h"
43 #include "extensions/common/extension.h" 44 #include "extensions/common/extension.h"
44 #include "grit/chrome_unscaled_resources.h" 45 #include "grit/chrome_unscaled_resources.h"
45 #include "grit/generated_resources.h" 46 #include "grit/generated_resources.h"
46 #import "skia/ext/skia_utils_mac.h" 47 #import "skia/ext/skia_utils_mac.h"
47 #include "third_party/skia/include/core/SkBitmap.h" 48 #include "third_party/skia/include/core/SkBitmap.h"
48 #include "third_party/skia/include/core/SkColor.h" 49 #include "third_party/skia/include/core/SkColor.h"
49 #include "ui/base/l10n/l10n_util.h" 50 #include "ui/base/l10n/l10n_util.h"
50 #import "ui/base/l10n/l10n_util_mac.h" 51 #import "ui/base/l10n/l10n_util_mac.h"
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 const std::string& profile_base_name) { 441 const std::string& profile_base_name) {
441 if (!StartsWithASCII(base_name.value(), profile_base_name, true)) 442 if (!StartsWithASCII(base_name.value(), profile_base_name, true))
442 return false; 443 return false;
443 444
444 if (base_name.Extension() != ".app") 445 if (base_name.Extension() != ".app")
445 return false; 446 return false;
446 447
447 std::string app_id = base_name.RemoveExtension().value(); 448 std::string app_id = base_name.RemoveExtension().value();
448 // Strip (profile_base_name + " ") from the start. 449 // Strip (profile_base_name + " ") from the start.
449 app_id = app_id.substr(profile_base_name.size() + 1); 450 app_id = app_id.substr(profile_base_name.size() + 1);
450 return extensions::Extension::IdIsValid(app_id); 451 return crx_file::id_util::IdIsValid(app_id);
451 } 452 }
452 453
453 std::vector<base::FilePath> GetAllAppBundlesInPath( 454 std::vector<base::FilePath> GetAllAppBundlesInPath(
454 const base::FilePath& internal_shortcut_path, 455 const base::FilePath& internal_shortcut_path,
455 const std::string& profile_base_name) { 456 const std::string& profile_base_name) {
456 std::vector<base::FilePath> bundle_paths; 457 std::vector<base::FilePath> bundle_paths;
457 458
458 base::FileEnumerator enumerator(internal_shortcut_path, 459 base::FileEnumerator enumerator(internal_shortcut_path,
459 true /* recursive */, 460 true /* recursive */,
460 base::FileEnumerator::DIRECTORIES); 461 base::FileEnumerator::DIRECTORIES);
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after
1102 web_app::GetShortcutInfoForApp( 1103 web_app::GetShortcutInfoForApp(
1103 app, 1104 app,
1104 profile, 1105 profile,
1105 base::Bind(&web_app::CreateAppShortcutInfoLoaded, 1106 base::Bind(&web_app::CreateAppShortcutInfoLoaded,
1106 profile, 1107 profile,
1107 app, 1108 app,
1108 close_callback)); 1109 close_callback));
1109 } 1110 }
1110 1111
1111 } // namespace chrome 1112 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/extensions/chromeos/kiosk_apps_handler.cc ('k') | chrome/common/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698