| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/dom_ui/core_options_handler.h" | 5 #include "chrome/browser/dom_ui/core_options_handler.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 } | 37 } |
| 38 | 38 |
| 39 void CoreOptionsHandler::GetLocalizedValues( | 39 void CoreOptionsHandler::GetLocalizedValues( |
| 40 DictionaryValue* localized_strings) { | 40 DictionaryValue* localized_strings) { |
| 41 DCHECK(localized_strings); | 41 DCHECK(localized_strings); |
| 42 // Main | 42 // Main |
| 43 localized_strings->SetString(L"title", | 43 localized_strings->SetString(L"title", |
| 44 l10n_util::GetStringF(IDS_OPTIONS_DIALOG_TITLE, | 44 l10n_util::GetStringF(IDS_OPTIONS_DIALOG_TITLE, |
| 45 l10n_util::GetString(IDS_PRODUCT_NAME))); | 45 l10n_util::GetString(IDS_PRODUCT_NAME))); |
| 46 | 46 |
| 47 localized_strings->SetString(L"browserPage", |
| 48 l10n_util::GetString(IDS_OPTIONS_GENERAL_TAB_LABEL)); |
| 49 localized_strings->SetString(L"personalPage", |
| 50 l10n_util::GetString(IDS_OPTIONS_CONTENT_TAB_LABEL)); |
| 51 localized_strings->SetString(L"advancedPage", |
| 52 l10n_util::GetString(IDS_OPTIONS_ADVANCED_TAB_LABEL)); |
| 47 #if defined(OS_CHROMEOS) | 53 #if defined(OS_CHROMEOS) |
| 48 localized_strings->SetString(L"internetPage", | 54 localized_strings->SetString(L"internetPage", |
| 49 l10n_util::GetString(IDS_OPTIONS_INTERNET_TAB_LABEL)); | 55 l10n_util::GetString(IDS_OPTIONS_INTERNET_TAB_LABEL)); |
| 50 #endif | 56 #endif |
| 51 | |
| 52 localized_strings->SetString(L"basicsPage", | |
| 53 l10n_util::GetString(IDS_OPTIONS_GENERAL_TAB_LABEL)); | |
| 54 localized_strings->SetString(L"personalStuffPage", | |
| 55 l10n_util::GetString(IDS_OPTIONS_CONTENT_TAB_LABEL)); | |
| 56 localized_strings->SetString(L"underHoodPage", | |
| 57 l10n_util::GetString(IDS_OPTIONS_ADVANCED_TAB_LABEL)); | |
| 58 } | 57 } |
| 59 | 58 |
| 60 void CoreOptionsHandler::Observe(NotificationType type, | 59 void CoreOptionsHandler::Observe(NotificationType type, |
| 61 const NotificationSource& source, | 60 const NotificationSource& source, |
| 62 const NotificationDetails& details) { | 61 const NotificationDetails& details) { |
| 63 if (type == NotificationType::PREF_CHANGED) | 62 if (type == NotificationType::PREF_CHANGED) |
| 64 NotifyPrefChanged(Details<std::wstring>(details).ptr()); | 63 NotifyPrefChanged(Details<std::wstring>(details).ptr()); |
| 65 } | 64 } |
| 66 | 65 |
| 67 void CoreOptionsHandler::RegisterMessages() { | 66 void CoreOptionsHandler::RegisterMessages() { |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 pref_callback_map_.find(*pref_name); | 234 pref_callback_map_.find(*pref_name); |
| 236 iter != pref_callback_map_.end(); ++iter) { | 235 iter != pref_callback_map_.end(); ++iter) { |
| 237 const std::wstring& callback_function = iter->second; | 236 const std::wstring& callback_function = iter->second; |
| 238 ListValue result_value; | 237 ListValue result_value; |
| 239 result_value.Append(Value::CreateStringValue(pref_name->c_str())); | 238 result_value.Append(Value::CreateStringValue(pref_name->c_str())); |
| 240 result_value.Append(pref->GetValue()->DeepCopy()); | 239 result_value.Append(pref->GetValue()->DeepCopy()); |
| 241 dom_ui_->CallJavascriptFunction(callback_function, result_value); | 240 dom_ui_->CallJavascriptFunction(callback_function, result_value); |
| 242 } | 241 } |
| 243 } | 242 } |
| 244 } | 243 } |
| OLD | NEW |