summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authorcira@google.com <cira@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-07 00:23:06 +0000
committercira@google.com <cira@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-07 00:23:06 +0000
commitee9080648d4f6ecceab3f0c1ba7048474893ce44 (patch)
treea7be46563123556b658e397a4492d5563aba4b61 /chrome/common
parent887eaa29c92cb8125c7cbc492dc564cf67d37899 (diff)
downloadchromium_src-ee9080648d4f6ecceab3f0c1ba7048474893ce44.zip
chromium_src-ee9080648d4f6ecceab3f0c1ba7048474893ce44.tar.gz
chromium_src-ee9080648d4f6ecceab3f0c1ba7048474893ce44.tar.bz2
Revert 43684 - 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(chromeextension://__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 TBR=cira@chromium.org Review URL: http://codereview.chromium.org/1525014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43784 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 de5ff76..ed84009 100644
--- a/chrome/common/extensions/user_script.h
+++ b/chrome/common/extensions/user_script.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright 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_.empty())
+ if (external_content_.data())
return external_content_;
else
return content_;
}
void set_external_content(const base::StringPiece& content) {
- external_content_.assign(content.begin(), content.end());
+ external_content_ = content;
}
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.
- std::string external_content_;
+ base::StringPiece external_content_;
// Set when the content is loaded by LoadContent
std::string content_;