summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authortony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-10 21:08:39 +0000
committertony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-10 21:08:39 +0000
commit8a16266e66a38bc1bfc6b00893c2a7c8cf8c55ee (patch)
tree5c07a9d5091a56c6d5a1a2b98ec10d19ae3c20e9 /chrome/browser
parentf8dce00e633d5ffde45e008fb8f51d5a76942f6b (diff)
downloadchromium_src-8a16266e66a38bc1bfc6b00893c2a7c8cf8c55ee.zip
chromium_src-8a16266e66a38bc1bfc6b00893c2a7c8cf8c55ee.tar.gz
chromium_src-8a16266e66a38bc1bfc6b00893c2a7c8cf8c55ee.tar.bz2
Move StringPiece into the base namespace. It is colliding
with the StringPiece class in icu4.2, which is a problem when trying to use the system version of icu. Review URL: http://codereview.chromium.org/193072 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25920 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/browser_about_handler.cc8
-rw-r--r--chrome/browser/browser_main.cc4
-rw-r--r--chrome/browser/dom_ui/dom_ui_theme_source.cc4
-rw-r--r--chrome/browser/dom_ui/downloads_ui.cc2
-rw-r--r--chrome/browser/dom_ui/history_ui.cc2
-rw-r--r--chrome/browser/dom_ui/new_tab_ui.cc6
-rw-r--r--chrome/browser/dom_ui/print_ui.cc2
-rw-r--r--chrome/browser/extensions/extension_host.cc2
-rw-r--r--chrome/browser/extensions/extensions_ui.cc2
-rw-r--r--chrome/browser/extensions/external_pref_extension_provider.cc3
-rw-r--r--chrome/browser/extensions/user_script_master.cc26
-rw-r--r--chrome/browser/extensions/user_script_master.h4
-rw-r--r--chrome/browser/privacy_blacklist/blocked_response.cc2
-rw-r--r--chrome/browser/ssl/ssl_blocking_page.cc2
-rw-r--r--chrome/browser/ssl/ssl_policy.cc2
-rw-r--r--chrome/browser/views/sync/sync_setup_wizard.cc6
16 files changed, 40 insertions, 37 deletions
diff --git a/chrome/browser/browser_about_handler.cc b/chrome/browser/browser_about_handler.cc
index c7805eb..047ca97 100644
--- a/chrome/browser/browser_about_handler.cc
+++ b/chrome/browser/browser_about_handler.cc
@@ -247,7 +247,7 @@ std::string AboutPlugins() {
localized_strings.SetString(L"enabled_no",
l10n_util::GetString(IDS_ABOUT_PLUGINS_ENABLED_NO));
- static const StringPiece plugins_html(
+ static const base::StringPiece plugins_html(
ResourceBundle::GetSharedInstance().GetRawDataResource(
IDR_ABOUT_PLUGINS_HTML));
@@ -348,7 +348,7 @@ std::string AboutStats() {
}
// Get about_stats.html
- static const StringPiece stats_html(
+ static const base::StringPiece stats_html(
ResourceBundle::GetSharedInstance().GetRawDataResource(
IDR_ABOUT_STATS_HTML));
@@ -514,7 +514,7 @@ std::string AboutSync() {
full_status.max_consecutive_errors);
}
- static const StringPiece sync_html(
+ static const base::StringPiece sync_html(
ResourceBundle::GetSharedInstance().GetRawDataResource(
IDR_ABOUT_SYNC_HTML));
@@ -720,7 +720,7 @@ void AboutMemoryHandler::OnDetailsAvailable() {
}
// Get about_memory.html
- static const StringPiece memory_html(
+ static const base::StringPiece memory_html(
ResourceBundle::GetSharedInstance().GetRawDataResource(
IDR_ABOUT_MEMORY_HTML));
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc
index c2450f7..c15274b 100644
--- a/chrome/browser/browser_main.cc
+++ b/chrome/browser/browser_main.cc
@@ -192,9 +192,9 @@ base::LazyInstance<LazyDirectoryListerCacher> lazy_dir_lister(
base::LINKER_INITIALIZED);
// This is called indirectly by the network layer to access resources.
-StringPiece NetResourceProvider(int key) {
+base::StringPiece NetResourceProvider(int key) {
if (IDR_DIR_HEADER_HTML == key)
- return StringPiece(lazy_dir_lister.Pointer()->html_data);
+ return base::StringPiece(lazy_dir_lister.Pointer()->html_data);
return ResourceBundle::GetSharedInstance().GetRawDataResource(key);
}
diff --git a/chrome/browser/dom_ui/dom_ui_theme_source.cc b/chrome/browser/dom_ui/dom_ui_theme_source.cc
index f2ebbf5..bcdc813 100644
--- a/chrome/browser/dom_ui/dom_ui_theme_source.cc
+++ b/chrome/browser/dom_ui/dom_ui_theme_source.cc
@@ -181,7 +181,7 @@ void DOMUIThemeSource::InitNewTabCSS() {
subst2.push_back(SkColorToRGBAString(color_section_link_underline)); // $$7
// Get our template.
- static const StringPiece new_tab_theme_css(
+ static const base::StringPiece new_tab_theme_css(
ResourceBundle::GetSharedInstance().GetRawDataResource(
IDR_NEW_TAB_THEME_CSS));
@@ -215,7 +215,7 @@ void DOMUIThemeSource::InitNewIncognitoTabCSS() {
subst.push_back(UTF8ToUTF16(GetNewTabBackgroundTilingCSS())); // $5
// Get our template.
- static const StringPiece new_tab_theme_css(
+ static const base::StringPiece new_tab_theme_css(
ResourceBundle::GetSharedInstance().GetRawDataResource(
IDR_NEW_INCOGNITO_TAB_THEME_CSS));
diff --git a/chrome/browser/dom_ui/downloads_ui.cc b/chrome/browser/dom_ui/downloads_ui.cc
index deb5ef1..52a26df 100644
--- a/chrome/browser/dom_ui/downloads_ui.cc
+++ b/chrome/browser/dom_ui/downloads_ui.cc
@@ -99,7 +99,7 @@ void DownloadsUIHTMLSource::StartDataRequest(const std::string& path,
SetFontAndTextDirection(&localized_strings);
- static const StringPiece downloads_html(
+ static const base::StringPiece downloads_html(
ResourceBundle::GetSharedInstance().GetRawDataResource(
IDR_DOWNLOADS_HTML));
const std::string full_html = jstemplate_builder::GetI18nTemplateHtml(
diff --git a/chrome/browser/dom_ui/history_ui.cc b/chrome/browser/dom_ui/history_ui.cc
index c3eb8ad..45a994b 100644
--- a/chrome/browser/dom_ui/history_ui.cc
+++ b/chrome/browser/dom_ui/history_ui.cc
@@ -79,7 +79,7 @@ void HistoryUIHTMLSource::StartDataRequest(const std::string& path,
SetFontAndTextDirection(&localized_strings);
- static const StringPiece history_html(
+ static const base::StringPiece history_html(
ResourceBundle::GetSharedInstance().GetRawDataResource(
IDR_HISTORY_HTML));
const std::string full_html = jstemplate_builder::GetI18nTemplateHtml(
diff --git a/chrome/browser/dom_ui/new_tab_ui.cc b/chrome/browser/dom_ui/new_tab_ui.cc
index 4f5bada..93fc8cb 100644
--- a/chrome/browser/dom_ui/new_tab_ui.cc
+++ b/chrome/browser/dom_ui/new_tab_ui.cc
@@ -421,12 +421,12 @@ void NewTabHTMLSource::InitFullHTML() {
// In case we have the new new tab page enabled we first try to read the file
// provided on the command line. If that fails we just get the resource from
// the resource bundle.
- StringPiece new_tab_html;
+ base::StringPiece new_tab_html;
std::string new_tab_html_str;
new_tab_html_str = GetCustomNewTabPageFromCommandLine();
if (!new_tab_html_str.empty()) {
- new_tab_html = StringPiece(new_tab_html_str);
+ new_tab_html = base::StringPiece(new_tab_html_str);
}
if (new_tab_html.empty()) {
@@ -510,7 +510,7 @@ void IncognitoTabHTMLSource::InitFullHTML() {
SetFontAndTextDirection(&localized_strings);
- static const StringPiece incognito_tab_html(
+ static const base::StringPiece incognito_tab_html(
ResourceBundle::GetSharedInstance().GetRawDataResource(
IDR_INCOGNITO_TAB_HTML));
diff --git a/chrome/browser/dom_ui/print_ui.cc b/chrome/browser/dom_ui/print_ui.cc
index 574abda..56514f9a 100644
--- a/chrome/browser/dom_ui/print_ui.cc
+++ b/chrome/browser/dom_ui/print_ui.cc
@@ -51,7 +51,7 @@ void PrintUIHTMLSource::StartDataRequest(const std::string& path,
SetFontAndTextDirection(&localized_strings);
// Setup the print html page.
- static const StringPiece print_html(
+ static const base::StringPiece print_html(
ResourceBundle::GetSharedInstance().GetRawDataResource(
IDR_PRINT_TAB_HTML));
const std::string full_html = jstemplate_builder::GetI18nTemplateHtml(
diff --git a/chrome/browser/extensions/extension_host.cc b/chrome/browser/extensions/extension_host.cc
index 168e002..39de133 100644
--- a/chrome/browser/extensions/extension_host.cc
+++ b/chrome/browser/extensions/extension_host.cc
@@ -151,7 +151,7 @@ void ExtensionHost::DidNavigate(RenderViewHost* render_view_host,
}
void ExtensionHost::DidStopLoading(RenderViewHost* render_view_host) {
- static const StringPiece toolstrip_css(
+ static const base::StringPiece toolstrip_css(
ResourceBundle::GetSharedInstance().GetRawDataResource(
IDR_EXTENSIONS_TOOLSTRIP_CSS));
#if defined(TOOLKIT_VIEWS)
diff --git a/chrome/browser/extensions/extensions_ui.cc b/chrome/browser/extensions/extensions_ui.cc
index 708b7e6..db10a9a 100644
--- a/chrome/browser/extensions/extensions_ui.cc
+++ b/chrome/browser/extensions/extensions_ui.cc
@@ -48,7 +48,7 @@ void ExtensionsUIHTMLSource::StartDataRequest(const std::string& path,
localized_strings.SetString(L"title",
l10n_util::GetString(IDS_EXTENSIONS_TITLE));
- static const StringPiece extensions_html(
+ static const base::StringPiece extensions_html(
ResourceBundle::GetSharedInstance().GetRawDataResource(
IDR_EXTENSIONS_UI_HTML));
std::string full_html(extensions_html.data(), extensions_html.size());
diff --git a/chrome/browser/extensions/external_pref_extension_provider.cc b/chrome/browser/extensions/external_pref_extension_provider.cc
index 7b371ed..e0f491f 100644
--- a/chrome/browser/extensions/external_pref_extension_provider.cc
+++ b/chrome/browser/extensions/external_pref_extension_provider.cc
@@ -58,7 +58,8 @@ void ExternalPrefExtensionProvider::VisitRegisteredExtension(
continue;
}
- if (external_crx.find(FilePath::kParentDirectory) != StringPiece::npos) {
+ if (external_crx.find(FilePath::kParentDirectory) !=
+ base::StringPiece::npos) {
LOG(WARNING) << "Path traversal not allowed in path: "
<< external_crx.c_str();
continue;
diff --git a/chrome/browser/extensions/user_script_master.cc b/chrome/browser/extensions/user_script_master.cc
index 7fa7832..b4130c8 100644
--- a/chrome/browser/extensions/user_script_master.cc
+++ b/chrome/browser/extensions/user_script_master.cc
@@ -23,8 +23,8 @@
// Helper function to parse greasesmonkey headers
-static bool GetDeclarationValue(const StringPiece& line,
- const StringPiece& prefix,
+static bool GetDeclarationValue(const base::StringPiece& line,
+ const base::StringPiece& prefix,
std::string* value) {
if (!line.starts_with(prefix))
return false;
@@ -42,20 +42,20 @@ UserScriptMaster::ScriptReloader::ScriptReloader(UserScriptMaster* master)
// static
bool UserScriptMaster::ScriptReloader::ParseMetadataHeader(
- const StringPiece& script_text, UserScript* script) {
+ const base::StringPiece& script_text, UserScript* script) {
// http://wiki.greasespot.net/Metadata_block
- StringPiece line;
+ base::StringPiece line;
size_t line_start = 0;
size_t line_end = 0;
bool in_metadata = false;
- static const StringPiece kUserScriptBegin("// ==UserScript==");
- static const StringPiece kUserScriptEng("// ==/UserScript==");
- static const StringPiece kIncludeDeclaration("// @include ");
- static const StringPiece kMatchDeclaration("// @match ");
- static const StringPiece kRunAtDeclaration("// @run-at ");
- static const StringPiece kRunAtDocumentStartValue("document-start");
- static const StringPiece kRunAtDocumentEndValue("document-end");
+ static const base::StringPiece kUserScriptBegin("// ==UserScript==");
+ static const base::StringPiece kUserScriptEng("// ==/UserScript==");
+ static const base::StringPiece kIncludeDeclaration("// @include ");
+ static const base::StringPiece kMatchDeclaration("// @match ");
+ static const base::StringPiece kRunAtDeclaration("// @run-at ");
+ static const base::StringPiece kRunAtDocumentStartValue("document-start");
+ static const base::StringPiece kRunAtDocumentEndValue("document-end");
while (line_start < script_text.length()) {
line_end = script_text.find('\n', line_start);
@@ -204,11 +204,11 @@ static base::SharedMemory* Serialize(const UserScriptList& scripts) {
// Write scripts as 'data' so that we can read it out in the slave without
// allocating a new string.
for (size_t j = 0; j < script.js_scripts().size(); j++) {
- StringPiece contents = script.js_scripts()[j].GetContent();
+ base::StringPiece contents = script.js_scripts()[j].GetContent();
pickle.WriteData(contents.data(), contents.length());
}
for (size_t j = 0; j < script.css_scripts().size(); j++) {
- StringPiece contents = script.css_scripts()[j].GetContent();
+ base::StringPiece contents = script.css_scripts()[j].GetContent();
pickle.WriteData(contents.data(), contents.length());
}
}
diff --git a/chrome/browser/extensions/user_script_master.h b/chrome/browser/extensions/user_script_master.h
index 56aab84..af66879 100644
--- a/chrome/browser/extensions/user_script_master.h
+++ b/chrome/browser/extensions/user_script_master.h
@@ -16,7 +16,9 @@
#include "testing/gtest/include/gtest/gtest_prod.h"
class MessageLoop;
+namespace base {
class StringPiece;
+}
// Manages a segment of shared memory that contains the user scripts the user
// has installed. Lives on the UI thread.
@@ -70,7 +72,7 @@ class UserScriptMaster : public base::RefCounted<UserScriptMaster>,
: public base::RefCounted<UserScriptMaster::ScriptReloader> {
public:
// Parses the includes out of |script| and returns them in |includes|.
- static bool ParseMetadataHeader(const StringPiece& script_text,
+ static bool ParseMetadataHeader(const base::StringPiece& script_text,
UserScript* script);
static void LoadScriptsFromDirectory(const FilePath& script_dir,
diff --git a/chrome/browser/privacy_blacklist/blocked_response.cc b/chrome/browser/privacy_blacklist/blocked_response.cc
index aacb344..228886a 100644
--- a/chrome/browser/privacy_blacklist/blocked_response.cc
+++ b/chrome/browser/privacy_blacklist/blocked_response.cc
@@ -40,7 +40,7 @@ std::string GetHTML(const Blacklist::Match* match) {
strings.SetString(L"name", entry->provider()->name());
strings.SetString(L"url", entry->provider()->url());
- const StringPiece html =
+ const base::StringPiece html =
ResourceBundle::GetSharedInstance().GetRawDataResource(IDR_BLACKLIST_HTML);
return jstemplate_builder::GetI18nTemplateHtml(html, &strings);
}
diff --git a/chrome/browser/ssl/ssl_blocking_page.cc b/chrome/browser/ssl/ssl_blocking_page.cc
index a25fda3..d9fb4e6 100644
--- a/chrome/browser/ssl/ssl_blocking_page.cc
+++ b/chrome/browser/ssl/ssl_blocking_page.cc
@@ -81,7 +81,7 @@ std::string SSLBlockingPage::GetHTMLContents() {
(l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT) ?
L"rtl" : L"ltr");
- static const StringPiece html(
+ static const base::StringPiece html(
ResourceBundle::GetSharedInstance().GetRawDataResource(
IDR_SSL_ROAD_BLOCK_HTML));
diff --git a/chrome/browser/ssl/ssl_policy.cc b/chrome/browser/ssl/ssl_policy.cc
index a5ecfdc..c8a6c7c 100644
--- a/chrome/browser/ssl/ssl_policy.cc
+++ b/chrome/browser/ssl/ssl_policy.cc
@@ -286,7 +286,7 @@ void SSLPolicy::ShowErrorPage(SSLCertErrorHandler* handler) {
(l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT) ?
L"rtl" : L"ltr");
- static const StringPiece html(
+ static const base::StringPiece html(
ResourceBundle::GetSharedInstance().GetRawDataResource(
IDR_SSL_ERROR_HTML));
diff --git a/chrome/browser/views/sync/sync_setup_wizard.cc b/chrome/browser/views/sync/sync_setup_wizard.cc
index 0421e4e..3b187f7 100644
--- a/chrome/browser/views/sync/sync_setup_wizard.cc
+++ b/chrome/browser/views/sync/sync_setup_wizard.cc
@@ -49,15 +49,15 @@ void SyncResourcesSource::StartDataRequest(const std::string& path_raw,
std::string response;
if (path_raw == chrome::kSyncGaiaLoginPath) {
- static const StringPiece html(ResourceBundle::GetSharedInstance()
+ static const base::StringPiece html(ResourceBundle::GetSharedInstance()
.GetRawDataResource(IDR_GAIA_LOGIN_HTML));
response = html.as_string();
} else if (path_raw == chrome::kSyncMergeAndSyncPath) {
- static const StringPiece html(ResourceBundle::GetSharedInstance()
+ static const base::StringPiece html(ResourceBundle::GetSharedInstance()
.GetRawDataResource(IDR_MERGE_AND_SYNC_HTML));
response = html.as_string();
} else if (path_raw == chrome::kSyncSetupFlowPath) {
- static const StringPiece html(ResourceBundle::GetSharedInstance()
+ static const base::StringPiece html(ResourceBundle::GetSharedInstance()
.GetRawDataResource(IDR_SYNC_SETUP_FLOW_HTML));
response = html.as_string();
}