summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-04 19:03:13 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-04 19:03:13 +0000
commit01ed196b68335e6e3e90abc2aed6df3d4b71132b (patch)
tree10fd22167916906d8dd9e9c3114cf9bf8d1aca2b /chrome
parent2ea3ca3156bddfb88b29094f6bb45c0aafa773c3 (diff)
downloadchromium_src-01ed196b68335e6e3e90abc2aed6df3d4b71132b.zip
chromium_src-01ed196b68335e6e3e90abc2aed6df3d4b71132b.tar.gz
chromium_src-01ed196b68335e6e3e90abc2aed6df3d4b71132b.tar.bz2
Extension ids are ASCII.
This is preliminary cleanup for a larger change. Review URL: http://codereview.chromium.org/6613032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76941 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/shell_integration.cc4
-rw-r--r--chrome/browser/shell_integration.h9
-rw-r--r--chrome/browser/shell_integration_linux.cc2
-rw-r--r--chrome/browser/shell_integration_unittest.cc2
-rw-r--r--chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.cc2
-rw-r--r--chrome/browser/ui/views/create_application_shortcut_view.cc2
-rw-r--r--chrome/browser/web_applications/web_app.cc4
7 files changed, 13 insertions, 12 deletions
diff --git a/chrome/browser/shell_integration.cc b/chrome/browser/shell_integration.cc
index a20814b..cb5fde3 100644
--- a/chrome/browser/shell_integration.cc
+++ b/chrome/browser/shell_integration.cc
@@ -25,7 +25,7 @@ ShellIntegration::ShortcutInfo::~ShortcutInfo() {}
std::string ShellIntegration::GetCommandLineArgumentsCommon(
const GURL& url,
- const string16& extension_app_id) {
+ const std::string& extension_app_id) {
const CommandLine cmd = *CommandLine::ForCurrentProcess();
std::wstring arguments_w;
@@ -55,7 +55,7 @@ std::string ShellIntegration::GetCommandLineArgumentsCommon(
// during launch.
if (!extension_app_id.empty()) {
arguments_w += std::wstring(L"--") + ASCIIToWide(switches::kAppId) +
- L"=\"" + ASCIIToWide(UTF16ToASCII(extension_app_id)) + L"\"";
+ L"=\"" + ASCIIToWide(extension_app_id) + L"\"";
} else {
// Use '--app=url' instead of just 'url' to launch the browser with minimal
// chrome.
diff --git a/chrome/browser/shell_integration.h b/chrome/browser/shell_integration.h
index 6caed57..450c11b 100644
--- a/chrome/browser/shell_integration.h
+++ b/chrome/browser/shell_integration.h
@@ -57,7 +57,7 @@ class ShellIntegration {
// If |extension_id| is non-empty, this is short cut is to an extension-app
// and the launch url will be detected at start-up. In this case, |url|
// is still used to generate the app id (windows app id, not chrome app id).
- string16 extension_id;
+ std::string extension_id;
string16 title;
string16 description;
SkBitmap favicon;
@@ -79,8 +79,9 @@ class ShellIntegration {
// NOTE: This function is dangerous, do not use! You cannot treat
// command lines as plain strings as there are metacharacters.
// TODO(evanm): remove it.
- static std::string GetCommandLineArgumentsCommon(const GURL& url,
- const string16& extension_app_id);
+ static std::string GetCommandLineArgumentsCommon(
+ const GURL& url,
+ const std::string& extension_app_id);
#if defined(USE_X11)
// Returns filename of the desktop shortcut used to launch the browser.
@@ -97,7 +98,7 @@ class ShellIntegration {
// used to launch Chrome.
static std::string GetDesktopFileContents(
const std::string& template_contents, const GURL& url,
- const string16& extension_id, const string16& title,
+ const std::string& extension_id, const string16& title,
const std::string& icon_name);
static void CreateDesktopShortcut(const ShortcutInfo& shortcut_info,
diff --git a/chrome/browser/shell_integration_linux.cc b/chrome/browser/shell_integration_linux.cc
index eb88862..5e8a3f3 100644
--- a/chrome/browser/shell_integration_linux.cc
+++ b/chrome/browser/shell_integration_linux.cc
@@ -316,7 +316,7 @@ FilePath ShellIntegration::GetDesktopShortcutFilename(const GURL& url) {
// static
std::string ShellIntegration::GetDesktopFileContents(
const std::string& template_contents, const GURL& url,
- const string16& extension_id, const string16& title,
+ const std::string& extension_id, const string16& title,
const std::string& icon_name) {
// See http://standards.freedesktop.org/desktop-entry-spec/latest/
// Although not required by the spec, Nautilus on Ubuntu Karmic creates its
diff --git a/chrome/browser/shell_integration_unittest.cc b/chrome/browser/shell_integration_unittest.cc
index 240eb6e..9a86b58 100644
--- a/chrome/browser/shell_integration_unittest.cc
+++ b/chrome/browser/shell_integration_unittest.cc
@@ -287,7 +287,7 @@ TEST(ShellIntegrationTest, GetDesktopFileContents) {
ShellIntegration::GetDesktopFileContents(
test_cases[i].template_contents,
GURL(test_cases[i].url),
- EmptyString16(),
+ "",
ASCIIToUTF16(test_cases[i].title),
test_cases[i].icon_name));
}
diff --git a/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.cc b/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.cc
index 090a6aa..e36908d 100644
--- a/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.cc
+++ b/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.cc
@@ -292,7 +292,7 @@ CreateChromeApplicationShortcutsDialogGtk::
ALLOW_THIS_IN_INITIALIZER_LIST(tracker_(this)) {
// Get shortcut information now, it's needed for our UI.
- shortcut_info_.extension_id = UTF8ToUTF16(app_->id());
+ shortcut_info_.extension_id = app_->id();
shortcut_info_.url = GURL(app_->launch_web_url());
shortcut_info_.title = UTF8ToUTF16(app_->name());
shortcut_info_.description = UTF8ToUTF16(app_->description());
diff --git a/chrome/browser/ui/views/create_application_shortcut_view.cc b/chrome/browser/ui/views/create_application_shortcut_view.cc
index 982f74d..ee8a18e9 100644
--- a/chrome/browser/ui/views/create_application_shortcut_view.cc
+++ b/chrome/browser/ui/views/create_application_shortcut_view.cc
@@ -475,7 +475,7 @@ CreateChromeApplicationShortcutView::CreateChromeApplicationShortcutView(
app_(app),
ALLOW_THIS_IN_INITIALIZER_LIST(tracker_(this)) {
- shortcut_info_.extension_id = UTF8ToUTF16(app_->id());
+ shortcut_info_.extension_id = app_->id();
shortcut_info_.url = GURL(app_->launch_web_url());
shortcut_info_.title = UTF8ToUTF16(app_->name());
shortcut_info_.description = UTF8ToUTF16(app_->description());
diff --git a/chrome/browser/web_applications/web_app.cc b/chrome/browser/web_applications/web_app.cc
index 099046ca..2e77928 100644
--- a/chrome/browser/web_applications/web_app.cc
+++ b/chrome/browser/web_applications/web_app.cc
@@ -94,7 +94,7 @@ FilePath GetSanitizedFileName(const string16& name) {
FilePath GetWebAppDir(const ShellIntegration::ShortcutInfo& info) {
if (!info.extension_id.empty()) {
std::string app_name = web_app::GenerateApplicationNameFromExtensionId(
- UTF16ToUTF8(info.extension_id));
+ info.extension_id);
#if defined(OS_WIN)
return FilePath(UTF8ToWide(app_name));
#elif defined(OS_POSIX)
@@ -391,7 +391,7 @@ bool CreateShortcutTask::CreateShortcut() {
std::string app_name;
if (!shortcut_info_.extension_id.empty()) {
app_name = web_app::GenerateApplicationNameFromExtensionId(
- UTF16ToUTF8(shortcut_info_.extension_id));
+ shortcut_info_.extension_id);
} else {
app_name = web_app::GenerateApplicationNameFromURL(
shortcut_info_.url);