Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: chrome/browser/dom_ui/core_options_handler.cc

Issue 2830036: Advanced (Under the Hood) options panel code review (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/dom_ui/browser_options_handler.cc ('k') | chrome/browser/dom_ui/options_ui.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/dom_ui/browser_options_handler.cc ('k') | chrome/browser/dom_ui/options_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698