summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authorcira@chromium.org <cira@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-06 01:06:49 +0000
committercira@chromium.org <cira@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-06 01:06:49 +0000
commitd4da3c5996842171e70a909b63129f7f4c5cf819 (patch)
treea8a80cf2a96e29705dcecb6ec96319a18d2e8358 /chrome/common
parentf68a27df5495fc0850ced470cc8954b4c493ee26 (diff)
downloadchromium_src-d4da3c5996842171e70a909b63129f7f4c5cf819.zip
chromium_src-d4da3c5996842171e70a909b63129f7f4c5cf819.tar.gz
chromium_src-d4da3c5996842171e70a909b63129f7f4c5cf819.tar.bz2
Localize CSS files in content scripts (but don't localize JS files).
Add UserScriptSlave unittest. BUG=39899 TEST=List css file in content_scripts section of the manifest. Refer to an image using url(chrome-extension://__MSG_@@extension_id_/image.png); within that css. @@extension_id message should be replaced with actual id of the extension. Review URL: http://codereview.chromium.org/1585013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43684 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/extensions/user_script.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/chrome/common/extensions/user_script.h b/chrome/common/extensions/user_script.h
index ed84009..de5ff76 100644
--- a/chrome/common/extensions/user_script.h
+++ b/chrome/common/extensions/user_script.h
@@ -1,4 +1,4 @@
-// Copyright 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -62,13 +62,13 @@ class UserScript {
// If external_content_ is set returns it as content otherwise it returns
// content_
const base::StringPiece GetContent() const {
- if (external_content_.data())
+ if (!external_content_.empty())
return external_content_;
else
return content_;
}
void set_external_content(const base::StringPiece& content) {
- external_content_ = content;
+ external_content_.assign(content.begin(), content.end());
}
void set_content(const base::StringPiece& content) {
content_.assign(content.begin(), content.end());
@@ -90,7 +90,7 @@ class UserScript {
// The script content. It can be set to either loaded_content_ or
// externally allocated string.
- base::StringPiece external_content_;
+ std::string external_content_;
// Set when the content is loaded by LoadContent
std::string content_;