summaryrefslogtreecommitdiffstats
path: root/chrome/browser/web_applications/web_app_mac.mm
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/web_applications/web_app_mac.mm')
-rw-r--r--chrome/browser/web_applications/web_app_mac.mm37
1 files changed, 19 insertions, 18 deletions
diff --git a/chrome/browser/web_applications/web_app_mac.mm b/chrome/browser/web_applications/web_app_mac.mm
index be02bc5..3e0e41e 100644
--- a/chrome/browser/web_applications/web_app_mac.mm
+++ b/chrome/browser/web_applications/web_app_mac.mm
@@ -84,7 +84,7 @@ bool AddBitmapImageRepToIconFamily(IconFamily* icon_family,
namespace web_app {
WebAppShortcutCreator::WebAppShortcutCreator(
- const FilePath& user_data_dir,
+ const base::FilePath& user_data_dir,
const ShellIntegration::ShortcutInfo& shortcut_info,
const string16& chrome_bundle_id)
: user_data_dir_(user_data_dir),
@@ -96,12 +96,12 @@ WebAppShortcutCreator::~WebAppShortcutCreator() {
}
bool WebAppShortcutCreator::CreateShortcut() {
- FilePath app_name = internals::GetSanitizedFileName(info_.title);
- FilePath app_file_name = app_name.ReplaceExtension("app");
+ base::FilePath app_name = internals::GetSanitizedFileName(info_.title);
+ base::FilePath app_file_name = app_name.ReplaceExtension("app");
base::ScopedTempDir scoped_temp_dir;
if (!scoped_temp_dir.CreateUniqueTempDir())
return false;
- FilePath staging_path = scoped_temp_dir.path().Append(app_file_name);
+ base::FilePath staging_path = scoped_temp_dir.path().Append(app_file_name);
// Update the app's plist and icon in a temp directory. This works around
// a Finder bug where the app's icon doesn't properly update.
@@ -117,7 +117,7 @@ bool WebAppShortcutCreator::CreateShortcut() {
if (!UpdateIcon(staging_path))
return false;
- FilePath dst_path = GetDestinationPath(app_file_name);
+ base::FilePath dst_path = GetDestinationPath(app_file_name);
if (!file_util::CopyDirectory(staging_path, dst_path, true)) {
LOG(ERROR) << "Copying app to dst path: " << dst_path.value() << " failed";
return false;
@@ -130,14 +130,14 @@ bool WebAppShortcutCreator::CreateShortcut() {
return true;
}
-FilePath WebAppShortcutCreator::GetAppLoaderPath() const {
+base::FilePath WebAppShortcutCreator::GetAppLoaderPath() const {
return base::mac::PathForFrameworkBundleResource(
base::mac::NSToCFCast(@"app_mode_loader.app"));
}
-FilePath WebAppShortcutCreator::GetDestinationPath(
- const FilePath& app_file_name) const {
- FilePath path;
+base::FilePath WebAppShortcutCreator::GetDestinationPath(
+ const base::FilePath& app_file_name) const {
+ base::FilePath path;
if (base::mac::GetLocalDirectory(NSApplicationDirectory, &path) &&
file_util::PathIsWritable(path)) {
return path;
@@ -146,10 +146,10 @@ FilePath WebAppShortcutCreator::GetDestinationPath(
if (base::mac::GetUserDirectory(NSApplicationDirectory, &path))
return path;
- return FilePath();
+ return base::FilePath();
}
-bool WebAppShortcutCreator::UpdatePlist(const FilePath& app_path) const {
+bool WebAppShortcutCreator::UpdatePlist(const base::FilePath& app_path) const {
NSString* plist_path = base::mac::FilePathToNSString(
app_path.Append("Contents").Append("Info.plist"));
@@ -194,7 +194,7 @@ bool WebAppShortcutCreator::UpdatePlist(const FilePath& app_path) const {
return [plist writeToFile:plist_path atomically:YES];
}
-bool WebAppShortcutCreator::UpdateIcon(const FilePath& app_path) const {
+bool WebAppShortcutCreator::UpdateIcon(const base::FilePath& app_path) const {
if (info_.favicon.IsEmpty())
return true;
@@ -220,10 +220,11 @@ bool WebAppShortcutCreator::UpdateIcon(const FilePath& app_path) const {
if (!image_added)
return false;
- FilePath resources_path = app_path.Append("Contents").Append("Resources");
+ base::FilePath resources_path =
+ app_path.Append("Contents").Append("Resources");
if (!file_util::CreateDirectory(resources_path))
return false;
- FilePath icon_path = resources_path.Append("app.icns");
+ base::FilePath icon_path = resources_path.Append("app.icns");
return [icon_family writeToFile:base::mac::FilePathToNSString(icon_path)];
}
@@ -243,7 +244,7 @@ NSString* WebAppShortcutCreator::GetBundleIdentifier(NSDictionary* plist) const
}
void WebAppShortcutCreator::RevealGeneratedBundleInFinder(
- const FilePath& generated_bundle) const {
+ const base::FilePath& generated_bundle) const {
[[NSWorkspace sharedWorkspace]
selectFile:base::mac::FilePathToNSString(generated_bundle)
inFileViewerRootedAtPath:nil];
@@ -256,7 +257,7 @@ namespace web_app {
namespace internals {
bool CreatePlatformShortcuts(
- const FilePath& web_app_path,
+ const base::FilePath& web_app_path,
const ShellIntegration::ShortcutInfo& shortcut_info) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE));
string16 bundle_id = UTF8ToUTF16(base::mac::BaseBundleID());
@@ -266,14 +267,14 @@ bool CreatePlatformShortcuts(
}
void DeletePlatformShortcuts(
- const FilePath& web_app_path,
+ const base::FilePath& web_app_path,
const ShellIntegration::ShortcutInfo& shortcut_info) {
// TODO(benwells): Implement this when shortcuts / weblings are enabled on
// mac.
}
void UpdatePlatformShortcuts(
- const FilePath& web_app_path,
+ const base::FilePath& web_app_path,
const ShellIntegration::ShortcutInfo& shortcut_info) {
// TODO(benwells): Implement this when shortcuts / weblings are enabled on
// mac.