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

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

Issue 102843002: Move RemoveChars, ReplaceChars, TrimString, and TruncateUTF8ToByteSize to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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
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 "apps/app_shim/app_shim_mac.h" 10 #include "apps/app_shim/app_shim_mac.h"
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after
697 return base::FilePath(); 697 return base::FilePath();
698 698
699 base::ScopedCFTypeRef<CFURLRef> url(url_ref); 699 base::ScopedCFTypeRef<CFURLRef> url(url_ref);
700 NSString* path_string = [base::mac::CFToNSCast(url.get()) path]; 700 NSString* path_string = [base::mac::CFToNSCast(url.get()) path];
701 return base::FilePath([path_string fileSystemRepresentation]); 701 return base::FilePath([path_string fileSystemRepresentation]);
702 } 702 }
703 703
704 std::string WebAppShortcutCreator::GetBundleIdentifier() const { 704 std::string WebAppShortcutCreator::GetBundleIdentifier() const {
705 // Replace spaces in the profile path with hyphen. 705 // Replace spaces in the profile path with hyphen.
706 std::string normalized_profile_path; 706 std::string normalized_profile_path;
707 ReplaceChars(info_.profile_path.BaseName().value(), 707 base::ReplaceChars(info_.profile_path.BaseName().value(),
708 " ", "-", &normalized_profile_path); 708 " ", "-", &normalized_profile_path);
709 709
710 // This matches APP_MODE_APP_BUNDLE_ID in chrome/chrome.gyp. 710 // This matches APP_MODE_APP_BUNDLE_ID in chrome/chrome.gyp.
711 std::string bundle_id = 711 std::string bundle_id =
712 base::mac::BaseBundleID() + std::string(".app.") + 712 base::mac::BaseBundleID() + std::string(".app.") +
713 normalized_profile_path + "-" + info_.extension_id; 713 normalized_profile_path + "-" + info_.extension_id;
714 714
715 return bundle_id; 715 return bundle_id;
716 } 716 }
717 717
718 std::string WebAppShortcutCreator::GetInternalBundleIdentifier() const { 718 std::string WebAppShortcutCreator::GetInternalBundleIdentifier() const {
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
783 ShellIntegration::ShortcutInfo shortcut_info = 783 ShellIntegration::ShortcutInfo shortcut_info =
784 BuildShortcutInfoFromBundle(*it); 784 BuildShortcutInfoFromBundle(*it);
785 WebAppShortcutCreator shortcut_creator(it->DirName(), shortcut_info); 785 WebAppShortcutCreator shortcut_creator(it->DirName(), shortcut_info);
786 shortcut_creator.DeleteShortcuts(); 786 shortcut_creator.DeleteShortcuts();
787 } 787 }
788 } 788 }
789 789
790 } // namespace internals 790 } // namespace internals
791 791
792 } // namespace web_app 792 } // namespace web_app
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698