diff options
author | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-11 03:02:51 +0000 |
---|---|---|
committer | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-11 03:02:51 +0000 |
commit | 57ecc4bf4069cb869e5fb0a7d922eec2384bac25 (patch) | |
tree | 1b4668fa59d6b6a072144b4ddab8d5f6faba3fa4 /chrome/test | |
parent | 1af19cfd7b1ef9924516dbe811db495315feaefe (diff) | |
download | chromium_src-57ecc4bf4069cb869e5fb0a7d922eec2384bac25.zip chromium_src-57ecc4bf4069cb869e5fb0a7d922eec2384bac25.tar.gz chromium_src-57ecc4bf4069cb869e5fb0a7d922eec2384bac25.tar.bz2 |
Make prefs use std::string for keys rather than wstrings.
Much remains to be converted.
BUG=23581
TEST=builds and passes tests
Review URL: http://codereview.chromium.org/3076037
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55660 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r-- | chrome/test/automation/automation_messages_internal.h | 8 | ||||
-rw-r--r-- | chrome/test/automation/browser_proxy.cc | 14 | ||||
-rw-r--r-- | chrome/test/automation/browser_proxy.h | 8 | ||||
-rw-r--r-- | chrome/test/testing_pref_service.cc | 18 | ||||
-rw-r--r-- | chrome/test/testing_pref_service.h | 18 |
5 files changed, 33 insertions, 33 deletions
diff --git a/chrome/test/automation/automation_messages_internal.h b/chrome/test/automation/automation_messages_internal.h index 65555c3..8e30bbc 100644 --- a/chrome/test/automation/automation_messages_internal.h +++ b/chrome/test/automation/automation_messages_internal.h @@ -812,7 +812,7 @@ IPC_BEGIN_MESSAGES(Automation) // This messages sets an int-value preference. IPC_SYNC_MESSAGE_ROUTED3_1(AutomationMsg_SetIntPreference, int /* browser handle */, - std::wstring /* pref name */, + std::string /* pref name */, int /* value */, bool /* success */) @@ -831,21 +831,21 @@ IPC_BEGIN_MESSAGES(Automation) // This messages sets a string-value preference. IPC_SYNC_MESSAGE_ROUTED3_1(AutomationMsg_SetStringPreference, int /* browser handle */, - std::wstring /* pref name */, + std::string /* pref name */, std::string /* pref value */, bool) // This messages gets a boolean-value preference. IPC_SYNC_MESSAGE_ROUTED2_2(AutomationMsg_GetBooleanPreference, int /* browser handle */, - std::wstring /* pref name */, + std::string /* pref name */, bool /* success */, bool /* pref value */) // This messages sets a boolean-value preference. IPC_SYNC_MESSAGE_ROUTED3_1(AutomationMsg_SetBooleanPreference, int /* browser handle */, - std::wstring /* pref name */, + std::string /* pref name */, bool /* pref value */, bool /* success */) diff --git a/chrome/test/automation/browser_proxy.cc b/chrome/test/automation/browser_proxy.cc index 41795e6..df3929a 100644 --- a/chrome/test/automation/browser_proxy.cc +++ b/chrome/test/automation/browser_proxy.cc @@ -400,7 +400,7 @@ bool BrowserProxy::SetShelfVisible(bool is_visible) { is_visible)); } -bool BrowserProxy::SetIntPreference(const std::wstring& name, int value) { +bool BrowserProxy::SetIntPreference(const std::string& name, int value) { if (!is_valid()) return false; @@ -411,7 +411,7 @@ bool BrowserProxy::SetIntPreference(const std::wstring& name, int value) { return result; } -bool BrowserProxy::SetStringPreference(const std::wstring& name, +bool BrowserProxy::SetStringPreference(const std::string& name, const std::string& value) { if (!is_valid()) return false; @@ -423,7 +423,7 @@ bool BrowserProxy::SetStringPreference(const std::wstring& name, return result; } -bool BrowserProxy::GetBooleanPreference(const std::wstring& name, +bool BrowserProxy::GetBooleanPreference(const std::string& name, bool* value) { if (!is_valid()) return false; @@ -435,7 +435,7 @@ bool BrowserProxy::GetBooleanPreference(const std::wstring& name, return result; } -bool BrowserProxy::SetBooleanPreference(const std::wstring& name, +bool BrowserProxy::SetBooleanPreference(const std::string& name, bool value) { if (!is_valid()) return false; @@ -620,7 +620,7 @@ bool BrowserProxy::GetInitialLoadTimes(float* min_start_time, DictionaryValue* values_dict = static_cast<DictionaryValue*>(values.get()); Value* tabs_value; - if (!values_dict->Get(L"tabs", &tabs_value) || + if (!values_dict->Get("tabs", &tabs_value) || tabs_value->GetType() != Value::TYPE_LIST) return false; @@ -638,11 +638,11 @@ bool BrowserProxy::GetInitialLoadTimes(float* min_start_time, tab_dict = static_cast<DictionaryValue*>(tab_value); double temp; - if (!tab_dict->GetReal(L"load_start_ms", &temp)) + if (!tab_dict->GetReal("load_start_ms", &temp)) return false; start_ms = static_cast<float>(temp); // load_stop_ms can only be null if WaitForInitialLoads did not run. - if (!tab_dict->GetReal(L"load_stop_ms", &temp)) + if (!tab_dict->GetReal("load_stop_ms", &temp)) return false; stop_ms = static_cast<float>(temp); diff --git a/chrome/test/automation/browser_proxy.h b/chrome/test/automation/browser_proxy.h index 70fd140..7dd2671 100644 --- a/chrome/test/automation/browser_proxy.h +++ b/chrome/test/automation/browser_proxy.h @@ -181,18 +181,18 @@ class BrowserProxy : public AutomationResourceProxy { bool SetShelfVisible(bool is_visible) WARN_UNUSED_RESULT; // Sets the int value of the specified preference. - bool SetIntPreference(const std::wstring& name, int value) WARN_UNUSED_RESULT; + bool SetIntPreference(const std::string& name, int value) WARN_UNUSED_RESULT; // Sets the string value of the specified preference. - bool SetStringPreference(const std::wstring& name, + bool SetStringPreference(const std::string& name, const std::string& value) WARN_UNUSED_RESULT; // Gets the boolean value of the specified preference. - bool GetBooleanPreference(const std::wstring& name, + bool GetBooleanPreference(const std::string& name, bool* value) WARN_UNUSED_RESULT; // Sets the boolean value of the specified preference. - bool SetBooleanPreference(const std::wstring& name, + bool SetBooleanPreference(const std::string& name, bool value) WARN_UNUSED_RESULT; // Sets default content settings. diff --git a/chrome/test/testing_pref_service.cc b/chrome/test/testing_pref_service.cc index 067b8b9..81d04e8 100644 --- a/chrome/test/testing_pref_service.cc +++ b/chrome/test/testing_pref_service.cc @@ -28,45 +28,45 @@ TestingPrefService::TestingPrefService() NULL)) { } -const Value* TestingPrefService::GetManagedPref(const wchar_t* path) { +const Value* TestingPrefService::GetManagedPref(const char* path) { return GetPref(managed_prefs_, path); } -void TestingPrefService::SetManagedPref(const wchar_t* path, Value* value) { +void TestingPrefService::SetManagedPref(const char* path, Value* value) { SetPref(managed_prefs_, path, value); } -void TestingPrefService::RemoveManagedPref(const wchar_t* path) { +void TestingPrefService::RemoveManagedPref(const char* path) { RemovePref(managed_prefs_, path); } -const Value* TestingPrefService::GetUserPref(const wchar_t* path) { +const Value* TestingPrefService::GetUserPref(const char* path) { return GetPref(user_prefs_, path); } -void TestingPrefService::SetUserPref(const wchar_t* path, Value* value) { +void TestingPrefService::SetUserPref(const char* path, Value* value) { SetPref(user_prefs_, path, value); } -void TestingPrefService::RemoveUserPref(const wchar_t* path) { +void TestingPrefService::RemoveUserPref(const char* path) { RemovePref(user_prefs_, path); } const Value* TestingPrefService::GetPref(PrefStore* pref_store, - const wchar_t* path) { + const char* path) { Value* result; return pref_store->prefs()->Get(path, &result) ? result : NULL; } void TestingPrefService::SetPref(PrefStore* pref_store, - const wchar_t* path, + const char* path, Value* value) { pref_store->prefs()->Set(path, value); FireObservers(path); } void TestingPrefService::RemovePref(PrefStore* pref_store, - const wchar_t* path) { + const char* path) { pref_store->prefs()->Remove(path, NULL); FireObservers(path); } diff --git a/chrome/test/testing_pref_service.h b/chrome/test/testing_pref_service.h index d407ad2..b719c91 100644 --- a/chrome/test/testing_pref_service.h +++ b/chrome/test/testing_pref_service.h @@ -30,31 +30,31 @@ class TestingPrefService : public PrefService { // Read the value of a preference from the managed layer. Returns NULL if the // preference is not defined at the managed layer. - const Value* GetManagedPref(const wchar_t* path); + const Value* GetManagedPref(const char* path); // Set a preference on the managed layer and fire observers if the preference // changed. Assumes ownership of |value|. - void SetManagedPref(const wchar_t* path, Value* value); + void SetManagedPref(const char* path, Value* value); // Clear the preference on the managed layer and fire observers if the // preference has been defined previously. - void RemoveManagedPref(const wchar_t* path); + void RemoveManagedPref(const char* path); // Similar to the above, but for user preferences. - const Value* GetUserPref(const wchar_t* path); - void SetUserPref(const wchar_t* path, Value* value); - void RemoveUserPref(const wchar_t* path); + const Value* GetUserPref(const char* path); + void SetUserPref(const char* path, Value* value); + void RemoveUserPref(const char* path); private: // Reads the value of the preference indicated by |path| from |pref_store|. // Returns NULL if the preference was not found. - const Value* GetPref(PrefStore* pref_store, const wchar_t* path); + const Value* GetPref(PrefStore* pref_store, const char* path); // Sets the value for |path| in |pref_store|. - void SetPref(PrefStore* pref_store, const wchar_t* path, Value* value); + void SetPref(PrefStore* pref_store, const char* path, Value* value); // Removes the preference identified by |path| from |pref_store|. - void RemovePref(PrefStore* pref_store, const wchar_t* path); + void RemovePref(PrefStore* pref_store, const char* path); // Pointers to the pref stores our value store uses. PrefStore* managed_prefs_; |