diff options
-rw-r--r-- | base/values.cc | 12 | ||||
-rw-r--r-- | base/values.h | 8 | ||||
-rw-r--r-- | base/values_unittest.cc | 2 | ||||
-rw-r--r-- | chrome/browser/automation/automation_provider.cc | 311 | ||||
-rw-r--r-- | chrome/browser/automation/automation_provider_observers.cc | 65 | ||||
-rw-r--r-- | chrome/browser/background_contents_service.cc | 6 | ||||
-rw-r--r-- | chrome/browser/bookmarks/bookmark_codec.cc | 4 | ||||
-rw-r--r-- | chrome/browser/dom_ui/dom_ui.cc | 9 | ||||
-rw-r--r-- | chrome/browser/dom_ui/history2_ui.cc | 88 | ||||
-rw-r--r-- | chrome/browser/dom_ui/history_ui.cc | 88 | ||||
-rw-r--r-- | chrome/browser/dom_ui/net_internals_ui.cc | 83 | ||||
-rw-r--r-- | chrome/browser/extensions/extension_history_api.cc | 2 | ||||
-rw-r--r-- | chrome/browser/geolocation/network_location_request.cc | 2 | ||||
-rw-r--r-- | chrome/browser/plugin_updater.cc | 18 | ||||
-rw-r--r-- | chrome/common/plugin_group.cc | 45 | ||||
-rw-r--r-- | chrome/renderer/blocked_plugin.cc | 4 | ||||
-rw-r--r-- | chrome/renderer/localized_error.cc | 32 | ||||
-rw-r--r-- | net/proxy/proxy_resolver_js_bindings.cc | 4 |
18 files changed, 392 insertions, 391 deletions
diff --git a/base/values.cc b/base/values.cc index 8fdd4ea..af801bc 100644 --- a/base/values.cc +++ b/base/values.cc @@ -448,8 +448,8 @@ void DictionaryValue::SetString(const std::string& path, Set(path, CreateStringValue(in_value)); } -void DictionaryValue::SetStringFromUTF16(const std::string& path, - const string16& in_value) { +void DictionaryValue::SetString(const std::string& path, + const string16& in_value) { Set(path, CreateStringValue(in_value)); } @@ -476,15 +476,17 @@ void DictionaryValue::SetString(const std::wstring& path, // TODO(viettrungluu): Deprecated and to be removed: void DictionaryValue::SetString(const std::wstring& path, - const std::wstring& in_value) { + const string16& in_value) { Set(path, CreateStringValue(in_value)); } +#if !defined(WCHAR_T_IS_UTF16) // TODO(viettrungluu): Deprecated and to be removed: -void DictionaryValue::SetStringFromUTF16(const std::wstring& path, - const string16& in_value) { +void DictionaryValue::SetString(const std::wstring& path, + const std::wstring& in_value) { Set(path, CreateStringValue(in_value)); } +#endif void DictionaryValue::SetWithoutPathExpansion(const std::string& key, Value* in_value) { diff --git a/base/values.h b/base/values.h index 57139d8..39683a6 100644 --- a/base/values.h +++ b/base/values.h @@ -253,16 +253,18 @@ class DictionaryValue : public Value { void SetInteger(const std::string& path, int in_value); void SetReal(const std::string& path, double in_value); void SetString(const std::string& path, const std::string& in_value); - void SetStringFromUTF16(const std::string& path, const string16& in_value); + void SetString(const std::string& path, const string16& in_value); /*DEPRECATED*/void SetBoolean(const std::wstring& path, bool in_value); /*DEPRECATED*/void SetInteger(const std::wstring& path, int in_value); /*DEPRECATED*/void SetReal(const std::wstring& path, double in_value); /*DEPRECATED*/void SetString(const std::wstring& path, const std::string& in_value); /*DEPRECATED*/void SetString(const std::wstring& path, + const string16& in_value); +#if !defined(WCHAR_T_IS_UTF16) + /*DEPRECATED*/void SetString(const std::wstring& path, const std::wstring& in_value); - /*DEPRECATED*/void SetStringFromUTF16(const std::wstring& path, - const string16& in_value); +#endif // Like Set(), but without special treatment of '.'. This allows e.g. URLs to // be used as paths. diff --git a/base/values_unittest.cc b/base/values_unittest.cc index 688e42b..d71280d 100644 --- a/base/values_unittest.cc +++ b/base/values_unittest.cc @@ -804,7 +804,7 @@ TEST_F(ValuesTest, Equals) { dv.SetInteger("b", 2); dv.SetReal("c", 2.5); dv.SetString("d1", "string"); - dv.SetStringFromUTF16("d2", ASCIIToUTF16("http://google.com")); + dv.SetString("d2", ASCIIToUTF16("http://google.com")); dv.Set("e", Value::CreateNullValue()); DictionaryValue* copy = static_cast<DictionaryValue*>(dv.DeepCopy()); diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc index 12371bc6..e65d166 100644 --- a/chrome/browser/automation/automation_provider.cc +++ b/chrome/browser/automation/automation_provider.cc @@ -1577,7 +1577,7 @@ void AutomationProvider::AddBookmarkGroup(int handle, DCHECK(parent); if (parent) { const BookmarkNode* child = model->AddGroup(parent, index, - WideToUTF16(title)); + WideToUTF16Hack(title)); DCHECK(child); if (child) *success = true; @@ -1603,7 +1603,7 @@ void AutomationProvider::AddBookmarkURL(int handle, DCHECK(parent); if (parent) { const BookmarkNode* child = model->AddURL(parent, index, - WideToUTF16(title), url); + WideToUTF16Hack(title), url); DCHECK(child); if (child) *success = true; @@ -1652,7 +1652,7 @@ void AutomationProvider::SetBookmarkTitle(int handle, const BookmarkNode* node = model->GetNodeByID(id); DCHECK(node); if (node) { - model->SetTitle(node, WideToUTF16(title)); + model->SetTitle(node, WideToUTF16Hack(title)); *success = true; } } @@ -1716,13 +1716,13 @@ void AutomationProvider::SetWindowDimensions(Browser* browser, IPC::Message* reply_message) { gfx::Rect rect = browser->window()->GetRestoredBounds(); int x, y, width, height; - if (args->GetInteger(L"x", &x)) + if (args->GetInteger("x", &x)) rect.set_x(x); - if (args->GetInteger(L"y", &y)) + if (args->GetInteger("y", &y)) rect.set_y(y); - if (args->GetInteger(L"width", &width)) + if (args->GetInteger("width", &width)) rect.set_width(width); - if (args->GetInteger(L"height", &height)) + if (args->GetInteger("height", &height)) rect.set_height(height); browser->window()->SetBounds(rect); AutomationJSONReply(this, reply_message).SendSuccess(NULL); @@ -1739,11 +1739,13 @@ ListValue* AutomationProvider::GetInfobarsInfo(TabContents* tc) { if (infobar->AsConfirmInfoBarDelegate()) { // Also covers ThemeInstalledInfoBarDelegate and // CrashedExtensionInfoBarDelegate. - infobar_item->SetString(L"type", "confirm_infobar"); + infobar_item->SetString("type", "confirm_infobar"); ConfirmInfoBarDelegate* confirm_infobar = infobar->AsConfirmInfoBarDelegate(); - infobar_item->SetString(L"text", confirm_infobar->GetMessageText()); - infobar_item->SetString(L"link_text", confirm_infobar->GetLinkText()); + infobar_item->SetString("text", + WideToUTF16Hack(confirm_infobar->GetMessageText())); + infobar_item->SetString("link_text", + WideToUTF16Hack(confirm_infobar->GetLinkText())); ListValue* buttons_list = new ListValue; int buttons = confirm_infobar->GetButtons(); if (ConfirmInfoBarDelegate::BUTTON_OK & buttons) { @@ -1758,28 +1760,30 @@ ListValue* AutomationProvider::GetInfobarsInfo(TabContents* tc) { ConfirmInfoBarDelegate::BUTTON_CANCEL)); buttons_list->Append(button_label); } - infobar_item->Set(L"buttons", buttons_list); + infobar_item->Set("buttons", buttons_list); } else if (infobar->AsAlertInfoBarDelegate()) { - infobar_item->SetString(L"type", "alert_infobar"); + infobar_item->SetString("type", "alert_infobar"); AlertInfoBarDelegate* alert_infobar = infobar->AsAlertInfoBarDelegate(); - infobar_item->SetString(L"text", alert_infobar->GetMessageText()); + infobar_item->SetString("text", + WideToUTF16Hack(alert_infobar->GetMessageText())); } else if (infobar->AsLinkInfoBarDelegate()) { - infobar_item->SetString(L"type", "link_infobar"); + infobar_item->SetString("type", "link_infobar"); LinkInfoBarDelegate* link_infobar = infobar->AsLinkInfoBarDelegate(); - infobar_item->SetString(L"link_text", link_infobar->GetLinkText()); + infobar_item->SetString("link_text", + WideToUTF16Hack(link_infobar->GetLinkText())); } else if (infobar->AsTranslateInfoBarDelegate()) { - infobar_item->SetString(L"type", "translate_infobar"); + infobar_item->SetString("type", "translate_infobar"); TranslateInfoBarDelegate* translate_infobar = infobar->AsTranslateInfoBarDelegate(); - infobar_item->SetString(L"original_lang_code", + infobar_item->SetString("original_lang_code", translate_infobar->GetOriginalLanguageCode()); - infobar_item->SetString(L"target_lang_code", + infobar_item->SetString("target_lang_code", translate_infobar->GetTargetLanguageCode()); } else if (infobar->AsExtensionInfoBarDelegate()) { - infobar_item->SetString(L"type", "extension_infobar"); + infobar_item->SetString("type", "extension_infobar"); } else { - infobar_item->SetString(L"type", "unknown_infobar"); + infobar_item->SetString("type", "unknown_infobar"); } infobars->Append(infobar_item); } @@ -1795,8 +1799,8 @@ void AutomationProvider::WaitForInfobarCount(Browser* browser, IPC::Message* reply_message) { int tab_index; int count; - if (!args->GetInteger(L"count", &count) || count < 0 || - !args->GetInteger(L"tab_index", &tab_index) || tab_index < 0) { + if (!args->GetInteger("count", &count) || count < 0 || + !args->GetInteger("tab_index", &tab_index) || tab_index < 0) { AutomationJSONReply(this, reply_message).SendError( "Missing or invalid args: 'count', 'tab_index'."); return; @@ -1819,9 +1823,9 @@ void AutomationProvider::PerformActionOnInfobar(Browser* browser, int tab_index; int infobar_index; std::string action; - if (!args->GetInteger(L"tab_index", &tab_index) || - !args->GetInteger(L"infobar_index", &infobar_index) || - !args->GetString(L"action", &action)) { + if (!args->GetInteger("tab_index", &tab_index) || + !args->GetInteger("infobar_index", &infobar_index) || + !args->GetString("action", &action)) { reply.SendError("Invalid or missing args"); return; } @@ -1884,10 +1888,11 @@ class GetChildProcessHostInfoTask : public Task { } ChildProcessInfo* info = *iter; DictionaryValue* item = new DictionaryValue; - item->SetString(L"name", info->name()); - item->SetString(L"type", - ChildProcessInfo::GetTypeNameInEnglish(info->type())); - item->SetInteger(L"pid", base::GetProcId(info->handle())); + item->SetString("name", WideToUTF16Hack(info->name())); + item->SetString("type", + WideToUTF16Hack(ChildProcessInfo::GetTypeNameInEnglish( + info->type()))); + item->SetInteger("pid", base::GetProcId(info->handle())); child_processes_->Append(item); } event_->Signal(); @@ -1909,16 +1914,16 @@ void AutomationProvider::GetBrowserInfo(Browser* browser, DictionaryValue* args, IPC::Message* reply_message) { DictionaryValue* properties = new DictionaryValue; - properties->SetString(L"ChromeVersion", chrome::kChromeVersion); - properties->SetString(L"BrowserProcessExecutableName", - chrome::kBrowserProcessExecutableName); - properties->SetString(L"HelperProcessExecutableName", - chrome::kHelperProcessExecutableName); - properties->SetString(L"BrowserProcessExecutablePath", - chrome::kBrowserProcessExecutablePath); - properties->SetString(L"HelperProcessExecutablePath", + properties->SetString("ChromeVersion", chrome::kChromeVersion); + properties->SetString("BrowserProcessExecutableName", + WideToUTF16Hack(chrome::kBrowserProcessExecutableName)); + properties->SetString("HelperProcessExecutableName", + WideToUTF16Hack(chrome::kHelperProcessExecutableName)); + properties->SetString("BrowserProcessExecutablePath", + WideToUTF16Hack(chrome::kBrowserProcessExecutablePath)); + properties->SetString("HelperProcessExecutablePath", chrome::kHelperProcessExecutablePath); - properties->SetString(L"command_line_string", + properties->SetString("command_line_string", CommandLine::ForCurrentProcess()->command_line_string()); std::string branding; @@ -1929,12 +1934,12 @@ void AutomationProvider::GetBrowserInfo(Browser* browser, #else branding = "Unknown Branding"; #endif - properties->SetString(L"branding", branding); + properties->SetString("branding", branding); scoped_ptr<DictionaryValue> return_value(new DictionaryValue); - return_value->Set(L"properties", properties); + return_value->Set("properties", properties); - return_value->SetInteger(L"browser_pid", base::GetCurrentProcId()); + return_value->SetInteger("browser_pid", base::GetCurrentProcId()); // Add info about all windows in a list of dictionaries, one dictionary // item per window. ListValue* windows = new ListValue; @@ -1944,17 +1949,17 @@ void AutomationProvider::GetBrowserInfo(Browser* browser, ++it, ++windex) { DictionaryValue* browser_item = new DictionaryValue; browser = *it; - browser_item->SetInteger(L"index", windex); + browser_item->SetInteger("index", windex); // Window properties gfx::Rect rect = browser->window()->GetRestoredBounds(); - browser_item->SetInteger(L"x", rect.x()); - browser_item->SetInteger(L"y", rect.y()); - browser_item->SetInteger(L"width", rect.width()); - browser_item->SetInteger(L"height", rect.height()); - browser_item->SetBoolean(L"fullscreen", + browser_item->SetInteger("x", rect.x()); + browser_item->SetInteger("y", rect.y()); + browser_item->SetInteger("width", rect.width()); + browser_item->SetInteger("height", rect.height()); + browser_item->SetBoolean("fullscreen", browser->window()->IsFullscreen()); - browser_item->SetInteger(L"selected_tab", browser->selected_index()); - browser_item->SetBoolean(L"incognito", + browser_item->SetInteger("selected_tab", browser->selected_index()); + browser_item->SetBoolean("incognito", browser->profile()->IsOffTheRecord()); // For each window, add info about all tabs in a list of dictionaries, // one dictionary item per tab. @@ -1962,20 +1967,20 @@ void AutomationProvider::GetBrowserInfo(Browser* browser, for (int i = 0; i < browser->tab_count(); ++i) { TabContents* tc = browser->GetTabContentsAt(i); DictionaryValue* tab = new DictionaryValue; - tab->SetInteger(L"index", i); - tab->SetString(L"url", tc->GetURL().spec()); - tab->SetInteger(L"renderer_pid", + tab->SetInteger("index", i); + tab->SetString("url", tc->GetURL().spec()); + tab->SetInteger("renderer_pid", base::GetProcId(tc->GetRenderProcessHost()->GetHandle())); - tab->Set(L"infobars", GetInfobarsInfo(tc)); + tab->Set("infobars", GetInfobarsInfo(tc)); tabs->Append(tab); } - browser_item->Set(L"tabs", tabs); + browser_item->Set("tabs", tabs); windows->Append(browser_item); } - return_value->Set(L"windows", windows); + return_value->Set("windows", windows); - return_value->SetString(L"child_process_path", + return_value->SetString("child_process_path", ChildProcessHost::GetChildPath(true).value()); // Child processes are the processes for plugins and other workers. // Add all child processes in a list of dictionaries, one dictionary item @@ -1987,7 +1992,7 @@ void AutomationProvider::GetBrowserInfo(Browser* browser, ChromeThread::IO, FROM_HERE, new GetChildProcessHostInfoTask(&event, child_processes))); event.Wait(); - return_value->Set(L"child_processes", child_processes); + return_value->Set("child_processes", child_processes); // Add all extension processes in a list of dictionaries, one dictionary // item per extension process. @@ -2004,14 +2009,14 @@ void AutomationProvider::GetBrowserInfo(Browser* browser, if (!ex_host->IsRenderViewLive()) continue; DictionaryValue* item = new DictionaryValue; - item->SetString(L"name", ex_host->extension()->name()); + item->SetString("name", ex_host->extension()->name()); item->SetInteger( - L"pid", + "pid", base::GetProcId(ex_host->render_process_host()->GetHandle())); extension_processes->Append(item); } } - return_value->Set(L"extension_processes", extension_processes); + return_value->Set("extension_processes", extension_processes); AutomationJSONReply(this, reply_message).SendSuccess(return_value.get()); } @@ -2050,7 +2055,7 @@ void AutomationProvider::AddHistoryItem(Browser* browser, DictionaryValue* args, IPC::Message* reply_message) { DictionaryValue* item = NULL; - args->GetDictionary(L"item", &item); + args->GetDictionary("item", &item); string16 url_text; string16 title; base::Time time = base::Time::Now(); @@ -2064,9 +2069,9 @@ void AutomationProvider::AddHistoryItem(Browser* browser, item->GetString("title", &title); // Don't care if it fails. int it; double dt; - if (item->GetInteger(L"time", &it)) + if (item->GetInteger("time", &it)) time = base::Time::FromTimeT(it); - else if (item->GetReal(L"time", &dt)) + else if (item->GetReal("time", &dt)) time = base::Time::FromDoubleT(dt); // Ideas for "dummy" values (e.g. id_scope) came from @@ -2118,25 +2123,25 @@ void AutomationProvider::GetDownloadsInfo(Browser* browser, it != downloads.end(); it++) { // Fill info about each download item. DictionaryValue* dl_item_value = new DictionaryValue; - dl_item_value->SetInteger(L"id", static_cast<int>((*it)->id())); - dl_item_value->SetString(L"url", (*it)->url().spec()); - dl_item_value->SetString(L"referrer_url", (*it)->referrer_url().spec()); - dl_item_value->SetString(L"file_name", (*it)->GetFileName().value()); - dl_item_value->SetString(L"full_path", (*it)->full_path().value()); - dl_item_value->SetBoolean(L"is_paused", (*it)->is_paused()); - dl_item_value->SetBoolean(L"open_when_complete", + dl_item_value->SetInteger("id", static_cast<int>((*it)->id())); + dl_item_value->SetString("url", (*it)->url().spec()); + dl_item_value->SetString("referrer_url", (*it)->referrer_url().spec()); + dl_item_value->SetString("file_name", (*it)->GetFileName().value()); + dl_item_value->SetString("full_path", (*it)->full_path().value()); + dl_item_value->SetBoolean("is_paused", (*it)->is_paused()); + dl_item_value->SetBoolean("open_when_complete", (*it)->open_when_complete()); - dl_item_value->SetBoolean(L"is_extension_install", + dl_item_value->SetBoolean("is_extension_install", (*it)->is_extension_install()); - dl_item_value->SetBoolean(L"is_temporary", (*it)->is_temporary()); - dl_item_value->SetBoolean(L"is_otr", (*it)->is_otr()); // off-the-record - dl_item_value->SetString(L"state", state_to_string[(*it)->state()]); - dl_item_value->SetString(L"safety_state", + dl_item_value->SetBoolean("is_temporary", (*it)->is_temporary()); + dl_item_value->SetBoolean("is_otr", (*it)->is_otr()); // off-the-record + dl_item_value->SetString("state", state_to_string[(*it)->state()]); + dl_item_value->SetString("safety_state", safety_state_to_string[(*it)->safety_state()]); - dl_item_value->SetInteger(L"PercentComplete", (*it)->PercentComplete()); + dl_item_value->SetInteger("PercentComplete", (*it)->PercentComplete()); list_of_downloads->Append(dl_item_value); } - return_value->Set(L"downloads", list_of_downloads); + return_value->Set("downloads", list_of_downloads); reply.SendSuccess(return_value.get()); // All value objects allocated above are owned by |return_value| @@ -2186,7 +2191,7 @@ void AutomationProvider::GetPrefsInfo(Browser* browser, items->Set((*it)->name(), (*it)->GetValue()->DeepCopy()); } scoped_ptr<DictionaryValue> return_value(new DictionaryValue); - return_value->Set(L"prefs", items); // return_value owns items. + return_value->Set("prefs", items); // return_value owns items. AutomationJSONReply(this, reply_message).SendSuccess(return_value.get()); } @@ -2197,7 +2202,7 @@ void AutomationProvider::SetPrefs(Browser* browser, std::wstring path; Value* val; AutomationJSONReply reply(this, reply_message); - if (args->GetString(L"path", &path) && args->Get(L"value", &val)) { + if (args->GetString(L"path", &path) && args->Get("value", &val)) { PrefService* pref_service = profile_->GetPrefs(); const PrefService::Preference* pref = pref_service->FindPreference(path.c_str()); @@ -2236,22 +2241,22 @@ void AutomationProvider::GetOmniboxInfo(Browser* browser, i != result.end(); ++i) { const AutocompleteMatch& match = *i; DictionaryValue* item = new DictionaryValue; // owned by return_value - item->SetString(L"type", AutocompleteMatch::TypeToString(match.type)); - item->SetBoolean(L"starred", match.starred); - item->SetString(L"destination_url", match.destination_url.spec()); - item->SetString(L"contents", match.contents); - item->SetString(L"description", match.description); + item->SetString("type", AutocompleteMatch::TypeToString(match.type)); + item->SetBoolean("starred", match.starred); + item->SetString("destination_url", match.destination_url.spec()); + item->SetString("contents", WideToUTF16Hack(match.contents)); + item->SetString("description", WideToUTF16Hack(match.description)); matches->Append(item); } - return_value->Set(L"matches", matches); + return_value->Set("matches", matches); // Fill up other properties. DictionaryValue* properties = new DictionaryValue; // owned by return_value - properties->SetBoolean(L"has_focus", model->has_focus()); - properties->SetBoolean(L"query_in_progress", model->query_in_progress()); - properties->SetString(L"keyword", model->keyword()); - properties->SetString(L"text", edit_view->GetText()); - return_value->Set(L"properties", properties); + properties->SetBoolean("has_focus", model->has_focus()); + properties->SetBoolean("query_in_progress", model->query_in_progress()); + properties->SetString("keyword", WideToUTF16Hack(model->keyword())); + properties->SetString("text", WideToUTF16Hack(edit_view->GetText())); + return_value->Set("properties", properties); AutomationJSONReply(this, reply_message).SendSuccess(return_value.get()); } @@ -2285,7 +2290,7 @@ void AutomationProvider::OmniboxMovePopupSelection( IPC::Message* reply_message) { int count; AutomationJSONReply reply(this, reply_message); - if (!args->GetInteger(L"count", &count)) { + if (!args->GetInteger("count", &count)) { reply.SendError("count missing"); return; } @@ -2337,11 +2342,11 @@ void AutomationProvider::GetPluginsInfo(Browser* browser, it != plugins.end(); ++it) { DictionaryValue* item = new DictionaryValue; - item->SetStringFromUTF16(L"name", it->name); - item->SetString(L"path", it->path.value()); - item->SetStringFromUTF16(L"version", it->version); - item->SetStringFromUTF16(L"desc", it->desc); - item->SetBoolean(L"enabled", it->enabled); + item->SetString("name", it->name); + item->SetString("path", it->path.value()); + item->SetString("version", it->version); + item->SetString("desc", it->desc); + item->SetBoolean("enabled", it->enabled); // Add info about mime types. ListValue* mime_types = new ListValue(); for (std::vector<WebPluginMimeType>::const_iterator type_it = @@ -2349,8 +2354,8 @@ void AutomationProvider::GetPluginsInfo(Browser* browser, type_it != it->mime_types.end(); ++type_it) { DictionaryValue* mime_type = new DictionaryValue(); - mime_type->SetString(L"mimeType", type_it->mime_type); - mime_type->SetStringFromUTF16(L"description", type_it->description); + mime_type->SetString("mimeType", type_it->mime_type); + mime_type->SetString("description", type_it->description); ListValue* file_extensions = new ListValue(); for (std::vector<std::string>::const_iterator ext_it = @@ -2359,15 +2364,15 @@ void AutomationProvider::GetPluginsInfo(Browser* browser, ++ext_it) { file_extensions->Append(new StringValue(*ext_it)); } - mime_type->Set(L"fileExtensions", file_extensions); + mime_type->Set("fileExtensions", file_extensions); mime_types->Append(mime_type); } - item->Set(L"mimeTypes", mime_types); + item->Set("mimeTypes", mime_types); items->Append(item); } scoped_ptr<DictionaryValue> return_value(new DictionaryValue); - return_value->Set(L"plugins", items); // return_value owns items. + return_value->Set("plugins", items); // return_value owns items. AutomationJSONReply(this, reply_message).SendSuccess(return_value.get()); } @@ -2380,7 +2385,7 @@ void AutomationProvider::EnablePlugin(Browser* browser, IPC::Message* reply_message) { FilePath::StringType path; AutomationJSONReply reply(this, reply_message); - if (!args->GetString(L"path", &path)) { + if (!args->GetString("path", &path)) { reply.SendError("path not specified."); return; } else if (!NPAPI::PluginList::Singleton()->EnablePlugin(FilePath(path))) { @@ -2399,7 +2404,7 @@ void AutomationProvider::DisablePlugin(Browser* browser, IPC::Message* reply_message) { FilePath::StringType path; AutomationJSONReply reply(this, reply_message); - if (!args->GetString(L"path", &path)) { + if (!args->GetString("path", &path)) { reply.SendError("path not specified."); return; } else if (!NPAPI::PluginList::Singleton()->DisablePlugin(FilePath(path))) { @@ -2424,8 +2429,8 @@ void AutomationProvider::SaveTabContents(Browser* browser, FilePath::StringType parent_directory; TabContents* tab_contents = NULL; - if (!args->GetInteger(L"tab_index", &tab_index) || - !args->GetString(L"filename", &filename)) { + if (!args->GetInteger("tab_index", &tab_index) || + !args->GetString("filename", &filename)) { AutomationJSONReply(this, reply_message).SendError( "tab_index or filename param missing"); return; @@ -2473,8 +2478,8 @@ void AutomationProvider::ImportSettings(Browser* browser, bool first_run; if (!args->GetString(L"import_from", &browser_name) || - !args->GetBoolean(L"first_run", &first_run) || - !args->GetList(L"import_items", &import_items_list)) { + !args->GetBoolean("first_run", &first_run) || + !args->GetList("import_items", &import_items_list)) { AutomationJSONReply(this, reply_message).SendError( "Incorrect type for one or more of the arguments."); return; @@ -2530,9 +2535,9 @@ webkit_glue::PasswordForm GetPasswordFormFromDict( base::Time time = base::Time::Now(); int it; double dt; - if (password_dict.GetInteger(L"time", &it)) + if (password_dict.GetInteger("time", &it)) time = base::Time::FromTimeT(it); - else if (password_dict.GetReal(L"time", &dt)) + else if (password_dict.GetReal("time", &dt)) time = base::Time::FromDoubleT(dt); std::string signon_realm; @@ -2549,15 +2554,15 @@ webkit_glue::PasswordForm GetPasswordFormFromDict( // We don't care if any of these fail - they are either optional or checked // before this function is called. - password_dict.GetString(L"signon_realm", &signon_realm); - password_dict.GetStringAsUTF16(L"username_value", &username_value); - password_dict.GetStringAsUTF16(L"password_value", &password_value); - password_dict.GetStringAsUTF16(L"origin_url", &origin_url_text); - password_dict.GetStringAsUTF16(L"username_element", &username_element); - password_dict.GetStringAsUTF16(L"password_element", &password_element); - password_dict.GetStringAsUTF16(L"submit_element", &submit_element); - password_dict.GetStringAsUTF16(L"action_target", &action_target_text); - password_dict.GetBoolean(L"blacklist", &blacklist); + password_dict.GetString("signon_realm", &signon_realm); + password_dict.GetStringAsUTF16("username_value", &username_value); + password_dict.GetStringAsUTF16("password_value", &password_value); + password_dict.GetStringAsUTF16("origin_url", &origin_url_text); + password_dict.GetStringAsUTF16("username_element", &username_element); + password_dict.GetStringAsUTF16("password_element", &password_element); + password_dict.GetStringAsUTF16("submit_element", &submit_element); + password_dict.GetStringAsUTF16("action_target", &action_target_text); + password_dict.GetBoolean("blacklist", &blacklist); GURL origin_gurl(origin_url_text); GURL action_target(action_target_text); @@ -2588,14 +2593,14 @@ void AutomationProvider::AddSavedPassword(Browser* browser, AutomationJSONReply reply(this, reply_message); DictionaryValue* password_dict = NULL; - if (!args->GetDictionary(L"password", &password_dict)) { + if (!args->GetDictionary("password", &password_dict)) { reply.SendError("Password must be a dictionary."); return; } // The signon realm is effectively the primary key and must be included. // Check here before calling GetPasswordFormFromDict. - if (!password_dict->HasKey(L"signon_realm")) { + if (!password_dict->HasKey("signon_realm")) { reply.SendError("Password must include signon_realm."); return; } @@ -2613,9 +2618,9 @@ void AutomationProvider::AddSavedPassword(Browser* browser, // It will be null if it's accessed in an incognito window. if (password_store != NULL) { password_store->AddLogin(new_password); - return_value->SetBoolean(L"password_added", true); + return_value->SetBoolean("password_added", true); } else { - return_value->SetBoolean(L"password_added", false); + return_value->SetBoolean("password_added", false); } reply.SendSuccess(return_value.get()); @@ -2630,14 +2635,14 @@ void AutomationProvider::RemoveSavedPassword(Browser* browser, AutomationJSONReply reply(this, reply_message); DictionaryValue* password_dict = NULL; - if (!args->GetDictionary(L"password", &password_dict)) { + if (!args->GetDictionary("password", &password_dict)) { reply.SendError("Password must be a dictionary."); return; } // The signon realm is effectively the primary key and must be included. // Check here before calling GetPasswordFormFromDict. - if (!password_dict->HasKey(L"signon_realm")) { + if (!password_dict->HasKey("signon_realm")) { reply.SendError("Password must include signon_realm."); return; } @@ -2691,8 +2696,8 @@ void AutomationProvider::ClearBrowsingData(Browser* browser, std::string time_period; ListValue* to_remove; - if (!args->GetString(L"time_period", &time_period) || - !args->GetList(L"to_remove", &to_remove)) { + if (!args->GetString("time_period", &time_period) || + !args->GetList("to_remove", &to_remove)) { AutomationJSONReply(this, reply_message).SendError( "time_period must be a string and to_remove a list."); return; @@ -2735,7 +2740,7 @@ namespace { const DictionaryValue* args, std::string* error_message) { int tab_index; - if (!args->GetInteger(L"tab_index", &tab_index)) { + if (!args->GetInteger("tab_index", &tab_index)) { *error_message = "Must include tab_index."; return NULL; } @@ -2815,7 +2820,7 @@ void AutomationProvider::SelectTranslateOption(Browser* browser, return; } - if (!args->GetString(L"option", &option)) { + if (!args->GetString("option", &option)) { AutomationJSONReply(this, reply_message).SendError("Must include option"); return; } @@ -2878,10 +2883,10 @@ void AutomationProvider::WaitUntilTranslateComplete( GetTranslateInfoBarDelegate(tab_contents); scoped_ptr<DictionaryValue> return_value(new DictionaryValue); if (!translate_bar) { - return_value->SetBoolean(L"translation_success", false); + return_value->SetBoolean("translation_success", false); } else { return_value->SetBoolean( - L"translation_success", + "translation_success", translate_bar->type() == TranslateInfoBarDelegate::AFTER_TRANSLATE); } reply.SendSuccess(return_value.get()); @@ -2895,10 +2900,10 @@ void AutomationProvider::GetThemeInfo(Browser* browser, scoped_ptr<DictionaryValue> return_value(new DictionaryValue); Extension* theme = browser->profile()->GetTheme(); if (theme) { - return_value->SetString(L"name", theme->name()); - return_value->Set(L"images", theme->GetThemeImages()->DeepCopy()); - return_value->Set(L"colors", theme->GetThemeColors()->DeepCopy()); - return_value->Set(L"tints", theme->GetThemeTints()->DeepCopy()); + return_value->SetString("name", theme->name()); + return_value->Set("images", theme->GetThemeImages()->DeepCopy()); + return_value->Set("colors", theme->GetThemeColors()->DeepCopy()); + return_value->Set("tints", theme->GetThemeTints()->DeepCopy()); } AutomationJSONReply(this, reply_message).SendSuccess(return_value.get()); } @@ -2921,18 +2926,18 @@ void AutomationProvider::GetExtensionsInfo(Browser* browser, it != extensions->end(); ++it) { const Extension* extension = *it; DictionaryValue* extension_value = new DictionaryValue; - extension_value->SetString(L"id", extension->id()); - extension_value->SetString(L"version", extension->VersionString()); - extension_value->SetString(L"name", extension->name()); - extension_value->SetString(L"public_key", extension->public_key()); - extension_value->SetString(L"description", extension->description()); - extension_value->SetString(L"background_url", + extension_value->SetString("id", extension->id()); + extension_value->SetString("version", extension->VersionString()); + extension_value->SetString("name", extension->name()); + extension_value->SetString("public_key", extension->public_key()); + extension_value->SetString("description", extension->description()); + extension_value->SetString("background_url", extension->background_url().spec()); - extension_value->SetString(L"options_url", + extension_value->SetString("options_url", extension->options_url().spec()); extensions_values->Append(extension_value); } - return_value->Set(L"extensions", extensions_values); + return_value->Set("extensions", extensions_values); reply.SendSuccess(return_value.get()); } @@ -2944,7 +2949,7 @@ void AutomationProvider::UninstallExtensionById(Browser* browser, IPC::Message* reply_message) { AutomationJSONReply reply(this, reply_message); std::string id; - if (!args->GetString(L"id", &id)) { + if (!args->GetString("id", &id)) { reply.SendError("Must include string id."); return; } @@ -2967,7 +2972,7 @@ void AutomationProvider::GetAutoFillProfile(Browser* browser, IPC::Message* reply_message) { // Get the AutoFillProfiles currently in the database. int tab_index = 0; - args->GetInteger(L"tab_index", &tab_index); + args->GetInteger("tab_index", &tab_index); TabContents* tab_contents = browser->GetTabContentsAt(tab_index); AutomationJSONReply reply(this, reply_message); @@ -2983,8 +2988,8 @@ void AutomationProvider::GetAutoFillProfile(Browser* browser, scoped_ptr<DictionaryValue> return_value(new DictionaryValue); - return_value->Set(L"profiles", profiles); - return_value->Set(L"credit_cards", cards); + return_value->Set("profiles", profiles); + return_value->Set("credit_cards", cards); reply.SendSuccess(return_value.get()); } else { reply.SendError("No PersonalDataManager."); @@ -3005,8 +3010,8 @@ void AutomationProvider::FillAutoFillProfile(Browser* browser, AutomationJSONReply reply(this, reply_message); ListValue* profiles = NULL; ListValue* cards = NULL; - args->GetList(L"profiles", &profiles); - args->GetList(L"credit_cards", &cards); + args->GetList("profiles", &profiles); + args->GetList("credit_cards", &cards); std::string error_mesg; std::vector<AutoFillProfile> autofill_profiles; @@ -3026,7 +3031,7 @@ void AutomationProvider::FillAutoFillProfile(Browser* browser, // Save the AutoFillProfiles. int tab_index = 0; - args->GetInteger(L"tab_index", &tab_index); + args->GetInteger("tab_index", &tab_index); TabContents* tab_contents = browser->GetTabContentsAt(tab_index); if (tab_contents) { @@ -3059,14 +3064,14 @@ ListValue* AutomationProvider::GetListFromAutoFillProfiles( it != autofill_profiles.end(); ++it) { AutoFillProfile* profile = *it; DictionaryValue* profile_info = new DictionaryValue; - profile_info->SetStringFromUTF16(L"label", profile->Label()); + profile_info->SetString("label", profile->Label()); // For each of the types, if it has a value, add it to the dictionary. for (std::map<AutoFillFieldType, std::wstring>::iterator type_it = autofill_type_to_string.begin(); type_it != autofill_type_to_string.end(); ++type_it) { string16 value = profile->GetFieldText(AutoFillType(type_it->first)); if (value.length()) { // If there was something stored for that value. - profile_info->SetStringFromUTF16(type_it->second, value); + profile_info->SetString(type_it->second, value); } } profiles->Append(profile_info); @@ -3087,7 +3092,7 @@ ListValue* AutomationProvider::GetListFromCreditCards( it != credit_cards.end(); ++it) { CreditCard* card = *it; DictionaryValue* card_info = new DictionaryValue; - card_info->SetStringFromUTF16(L"label", card->Label()); + card_info->SetString("label", card->Label()); // For each of the types, if it has a value, add it to the dictionary. for (std::map<AutoFillFieldType, std::wstring>::iterator type_it = credit_card_type_to_string.begin(); @@ -3095,7 +3100,7 @@ ListValue* AutomationProvider::GetListFromCreditCards( string16 value = card->GetFieldText(AutoFillType(type_it->first)); // If there was something stored for that value. if (value.length()) { - card_info->SetStringFromUTF16(type_it->second, value); + card_info->SetString(type_it->second, value); } } cards->Append(card_info); diff --git a/chrome/browser/automation/automation_provider_observers.cc b/chrome/browser/automation/automation_provider_observers.cc index a6a6b2a..fa45172 100644 --- a/chrome/browser/automation/automation_provider_observers.cc +++ b/chrome/browser/automation/automation_provider_observers.cc @@ -100,17 +100,17 @@ DictionaryValue* InitialLoadObserver::GetTimingInformation() const { DictionaryValue* item = new DictionaryValue; base::TimeDelta delta_start = it->second.start_time() - init_time_; - item->SetReal(L"load_start_ms", delta_start.InMillisecondsF()); + item->SetReal("load_start_ms", delta_start.InMillisecondsF()); if (it->second.stop_time().is_null()) { - item->Set(L"load_stop_ms", Value::CreateNullValue()); + item->Set("load_stop_ms", Value::CreateNullValue()); } else { base::TimeDelta delta_stop = it->second.stop_time() - init_time_; - item->SetReal(L"load_stop_ms", delta_stop.InMillisecondsF()); + item->SetReal("load_stop_ms", delta_stop.InMillisecondsF()); } items->Append(item); } DictionaryValue* return_value = new DictionaryValue; - return_value->Set(L"tabs", items); + return_value->Set("tabs", items); return return_value; } @@ -950,7 +950,7 @@ void PageTranslatedObserver::Observe(NotificationType type, Details<PageTranslatedDetails>(details).ptr(); scoped_ptr<DictionaryValue> return_value(new DictionaryValue); return_value->SetBoolean( - L"translation_success", + "translation_success", translated_details->error_type == TranslateErrors::NONE); reply.SendSuccess(return_value.get()); delete this; @@ -973,15 +973,15 @@ void TabLanguageDeterminedObserver::Observe( DCHECK(type == NotificationType::TAB_LANGUAGE_DETERMINED); scoped_ptr<DictionaryValue> return_value(new DictionaryValue); - return_value->SetBoolean(L"page_translated", + return_value->SetBoolean("page_translated", tab_contents_->language_state().IsPageTranslated()); return_value->SetBoolean( - L"can_translate_page", TranslatePrefs::CanTranslate( + "can_translate_page", TranslatePrefs::CanTranslate( automation_->profile()->GetPrefs(), tab_contents_->language_state().original_language(), tab_contents_->GetURL())); return_value->SetString( - L"original_language", + "original_language", tab_contents_->language_state().original_language()); if (translate_bar_) { DictionaryValue* bar_info = new DictionaryValue; @@ -995,12 +995,12 @@ void TabLanguageDeterminedObserver::Observe( type_to_string[TranslateInfoBarDelegate::TRANSLATION_ERROR] = "TRANSLATION_ERROR"; - bar_info->SetString(L"bar_state", type_to_string[translate_bar_->type()]); - bar_info->SetString(L"target_lang_code", + bar_info->SetString("bar_state", type_to_string[translate_bar_->type()]); + bar_info->SetString("target_lang_code", translate_bar_->GetTargetLanguageCode()); - bar_info->SetString(L"original_lang_code", + bar_info->SetString("original_lang_code", translate_bar_->GetOriginalLanguageCode()); - return_value->Set(L"translate_bar", bar_info); + return_value->Set("translate_bar", bar_info); } AutomationJSONReply(automation_, reply_message_) .SendSuccess(return_value.get()); @@ -1069,18 +1069,18 @@ void AutomationProviderHistoryObserver::HistoryQueryComplete( for (size_t i = 0; i < results->size(); ++i) { DictionaryValue* page_value = new DictionaryValue; history::URLResult const &page = (*results)[i]; - page_value->SetStringFromUTF16(L"title", page.title()); - page_value->SetString(L"url", page.url().spec()); - page_value->SetReal(L"time", + page_value->SetString("title", page.title()); + page_value->SetString("url", page.url().spec()); + page_value->SetReal("time", static_cast<double>(page.visit_time().ToDoubleT())); - page_value->SetStringFromUTF16(L"snippet", page.snippet().text()); + page_value->SetString("snippet", page.snippet().text()); page_value->SetBoolean( - L"starred", + "starred", provider_->profile()->GetBookmarkModel()->IsBookmarked(page.url())); history_list->Append(page_value); } - return_value->Set(L"history", history_list); + return_value->Set("history", history_list); // Return history info. AutomationJSONReply reply(provider_, reply_message_); reply.SendSuccess(return_value.get()); @@ -1102,27 +1102,24 @@ void AutomationProviderGetPasswordsObserver::OnPasswordStoreRequestDone( result.begin(); it != result.end(); ++it) { DictionaryValue* password_val = new DictionaryValue; webkit_glue::PasswordForm* password_form = *it; - password_val->SetStringFromUTF16(L"username_value", - password_form->username_value); - password_val->SetStringFromUTF16(L"password_value", - password_form->password_value); - password_val->SetString(L"signon_realm", password_form->signon_realm); + password_val->SetString("username_value", password_form->username_value); + password_val->SetString("password_value", password_form->password_value); + password_val->SetString("signon_realm", password_form->signon_realm); password_val->SetReal( - L"time", static_cast<double>( - password_form->date_created.ToDoubleT())); - password_val->SetString(L"origin_url", password_form->origin.spec()); - password_val->SetStringFromUTF16(L"username_element", - password_form->username_element); - password_val->SetStringFromUTF16(L"password_element", - password_form->password_element); - password_val->SetStringFromUTF16(L"submit_element", + "time", static_cast<double>(password_form->date_created.ToDoubleT())); + password_val->SetString("origin_url", password_form->origin.spec()); + password_val->SetString("username_element", + password_form->username_element); + password_val->SetString("password_element", + password_form->password_element); + password_val->SetString("submit_element", password_form->submit_element); - password_val->SetString(L"action_target", password_form->action.spec()); - password_val->SetBoolean(L"blacklist", password_form->blacklisted_by_user); + password_val->SetString("action_target", password_form->action.spec()); + password_val->SetBoolean("blacklist", password_form->blacklisted_by_user); passwords->Append(password_val); } - return_value->Set(L"passwords", passwords); + return_value->Set("passwords", passwords); AutomationJSONReply(provider_, reply_message_).SendSuccess( return_value.get()); delete this; diff --git a/chrome/browser/background_contents_service.cc b/chrome/browser/background_contents_service.cc index 3c0e003..927d169 100644 --- a/chrome/browser/background_contents_service.cc +++ b/chrome/browser/background_contents_service.cc @@ -34,8 +34,8 @@ // <appid_2>: { "url": <url2>, "name": <frame_name> }, // ... etc ... // } -const wchar_t kUrlKey[] = L"url"; -const wchar_t kFrameNameKey[] = L"name"; +const char kUrlKey[] = "url"; +const char kFrameNameKey[] = "name"; BackgroundContentsService::BackgroundContentsService( Profile* profile, const CommandLine* command_line) @@ -220,7 +220,7 @@ void BackgroundContentsService::RegisterBackgroundContents( // No entry for this application yet, so add one. DictionaryValue* dict = new DictionaryValue(); dict->SetString(kUrlKey, background_contents->GetURL().spec()); - dict->SetStringFromUTF16(kFrameNameKey, contents_map_[appid].frame_name); + dict->SetString(kFrameNameKey, contents_map_[appid].frame_name); pref->SetWithoutPathExpansion(UTF16ToWide(appid), dict); prefs_->ScheduleSavePersistentPrefs(); } diff --git a/chrome/browser/bookmarks/bookmark_codec.cc b/chrome/browser/bookmarks/bookmark_codec.cc index 35ed181..ad5c239 100644 --- a/chrome/browser/bookmarks/bookmark_codec.cc +++ b/chrome/browser/bookmarks/bookmark_codec.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 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. @@ -88,7 +88,7 @@ Value* BookmarkCodec::EncodeNode(const BookmarkNode* node) { std::string id = base::Int64ToString(node->id()); value->SetString(kIdKey, id); const string16& title = node->GetTitleAsString16(); - value->SetStringFromUTF16(kNameKey, title); + value->SetString(kNameKey, title); value->SetString(kDateAddedKey, base::Int64ToString(node->date_added().ToInternalValue())); if (node->type() == BookmarkNode::URL) { diff --git a/chrome/browser/dom_ui/dom_ui.cc b/chrome/browser/dom_ui/dom_ui.cc index 82dcb4b..f3000f3 100644 --- a/chrome/browser/dom_ui/dom_ui.cc +++ b/chrome/browser/dom_ui/dom_ui.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 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. @@ -117,13 +117,12 @@ DOMMessageHandler* DOMMessageHandler::Attach(DOMUI* dom_ui) { void DOMMessageHandler::SetURLAndTitle(DictionaryValue* dictionary, string16 title, const GURL& gurl) { - string16 url16 = UTF8ToUTF16(gurl.spec()); - dictionary->SetStringFromUTF16(L"url", url16); + dictionary->SetString("url", gurl.spec()); bool using_url_as_the_title = false; if (title.empty()) { using_url_as_the_title = true; - title = url16; + title = UTF8ToUTF16(gurl.spec()); } // Since the title can contain BiDi text, we need to mark the text as either @@ -140,7 +139,7 @@ void DOMMessageHandler::SetURLAndTitle(DictionaryValue* dictionary, DCHECK(success ? (title != title_to_set) : (title == title_to_set)); } } - dictionary->SetStringFromUTF16(L"title", title_to_set); + dictionary->SetString("title", title_to_set); } bool DOMMessageHandler::ExtractIntegerValue(const Value* value, int* out_int) { diff --git a/chrome/browser/dom_ui/history2_ui.cc b/chrome/browser/dom_ui/history2_ui.cc index 59b1ff3..b06aceb 100644 --- a/chrome/browser/dom_ui/history2_ui.cc +++ b/chrome/browser/dom_ui/history2_ui.cc @@ -54,40 +54,40 @@ void HistoryUIHTMLSource2::StartDataRequest(const std::string& path, bool is_off_the_record, int request_id) { DictionaryValue localized_strings; - localized_strings.SetString(L"loading", - l10n_util::GetString(IDS_HISTORY_LOADING)); - localized_strings.SetString(L"title", - l10n_util::GetString(IDS_HISTORY_TITLE)); - localized_strings.SetString(L"loading", - l10n_util::GetString(IDS_HISTORY_LOADING)); - localized_strings.SetString(L"newest", - l10n_util::GetString(IDS_HISTORY_NEWEST)); - localized_strings.SetString(L"newer", - l10n_util::GetString(IDS_HISTORY_NEWER)); - localized_strings.SetString(L"older", - l10n_util::GetString(IDS_HISTORY_OLDER)); - localized_strings.SetString(L"searchresultsfor", - l10n_util::GetString(IDS_HISTORY_SEARCHRESULTSFOR)); - localized_strings.SetString(L"history", - l10n_util::GetString(IDS_HISTORY_BROWSERESULTS)); - localized_strings.SetString(L"cont", - l10n_util::GetString(IDS_HISTORY_CONTINUED)); - localized_strings.SetString(L"searchbutton", - l10n_util::GetString(IDS_HISTORY_SEARCH_BUTTON)); - localized_strings.SetString(L"noresults", - l10n_util::GetString(IDS_HISTORY_NO_RESULTS)); - localized_strings.SetString(L"noitems", - l10n_util::GetString(IDS_HISTORY_NO_ITEMS)); - localized_strings.SetString(L"edithistory", - l10n_util::GetString(IDS_HISTORY_START_EDITING_HISTORY)); - localized_strings.SetString(L"doneediting", - l10n_util::GetString(IDS_HISTORY_STOP_EDITING_HISTORY)); - localized_strings.SetString(L"removeselected", - l10n_util::GetString(IDS_HISTORY_REMOVE_SELECTED_ITEMS)); - localized_strings.SetString(L"clearallhistory", - l10n_util::GetString(IDS_HISTORY_OPEN_CLEAR_BROWSING_DATA_DIALOG)); - localized_strings.SetString(L"deletewarning", - l10n_util::GetString(IDS_HISTORY_DELETE_PRIOR_VISITS_WARNING)); + localized_strings.SetString("loading", + l10n_util::GetStringUTF16(IDS_HISTORY_LOADING)); + localized_strings.SetString("title", + l10n_util::GetStringUTF16(IDS_HISTORY_TITLE)); + localized_strings.SetString("loading", + l10n_util::GetStringUTF16(IDS_HISTORY_LOADING)); + localized_strings.SetString("newest", + l10n_util::GetStringUTF16(IDS_HISTORY_NEWEST)); + localized_strings.SetString("newer", + l10n_util::GetStringUTF16(IDS_HISTORY_NEWER)); + localized_strings.SetString("older", + l10n_util::GetStringUTF16(IDS_HISTORY_OLDER)); + localized_strings.SetString("searchresultsfor", + l10n_util::GetStringUTF16(IDS_HISTORY_SEARCHRESULTSFOR)); + localized_strings.SetString("history", + l10n_util::GetStringUTF16(IDS_HISTORY_BROWSERESULTS)); + localized_strings.SetString("cont", + l10n_util::GetStringUTF16(IDS_HISTORY_CONTINUED)); + localized_strings.SetString("searchbutton", + l10n_util::GetStringUTF16(IDS_HISTORY_SEARCH_BUTTON)); + localized_strings.SetString("noresults", + l10n_util::GetStringUTF16(IDS_HISTORY_NO_RESULTS)); + localized_strings.SetString("noitems", + l10n_util::GetStringUTF16(IDS_HISTORY_NO_ITEMS)); + localized_strings.SetString("edithistory", + l10n_util::GetStringUTF16(IDS_HISTORY_START_EDITING_HISTORY)); + localized_strings.SetString("doneediting", + l10n_util::GetStringUTF16(IDS_HISTORY_STOP_EDITING_HISTORY)); + localized_strings.SetString("removeselected", + l10n_util::GetStringUTF16(IDS_HISTORY_REMOVE_SELECTED_ITEMS)); + localized_strings.SetString("clearallhistory", + l10n_util::GetStringUTF16(IDS_HISTORY_OPEN_CLEAR_BROWSING_DATA_DIALOG)); + localized_strings.SetString("deletewarning", + l10n_util::GetStringUTF16(IDS_HISTORY_DELETE_PRIOR_VISITS_WARNING)); SetFontAndTextDirection(&localized_strings); @@ -252,7 +252,7 @@ void BrowsingHistoryHandler2::QueryComplete( SetURLAndTitle(page_value, page.title(), page.url()); // Need to pass the time in epoch time (fastest JS conversion). - page_value->SetInteger(L"time", + page_value->SetInteger("time", static_cast<int>(page.visit_time().ToTimeT())); // Until we get some JS i18n infrastructure, we also need to @@ -272,22 +272,22 @@ void BrowsingHistoryHandler2::QueryComplete( IDS_HISTORY_DATE_WITH_RELATIVE_TIME, date_str, base::TimeFormatFriendlyDate(page.visit_time())); } - page_value->SetString(L"dateRelativeDay", date_str); - page_value->SetString(L"dateTimeOfDay", - base::TimeFormatTimeOfDay(page.visit_time())); + page_value->SetString("dateRelativeDay", WideToUTF16Hack(date_str)); + page_value->SetString("dateTimeOfDay", + WideToUTF16Hack(base::TimeFormatTimeOfDay(page.visit_time()))); } else { - page_value->SetString(L"dateShort", - base::TimeFormatShortDate(page.visit_time())); - page_value->SetStringFromUTF16(L"snippet", page.snippet().text()); + page_value->SetString("dateShort", + WideToUTF16Hack(base::TimeFormatShortDate(page.visit_time()))); + page_value->SetString("snippet", page.snippet().text()); } - page_value->SetBoolean(L"starred", + page_value->SetBoolean("starred", dom_ui_->GetProfile()->GetBookmarkModel()->IsBookmarked(page.url())); results_value.Append(page_value); } DictionaryValue info_value; - info_value.SetStringFromUTF16(L"term", search_text_); - info_value.SetBoolean(L"finished", results->reached_beginning()); + info_value.SetString("term", search_text_); + info_value.SetBoolean("finished", results->reached_beginning()); dom_ui_->CallJavascriptFunction(L"historyResult", info_value, results_value); } diff --git a/chrome/browser/dom_ui/history_ui.cc b/chrome/browser/dom_ui/history_ui.cc index 4cf5bf3..bd1ec3c 100644 --- a/chrome/browser/dom_ui/history_ui.cc +++ b/chrome/browser/dom_ui/history_ui.cc @@ -54,40 +54,40 @@ void HistoryUIHTMLSource::StartDataRequest(const std::string& path, bool is_off_the_record, int request_id) { DictionaryValue localized_strings; - localized_strings.SetString(L"loading", - l10n_util::GetString(IDS_HISTORY_LOADING)); - localized_strings.SetString(L"title", - l10n_util::GetString(IDS_HISTORY_TITLE)); - localized_strings.SetString(L"loading", - l10n_util::GetString(IDS_HISTORY_LOADING)); - localized_strings.SetString(L"newest", - l10n_util::GetString(IDS_HISTORY_NEWEST)); - localized_strings.SetString(L"newer", - l10n_util::GetString(IDS_HISTORY_NEWER)); - localized_strings.SetString(L"older", - l10n_util::GetString(IDS_HISTORY_OLDER)); - localized_strings.SetString(L"searchresultsfor", - l10n_util::GetString(IDS_HISTORY_SEARCHRESULTSFOR)); - localized_strings.SetString(L"history", - l10n_util::GetString(IDS_HISTORY_BROWSERESULTS)); - localized_strings.SetString(L"cont", - l10n_util::GetString(IDS_HISTORY_CONTINUED)); - localized_strings.SetString(L"searchbutton", - l10n_util::GetString(IDS_HISTORY_SEARCH_BUTTON)); - localized_strings.SetString(L"noresults", - l10n_util::GetString(IDS_HISTORY_NO_RESULTS)); - localized_strings.SetString(L"noitems", - l10n_util::GetString(IDS_HISTORY_NO_ITEMS)); - localized_strings.SetString(L"edithistory", - l10n_util::GetString(IDS_HISTORY_START_EDITING_HISTORY)); - localized_strings.SetString(L"doneediting", - l10n_util::GetString(IDS_HISTORY_STOP_EDITING_HISTORY)); - localized_strings.SetString(L"removeselected", - l10n_util::GetString(IDS_HISTORY_REMOVE_SELECTED_ITEMS)); - localized_strings.SetString(L"clearallhistory", - l10n_util::GetString(IDS_HISTORY_OPEN_CLEAR_BROWSING_DATA_DIALOG)); - localized_strings.SetString(L"deletewarning", - l10n_util::GetString(IDS_HISTORY_DELETE_PRIOR_VISITS_WARNING)); + localized_strings.SetString("loading", + l10n_util::GetStringUTF16(IDS_HISTORY_LOADING)); + localized_strings.SetString("title", + l10n_util::GetStringUTF16(IDS_HISTORY_TITLE)); + localized_strings.SetString("loading", + l10n_util::GetStringUTF16(IDS_HISTORY_LOADING)); + localized_strings.SetString("newest", + l10n_util::GetStringUTF16(IDS_HISTORY_NEWEST)); + localized_strings.SetString("newer", + l10n_util::GetStringUTF16(IDS_HISTORY_NEWER)); + localized_strings.SetString("older", + l10n_util::GetStringUTF16(IDS_HISTORY_OLDER)); + localized_strings.SetString("searchresultsfor", + l10n_util::GetStringUTF16(IDS_HISTORY_SEARCHRESULTSFOR)); + localized_strings.SetString("history", + l10n_util::GetStringUTF16(IDS_HISTORY_BROWSERESULTS)); + localized_strings.SetString("cont", + l10n_util::GetStringUTF16(IDS_HISTORY_CONTINUED)); + localized_strings.SetString("searchbutton", + l10n_util::GetStringUTF16(IDS_HISTORY_SEARCH_BUTTON)); + localized_strings.SetString("noresults", + l10n_util::GetStringUTF16(IDS_HISTORY_NO_RESULTS)); + localized_strings.SetString("noitems", + l10n_util::GetStringUTF16(IDS_HISTORY_NO_ITEMS)); + localized_strings.SetString("edithistory", + l10n_util::GetStringUTF16(IDS_HISTORY_START_EDITING_HISTORY)); + localized_strings.SetString("doneediting", + l10n_util::GetStringUTF16(IDS_HISTORY_STOP_EDITING_HISTORY)); + localized_strings.SetString("removeselected", + l10n_util::GetStringUTF16(IDS_HISTORY_REMOVE_SELECTED_ITEMS)); + localized_strings.SetString("clearallhistory", + l10n_util::GetStringUTF16(IDS_HISTORY_OPEN_CLEAR_BROWSING_DATA_DIALOG)); + localized_strings.SetString("deletewarning", + l10n_util::GetStringUTF16(IDS_HISTORY_DELETE_PRIOR_VISITS_WARNING)); SetFontAndTextDirection(&localized_strings); @@ -252,7 +252,7 @@ void BrowsingHistoryHandler::QueryComplete( SetURLAndTitle(page_value, page.title(), page.url()); // Need to pass the time in epoch time (fastest JS conversion). - page_value->SetInteger(L"time", + page_value->SetInteger("time", static_cast<int>(page.visit_time().ToTimeT())); // Until we get some JS i18n infrastructure, we also need to @@ -272,22 +272,22 @@ void BrowsingHistoryHandler::QueryComplete( IDS_HISTORY_DATE_WITH_RELATIVE_TIME, date_str, base::TimeFormatFriendlyDate(page.visit_time())); } - page_value->SetString(L"dateRelativeDay", date_str); - page_value->SetString(L"dateTimeOfDay", - base::TimeFormatTimeOfDay(page.visit_time())); + page_value->SetString("dateRelativeDay", WideToUTF16Hack(date_str)); + page_value->SetString("dateTimeOfDay", + WideToUTF16Hack(base::TimeFormatTimeOfDay(page.visit_time()))); } else { - page_value->SetString(L"dateShort", - base::TimeFormatShortDate(page.visit_time())); - page_value->SetStringFromUTF16(L"snippet", page.snippet().text()); + page_value->SetString("dateShort", + WideToUTF16Hack(base::TimeFormatShortDate(page.visit_time()))); + page_value->SetString("snippet", page.snippet().text()); } - page_value->SetBoolean(L"starred", + page_value->SetBoolean("starred", dom_ui_->GetProfile()->GetBookmarkModel()->IsBookmarked(page.url())); results_value.Append(page_value); } DictionaryValue info_value; - info_value.SetStringFromUTF16(L"term", search_text_); - info_value.SetBoolean(L"finished", results->reached_beginning()); + info_value.SetString("term", search_text_); + info_value.SetBoolean("finished", results->reached_beginning()); dom_ui_->CallJavascriptFunction(L"historyResult", info_value, results_value); } diff --git a/chrome/browser/dom_ui/net_internals_ui.cc b/chrome/browser/dom_ui/net_internals_ui.cc index f87532c..ff0af62 100644 --- a/chrome/browser/dom_ui/net_internals_ui.cc +++ b/chrome/browser/dom_ui/net_internals_ui.cc @@ -89,21 +89,21 @@ Value* EntryToDictionaryValue(net::NetLog::EventType type, // Set the entry time. (Note that we send it as a string since integers // might overflow). - entry_dict->SetString(L"time", TickCountToString(time)); + entry_dict->SetString("time", TickCountToString(time)); // Set the entry source. DictionaryValue* source_dict = new DictionaryValue(); - source_dict->SetInteger(L"id", source.id); - source_dict->SetInteger(L"type", static_cast<int>(source.type)); - entry_dict->Set(L"source", source_dict); + source_dict->SetInteger("id", source.id); + source_dict->SetInteger("type", static_cast<int>(source.type)); + entry_dict->Set("source", source_dict); // Set the event info. - entry_dict->SetInteger(L"type", static_cast<int>(type)); - entry_dict->SetInteger(L"phase", static_cast<int>(phase)); + entry_dict->SetInteger("type", static_cast<int>(type)); + entry_dict->SetInteger("phase", static_cast<int>(phase)); // Set the event-specific parameters. if (params) - entry_dict->Set(L"params", params->ToValue()); + entry_dict->Set("params", params->ToValue()); return entry_dict; } @@ -112,16 +112,14 @@ Value* ExperimentToValue(const ConnectionTester::Experiment& experiment) { DictionaryValue* dict = new DictionaryValue(); if (experiment.url.is_valid()) - dict->SetString(L"url", experiment.url.spec()); - - dict->SetStringFromUTF16( - L"proxy_settings_experiment", - ConnectionTester::ProxySettingsExperimentDescription( - experiment.proxy_settings_experiment)); - dict->SetStringFromUTF16( - L"host_resolver_experiment", - ConnectionTester::HostResolverExperimentDescription( - experiment.host_resolver_experiment)); + dict->SetString("url", experiment.url.spec()); + + dict->SetString("proxy_settings_experiment", + ConnectionTester::ProxySettingsExperimentDescription( + experiment.proxy_settings_experiment)); + dict->SetString("host_resolver_experiment", + ConnectionTester::HostResolverExperimentDescription( + experiment.host_resolver_experiment)); return dict; } @@ -496,20 +494,19 @@ void NetInternalsMessageHandler::IOThreadImpl::OnRendererReady( } else { // We have everything we need to send the right values. - dict->SetString(L"version", version_info->file_version()); - dict->SetString(L"cl", version_info->last_change()); - dict->SetStringFromUTF16(L"version_mod", - platform_util::GetVersionStringModifier()); + dict->SetString("version", WideToUTF16Hack(version_info->file_version())); + dict->SetString("cl", WideToUTF16Hack(version_info->last_change())); + dict->SetString("version_mod", platform_util::GetVersionStringModifier()); if (version_info->is_official_build()) { - dict->SetString(L"official", - l10n_util::GetString(IDS_ABOUT_VERSION_OFFICIAL)); + dict->SetString("official", + l10n_util::GetStringUTF16(IDS_ABOUT_VERSION_OFFICIAL)); } else { - dict->SetString(L"official", - l10n_util::GetString(IDS_ABOUT_VERSION_UNOFFICIAL)); + dict->SetString("official", + l10n_util::GetStringUTF16(IDS_ABOUT_VERSION_UNOFFICIAL)); } - dict->SetString(L"command_line", + dict->SetString("command_line", CommandLine::ForCurrentProcess()->command_line_string()); } @@ -548,9 +545,9 @@ void NetInternalsMessageHandler::IOThreadImpl::OnRendererReady( { DictionaryValue* dict = new DictionaryValue(); - dict->SetInteger(L"PHASE_BEGIN", net::NetLog::PHASE_BEGIN); - dict->SetInteger(L"PHASE_END", net::NetLog::PHASE_END); - dict->SetInteger(L"PHASE_NONE", net::NetLog::PHASE_NONE); + dict->SetInteger("PHASE_BEGIN", net::NetLog::PHASE_BEGIN); + dict->SetInteger("PHASE_END", net::NetLog::PHASE_END); + dict->SetInteger("PHASE_NONE", net::NetLog::PHASE_NONE); CallJavascriptFunction(L"g_browser.receivedLogEventPhaseConstants", dict); } @@ -643,8 +640,8 @@ void NetInternalsMessageHandler::IOThreadImpl::OnGetBadProxies( const net::ProxyRetryInfo& retry_info = it->second; DictionaryValue* dict = new DictionaryValue(); - dict->SetString(L"proxy_uri", proxy_uri); - dict->SetString(L"bad_until", TickCountToString(retry_info.bad_until)); + dict->SetString("proxy_uri", proxy_uri); + dict->SetString("bad_until", TickCountToString(retry_info.bad_until)); list->Append(dict); } @@ -674,12 +671,12 @@ void NetInternalsMessageHandler::IOThreadImpl::OnGetHostResolverCache( DictionaryValue* dict = new DictionaryValue(); - dict->SetInteger(L"capacity", static_cast<int>(cache->max_entries())); + dict->SetInteger("capacity", static_cast<int>(cache->max_entries())); dict->SetInteger( - L"ttl_success_ms", + "ttl_success_ms", static_cast<int>(cache->success_entry_ttl().InMilliseconds())); dict->SetInteger( - L"ttl_failure_ms", + "ttl_failure_ms", static_cast<int>(cache->failure_entry_ttl().InMilliseconds())); ListValue* entry_list = new ListValue(); @@ -693,13 +690,13 @@ void NetInternalsMessageHandler::IOThreadImpl::OnGetHostResolverCache( DictionaryValue* entry_dict = new DictionaryValue(); - entry_dict->SetString(L"hostname", key.hostname); - entry_dict->SetInteger(L"address_family", + entry_dict->SetString("hostname", key.hostname); + entry_dict->SetInteger("address_family", static_cast<int>(key.address_family)); - entry_dict->SetString(L"expiration", TickCountToString(entry->expiration)); + entry_dict->SetString("expiration", TickCountToString(entry->expiration)); if (entry->error != net::OK) { - entry_dict->SetInteger(L"error", entry->error); + entry_dict->SetInteger("error", entry->error); } else { // Append all of the resolved addresses. ListValue* address_list = new ListValue(); @@ -709,13 +706,13 @@ void NetInternalsMessageHandler::IOThreadImpl::OnGetHostResolverCache( net::NetAddressToStringWithPort(current_address))); current_address = current_address->ai_next; } - entry_dict->Set(L"addresses", address_list); + entry_dict->Set("addresses", address_list); } entry_list->Append(entry_dict); } - dict->Set(L"entries", entry_list); + dict->Set("entries", entry_list); CallJavascriptFunction(L"g_browser.receivedHostResolverCache", dict); } @@ -787,7 +784,7 @@ void NetInternalsMessageHandler::IOThreadImpl::OnGetHttpCacheInfo( } } - info_dict->Set(L"stats", stats_dict); + info_dict->Set("stats", stats_dict); CallJavascriptFunction(L"g_browser.receivedHttpCacheInfo", info_dict); } @@ -822,8 +819,8 @@ NetInternalsMessageHandler::IOThreadImpl::OnCompletedConnectionTestExperiment( int result) { DictionaryValue* dict = new DictionaryValue(); - dict->Set(L"experiment", ExperimentToValue(experiment)); - dict->SetInteger(L"result", result); + dict->Set("experiment", ExperimentToValue(experiment)); + dict->SetInteger("result", result); CallJavascriptFunction( L"g_browser.receivedCompletedConnectionTestExperiment", diff --git a/chrome/browser/extensions/extension_history_api.cc b/chrome/browser/extensions/extension_history_api.cc index 0b891c8..6261a4b 100644 --- a/chrome/browser/extensions/extension_history_api.cc +++ b/chrome/browser/extensions/extension_history_api.cc @@ -30,7 +30,7 @@ void GetHistoryItemDictionary(const history::URLRow& row, DictionaryValue* value) { value->SetString(keys::kIdKey, base::Int64ToString(row.id())); value->SetString(keys::kUrlKey, row.url().spec()); - value->SetStringFromUTF16(keys::kTitleKey, row.title()); + value->SetString(keys::kTitleKey, row.title()); value->SetReal(keys::kLastVisitdKey, MilliSecondsFromTime(row.last_visit())); value->SetInteger(keys::kTypedCountKey, row.typed_count()); value->SetInteger(keys::kVisitCountKey, row.visit_count()); diff --git a/chrome/browser/geolocation/network_location_request.cc b/chrome/browser/geolocation/network_location_request.cc index d6a4f33..e6423b0 100644 --- a/chrome/browser/geolocation/network_location_request.cc +++ b/chrome/browser/geolocation/network_location_request.cc @@ -244,7 +244,7 @@ void AddString(const std::wstring& property_name, DictionaryValue* object) { DCHECK(object); if (!value.empty()) { - object->SetStringFromUTF16(property_name, value); + object->SetString(property_name, value); } } diff --git a/chrome/browser/plugin_updater.cc b/chrome/browser/plugin_updater.cc index 1664456..3a794e3 100644 --- a/chrome/browser/plugin_updater.cc +++ b/chrome/browser/plugin_updater.cc @@ -44,10 +44,10 @@ static void GetPluginGroups( static DictionaryValue* CreatePluginFileSummary( const WebPluginInfo& plugin) { DictionaryValue* data = new DictionaryValue(); - data->SetString(L"path", plugin.path.value()); - data->SetStringFromUTF16(L"name", plugin.name); - data->SetStringFromUTF16(L"version", plugin.version); - data->SetBoolean(L"enabled", plugin.enabled); + data->SetString("path", plugin.path.value()); + data->SetString("name", plugin.name); + data->SetString("version", plugin.version); + data->SetBoolean("enabled", plugin.enabled); return data; } @@ -129,12 +129,12 @@ void DisablePluginGroupsFromPrefs(Profile* profile) { DictionaryValue* plugin = static_cast<DictionaryValue*>(*it); string16 group_name; bool enabled = true; - plugin->GetBoolean(L"enabled", &enabled); + plugin->GetBoolean("enabled", &enabled); FilePath::StringType path; // The plugin list constains all the plugin files in addition to the // plugin groups. - if (plugin->GetString(L"path", &path)) { + if (plugin->GetString("path", &path)) { // Files have a path attribute, groups don't. FilePath plugin_path(path); if (update_internal_dir && @@ -144,19 +144,19 @@ void DisablePluginGroupsFromPrefs(Profile* profile) { // looks internal, update its path in the prefs. plugin_path = cur_internal_dir.Append(plugin_path.BaseName()); path = plugin_path.value(); - plugin->SetString(L"path", path); + plugin->SetString("path", path); } if (FilePath::CompareIgnoreCase(path, pdf_path_str) == 0) { found_internal_pdf = true; if (!enabled && force_enable_internal_pdf) { enabled = true; - plugin->SetBoolean(L"enabled", true); + plugin->SetBoolean("enabled", true); } } if (!enabled) NPAPI::PluginList::Singleton()->DisablePlugin(plugin_path); - } else if (!enabled && plugin->GetStringAsUTF16(L"name", &group_name)) { + } else if (!enabled && plugin->GetStringAsUTF16("name", &group_name)) { // Otherwise this is a list of groups. EnablePluginGroup(false, group_name); } diff --git a/chrome/common/plugin_group.cc b/chrome/common/plugin_group.cc index 5df39b3..daa3a12 100644 --- a/chrome/common/plugin_group.cc +++ b/chrome/common/plugin_group.cc @@ -252,25 +252,24 @@ void PluginGroup::AddPlugin(const WebPluginInfo& plugin, int position) { DictionaryValue* PluginGroup::GetSummary() const { DictionaryValue* result = new DictionaryValue(); - result->SetStringFromUTF16(L"name", group_name_); - result->SetBoolean(L"enabled", enabled_); + result->SetString("name", group_name_); + result->SetBoolean("enabled", enabled_); return result; } DictionaryValue* PluginGroup::GetDataForUI() const { DictionaryValue* result = new DictionaryValue(); - result->SetStringFromUTF16(L"name", group_name_); - result->SetStringFromUTF16(L"description", description_); - result->SetString(L"version", max_version_->GetString()); - result->SetString(L"update_url", update_url_); - result->SetBoolean(L"critical", IsVulnerable()); + result->SetString("name", group_name_); + result->SetString("description", description_); + result->SetString("version", max_version_->GetString()); + result->SetString("update_url", update_url_); + result->SetBoolean("critical", IsVulnerable()); bool group_disabled_by_policy = IsPluginNameDisabledByPolicy(group_name_); if (group_disabled_by_policy) { - result->SetString(L"enabledMode", L"disabledByPolicy"); + result->SetString("enabledMode", "disabledByPolicy"); } else { - result->SetString(L"enabledMode", - enabled_ ? L"enabled" : L"disabledByUser"); + result->SetString("enabledMode", enabled_ ? "enabled" : "disabledByUser"); } ListValue* plugin_files = new ListValue(); @@ -278,19 +277,19 @@ DictionaryValue* PluginGroup::GetDataForUI() const { const WebPluginInfo& web_plugin = web_plugin_infos_[i]; int priority = web_plugin_positions_[i]; DictionaryValue* plugin_file = new DictionaryValue(); - plugin_file->SetStringFromUTF16(L"name", web_plugin.name); - plugin_file->SetStringFromUTF16(L"description", web_plugin.desc); - plugin_file->SetString(L"path", web_plugin.path.value()); - plugin_file->SetStringFromUTF16(L"version", web_plugin.version); + plugin_file->SetString("name", web_plugin.name); + plugin_file->SetString("description", web_plugin.desc); + plugin_file->SetString("path", web_plugin.path.value()); + plugin_file->SetString("version", web_plugin.version); bool plugin_disabled_by_policy = group_disabled_by_policy || IsPluginNameDisabledByPolicy(web_plugin.name); if (plugin_disabled_by_policy) { - result->SetString(L"enabledMode", L"disabledByPolicy"); + result->SetString("enabledMode", "disabledByPolicy"); } else { - result->SetString(L"enabledMode", - web_plugin.enabled ? L"enabled" : L"disabledByUser"); + result->SetString("enabledMode", + web_plugin.enabled ? "enabled" : "disabledByUser"); } - plugin_file->SetInteger(L"priority", priority); + plugin_file->SetInteger("priority", priority); ListValue* mime_types = new ListValue(); for (std::vector<WebPluginMimeType>::const_iterator type_it = @@ -298,8 +297,8 @@ DictionaryValue* PluginGroup::GetDataForUI() const { type_it != web_plugin.mime_types.end(); ++type_it) { DictionaryValue* mime_type = new DictionaryValue(); - mime_type->SetString(L"mimeType", type_it->mime_type); - mime_type->SetStringFromUTF16(L"description", type_it->description); + mime_type->SetString("mimeType", type_it->mime_type); + mime_type->SetString("description", type_it->description); ListValue* file_extensions = new ListValue(); for (std::vector<std::string>::const_iterator ext_it = @@ -308,15 +307,15 @@ DictionaryValue* PluginGroup::GetDataForUI() const { ++ext_it) { file_extensions->Append(new StringValue(*ext_it)); } - mime_type->Set(L"fileExtensions", file_extensions); + mime_type->Set("fileExtensions", file_extensions); mime_types->Append(mime_type); } - plugin_file->Set(L"mimeTypes", mime_types); + plugin_file->Set("mimeTypes", mime_types); plugin_files->Append(plugin_file); } - result->Set(L"plugin_files", plugin_files); + result->Set("plugin_files", plugin_files); return result; } diff --git a/chrome/renderer/blocked_plugin.cc b/chrome/renderer/blocked_plugin.cc index a6ef499..906726f7 100644 --- a/chrome/renderer/blocked_plugin.cc +++ b/chrome/renderer/blocked_plugin.cc @@ -49,8 +49,8 @@ BlockedPlugin::BlockedPlugin(RenderView* render_view, << resource_id; DictionaryValue localized_strings; - localized_strings.SetStringFromUTF16("loadPlugin", - l10n_util::GetStringUTF16(IDS_PLUGIN_LOAD)); + localized_strings.SetString("loadPlugin", + l10n_util::GetStringUTF16(IDS_PLUGIN_LOAD)); // "t" is the id of the templates root node. std::string htmlData = jstemplate_builder::GetTemplatesHtml( diff --git a/chrome/renderer/localized_error.cc b/chrome/renderer/localized_error.cc index 4751160..00898e4 100644 --- a/chrome/renderer/localized_error.cc +++ b/chrome/renderer/localized_error.cc @@ -132,9 +132,9 @@ void GetLocalizedErrorValues(const WebURLError& error, error_strings->SetString("textdirection", rtl ? "rtl" : "ltr"); // Grab strings that are applicable to all error pages - error_strings->SetStringFromUTF16("detailsLink", + error_strings->SetString("detailsLink", l10n_util::GetStringUTF16(IDS_ERRORPAGES_DETAILS_LINK)); - error_strings->SetStringFromUTF16("detailsHeading", + error_strings->SetString("detailsHeading", l10n_util::GetStringUTF16(IDS_ERRORPAGES_DETAILS_HEADING)); // Grab the strings and settings that depend on the error type. Init @@ -160,28 +160,28 @@ void GetLocalizedErrorValues(const WebURLError& error, suggestions_heading = l10n_util::GetStringUTF16(IDS_ERRORPAGES_SUGGESTION_HEADING); } - error_strings->SetStringFromUTF16("suggestionsHeading", suggestions_heading); + error_strings->SetString("suggestionsHeading", suggestions_heading); string16 failed_url(ASCIIToUTF16(error.unreachableURL.spec())); // URLs are always LTR. if (rtl) base::i18n::WrapStringWithLTRFormatting(&failed_url); - error_strings->SetStringFromUTF16("title", + error_strings->SetString("title", l10n_util::GetStringFUTF16(options.title_resource_id, failed_url)); - error_strings->SetStringFromUTF16("heading", + error_strings->SetString("heading", l10n_util::GetStringUTF16(options.heading_resource_id)); DictionaryValue* summary = new DictionaryValue; - summary->SetStringFromUTF16("msg", + summary->SetString("msg", l10n_util::GetStringUTF16(options.summary_resource_id)); // TODO(tc): we want the unicode url here since it's being displayed - summary->SetStringFromUTF16("failedUrl", failed_url); + summary->SetString("failedUrl", failed_url); error_strings->Set("summary", summary); // Error codes are expected to be negative DCHECK(error_code < 0); string16 details = l10n_util::GetStringUTF16(options.details_resource_id); - error_strings->SetStringFromUTF16("details", + error_strings->SetString("details", l10n_util::GetStringFUTF16(IDS_ERRORPAGES_DETAILS_TEMPLATE, base::IntToString16(-error_code), ASCIIToUTF16(net::ErrorToString(error_code)), @@ -189,9 +189,9 @@ void GetLocalizedErrorValues(const WebURLError& error, if (options.suggestions & SUGGEST_RELOAD) { DictionaryValue* suggest_reload = new DictionaryValue; - suggest_reload->SetStringFromUTF16("msg", + suggest_reload->SetString("msg", l10n_util::GetStringUTF16(IDS_ERRORPAGES_SUGGESTION_RELOAD)); - suggest_reload->SetStringFromUTF16("reloadUrl", failed_url); + suggest_reload->SetString("reloadUrl", failed_url); error_strings->Set("suggestionsReload", suggest_reload); } @@ -200,13 +200,13 @@ void GetLocalizedErrorValues(const WebURLError& error, const GURL& failed_url = error.unreachableURL; if (std::string() == failed_url.path()) { DictionaryValue* suggest_home_page = new DictionaryValue; - suggest_home_page->SetStringFromUTF16("suggestionsHomepageMsg", + suggest_home_page->SetString("suggestionsHomepageMsg", l10n_util::GetStringUTF16(IDS_ERRORPAGES_SUGGESTION_HOMEPAGE)); string16 homepage(ASCIIToUTF16(failed_url.GetWithEmptyPath().spec())); // URLs are always LTR. if (rtl) base::i18n::WrapStringWithLTRFormatting(&homepage); - suggest_home_page->SetStringFromUTF16("homePage", homepage); + suggest_home_page->SetString("homePage", homepage); // TODO(tc): we actually want the unicode hostname suggest_home_page->SetString("hostName", failed_url.host()); error_strings->Set("suggestionsHomepage", suggest_home_page); @@ -232,7 +232,7 @@ void GetLocalizedErrorValues(const WebURLError& error, learn_more_url = learn_more_url.ReplaceComponents(repl); DictionaryValue* suggest_learn_more = new DictionaryValue; - suggest_learn_more->SetStringFromUTF16("msg", + suggest_learn_more->SetString("msg", l10n_util::GetStringUTF16(IDS_ERRORPAGES_SUGGESTION_LEARNMORE)); suggest_learn_more->SetString("learnMoreUrl", learn_more_url.spec()); error_strings->Set("suggestionsLearnMore", suggest_learn_more); @@ -249,14 +249,14 @@ void GetFormRepostErrorValues(const GURL& display_url, // URLs are always LTR. if (rtl) base::i18n::WrapStringWithLTRFormatting(&failed_url); - error_strings->SetStringFromUTF16( + error_strings->SetString( "title", l10n_util::GetStringFUTF16(IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, failed_url)); - error_strings->SetStringFromUTF16( + error_strings->SetString( "heading", l10n_util::GetStringUTF16(IDS_HTTP_POST_WARNING_TITLE)); error_strings->SetString("suggestionsHeading", ""); DictionaryValue* summary = new DictionaryValue; - summary->SetStringFromUTF16( + summary->SetString( "msg", l10n_util::GetStringUTF16(IDS_ERRORPAGES_HTTP_POST_WARNING)); error_strings->Set("summary", summary); } diff --git a/net/proxy/proxy_resolver_js_bindings.cc b/net/proxy/proxy_resolver_js_bindings.cc index 95ccdb5..dc16925 100644 --- a/net/proxy/proxy_resolver_js_bindings.cc +++ b/net/proxy/proxy_resolver_js_bindings.cc @@ -32,7 +32,7 @@ class ErrorNetlogParams : public NetLog::EventParameters { virtual Value* ToValue() const { DictionaryValue* dict = new DictionaryValue(); dict->SetInteger("line_number", line_number_); - dict->SetStringFromUTF16("message", message_); + dict->SetString("message", message_); return dict; } @@ -51,7 +51,7 @@ class AlertNetlogParams : public NetLog::EventParameters { virtual Value* ToValue() const { DictionaryValue* dict = new DictionaryValue(); - dict->SetStringFromUTF16("message", message_); + dict->SetString("message", message_); return dict; } |