diff options
author | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-12 05:54:34 +0000 |
---|---|---|
committer | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-12 05:54:34 +0000 |
commit | e2194749382acb33e16f9cb312feea67ab8a61f5 (patch) | |
tree | b7f3ab1cf6dece5b8b47993ac5f2e2a1961f5986 /chrome/browser/views | |
parent | 0c71e930267d4542ea1b05636773927a79f5bab4 (diff) | |
download | chromium_src-e2194749382acb33e16f9cb312feea67ab8a61f5.zip chromium_src-e2194749382acb33e16f9cb312feea67ab8a61f5.tar.gz chromium_src-e2194749382acb33e16f9cb312feea67ab8a61f5.tar.bz2 |
Remove wchar_t* methods from prefs.
BUG=23581
TEST=builds and passes tests
Review URL: http://codereview.chromium.org/3136004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55848 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views')
-rw-r--r-- | chrome/browser/views/chrome_views_delegate.cc | 39 | ||||
-rw-r--r-- | chrome/browser/views/options/languages_page_view.cc | 8 | ||||
-rw-r--r-- | chrome/browser/views/task_manager_view.cc | 9 |
3 files changed, 30 insertions, 26 deletions
diff --git a/chrome/browser/views/chrome_views_delegate.cc b/chrome/browser/views/chrome_views_delegate.cc index de824db..d56748e 100644 --- a/chrome/browser/views/chrome_views_delegate.cc +++ b/chrome/browser/views/chrome_views_delegate.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. @@ -6,6 +6,7 @@ #include "app/clipboard/clipboard.h" #include "base/scoped_ptr.h" +#include "base/utf_string_conversions.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/pref_service.h" #include "chrome/browser/views/accessibility_event_router_views.h" @@ -31,21 +32,21 @@ void ChromeViewsDelegate::SaveWindowPlacement(const std::wstring& window_name, DictionaryValue* window_preferences = g_browser_process->local_state()->GetMutableDictionary( - window_name.c_str()); - window_preferences->SetInteger(L"left", bounds.x()); - window_preferences->SetInteger(L"top", bounds.y()); - window_preferences->SetInteger(L"right", bounds.right()); - window_preferences->SetInteger(L"bottom", bounds.bottom()); - window_preferences->SetBoolean(L"maximized", maximized); + WideToUTF8(window_name).c_str()); + window_preferences->SetInteger("left", bounds.x()); + window_preferences->SetInteger("top", bounds.y()); + window_preferences->SetInteger("right", bounds.right()); + window_preferences->SetInteger("bottom", bounds.bottom()); + window_preferences->SetBoolean("maximized", maximized); scoped_ptr<WindowSizer::MonitorInfoProvider> monitor_info_provider( WindowSizer::CreateDefaultMonitorInfoProvider()); gfx::Rect work_area( monitor_info_provider->GetMonitorWorkAreaMatching(bounds)); - window_preferences->SetInteger(L"work_area_left", work_area.x()); - window_preferences->SetInteger(L"work_area_top", work_area.y()); - window_preferences->SetInteger(L"work_area_right", work_area.right()); - window_preferences->SetInteger(L"work_area_bottom", work_area.bottom()); + window_preferences->SetInteger("work_area_left", work_area.x()); + window_preferences->SetInteger("work_area_top", work_area.y()); + window_preferences->SetInteger("work_area_right", work_area.right()); + window_preferences->SetInteger("work_area_bottom", work_area.bottom()); } bool ChromeViewsDelegate::GetSavedWindowBounds(const std::wstring& window_name, @@ -54,12 +55,13 @@ bool ChromeViewsDelegate::GetSavedWindowBounds(const std::wstring& window_name, return false; const DictionaryValue* dictionary = - g_browser_process->local_state()->GetDictionary(window_name.c_str()); + g_browser_process->local_state()->GetDictionary( + WideToUTF8(window_name).c_str()); int left, top, right, bottom; - if (!dictionary || !dictionary->GetInteger(L"left", &left) || - !dictionary->GetInteger(L"top", &top) || - !dictionary->GetInteger(L"right", &right) || - !dictionary->GetInteger(L"bottom", &bottom)) + if (!dictionary || !dictionary->GetInteger("left", &left) || + !dictionary->GetInteger("top", &top) || + !dictionary->GetInteger("right", &right) || + !dictionary->GetInteger("bottom", &bottom)) return false; bounds->SetRect(left, top, right - left, bottom - top); @@ -73,8 +75,9 @@ bool ChromeViewsDelegate::GetSavedMaximizedState( return false; const DictionaryValue* dictionary = - g_browser_process->local_state()->GetDictionary(window_name.c_str()); - return dictionary && dictionary->GetBoolean(L"maximized", maximized) && + g_browser_process->local_state()->GetDictionary( + WideToUTF8(window_name).c_str()); + return dictionary && dictionary->GetBoolean("maximized", maximized) && maximized; } diff --git a/chrome/browser/views/options/languages_page_view.cc b/chrome/browser/views/options/languages_page_view.cc index 8a2df06..68db592 100644 --- a/chrome/browser/views/options/languages_page_view.cc +++ b/chrome/browser/views/options/languages_page_view.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. @@ -405,7 +405,7 @@ void LanguagesPageView::NotifyPrefChanged(const std::string* pref_name) { } if (!pref_name || *pref_name == prefs::kApplicationLocale) { int index = ui_language_model_->GetSelectedLanguageIndex( - UTF8ToWide(prefs::kApplicationLocale)); + prefs::kApplicationLocale); if (-1 == index) { // The pref value for locale isn't valid. Use the current app locale // (which is what we're currently using). @@ -418,7 +418,7 @@ void LanguagesPageView::NotifyPrefChanged(const std::string* pref_name) { } if (!pref_name || *pref_name == prefs::kSpellCheckDictionary) { int index = dictionary_language_model_->GetSelectedLanguageIndex( - UTF8ToWide(prefs::kSpellCheckDictionary)); + prefs::kSpellCheckDictionary); // If the index for the current language cannot be found, it is due to // the fact that the pref-member value for the last dictionary language @@ -435,7 +435,7 @@ void LanguagesPageView::NotifyPrefChanged(const std::string* pref_name) { dictionary_language_.SetValue( SpellCheckCommon::GetLanguageFromLanguageRegion(lang_region)); index = dictionary_language_model_->GetSelectedLanguageIndex( - UTF8ToWide(prefs::kSpellCheckDictionary)); + prefs::kSpellCheckDictionary); } change_dictionary_language_combobox_->SetSelectedItem(index); diff --git a/chrome/browser/views/task_manager_view.cc b/chrome/browser/views/task_manager_view.cc index b83c42b..59142c3 100644 --- a/chrome/browser/views/task_manager_view.cc +++ b/chrome/browser/views/task_manager_view.cc @@ -540,8 +540,8 @@ bool TaskManagerView::ExecuteWindowsCommand(int command_id) { if (g_browser_process->local_state()) { DictionaryValue* window_preferences = g_browser_process->local_state()->GetMutableDictionary( - GetWindowName().c_str()); - window_preferences->SetBoolean(L"always_on_top", is_always_on_top_); + WideToUTF8(GetWindowName()).c_str()); + window_preferences->SetBoolean("always_on_top", is_always_on_top_); } return true; } @@ -673,9 +673,10 @@ bool TaskManagerView::GetSavedAlwaysOnTopState(bool* always_on_top) const { return false; const DictionaryValue* dictionary = - g_browser_process->local_state()->GetDictionary(GetWindowName().c_str()); + g_browser_process->local_state()->GetDictionary( + WideToUTF8(GetWindowName()).c_str()); return dictionary && - dictionary->GetBoolean(L"always_on_top", always_on_top) && always_on_top; + dictionary->GetBoolean("always_on_top", always_on_top) && always_on_top; } } // namespace |