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

Side by Side Diff: chrome/browser/dom_ui/options_ui.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
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/options_ui.h" 5 #include "chrome/browser/dom_ui/options_ui.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/callback.h" 9 #include "base/callback.h"
10 #include "base/i18n/time_formatting.h" 10 #include "base/i18n/time_formatting.h"
11 #include "base/message_loop.h" 11 #include "base/message_loop.h"
12 #include "base/singleton.h" 12 #include "base/singleton.h"
13 #include "base/string_piece.h" 13 #include "base/string_piece.h"
14 #include "base/string_util.h" 14 #include "base/string_util.h"
15 #include "base/thread.h" 15 #include "base/thread.h"
16 #include "base/time.h" 16 #include "base/time.h"
17 #include "base/values.h" 17 #include "base/values.h"
18 #include "chrome/browser/chrome_thread.h" 18 #include "chrome/browser/chrome_thread.h"
19 #include "chrome/browser/dom_ui/advanced_options_handler.h"
20 #include "chrome/browser/dom_ui/browser_options_handler.h"
19 #include "chrome/browser/dom_ui/core_options_handler.h" 21 #include "chrome/browser/dom_ui/core_options_handler.h"
22 #include "chrome/browser/dom_ui/personal_options_handler.h"
20 #include "chrome/browser/metrics/user_metrics.h" 23 #include "chrome/browser/metrics/user_metrics.h"
21 #include "chrome/browser/pref_service.h" 24 #include "chrome/browser/pref_service.h"
22 #include "chrome/browser/profile.h" 25 #include "chrome/browser/profile.h"
23 #include "chrome/browser/tab_contents/tab_contents.h" 26 #include "chrome/browser/tab_contents/tab_contents.h"
24 #include "chrome/browser/tab_contents/tab_contents_delegate.h" 27 #include "chrome/browser/tab_contents/tab_contents_delegate.h"
25 #include "chrome/common/jstemplate_builder.h" 28 #include "chrome/common/jstemplate_builder.h"
26 #include "chrome/common/notification_service.h" 29 #include "chrome/common/notification_service.h"
27 #include "chrome/common/notification_type.h" 30 #include "chrome/common/notification_type.h"
28 #include "chrome/common/time_format.h" 31 #include "chrome/common/time_format.h"
29 #include "chrome/common/url_constants.h" 32 #include "chrome/common/url_constants.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 // 96 //
94 // OptionsUI 97 // OptionsUI
95 // 98 //
96 //////////////////////////////////////////////////////////////////////////////// 99 ////////////////////////////////////////////////////////////////////////////////
97 100
98 OptionsUI::OptionsUI(TabContents* contents) : DOMUI(contents) { 101 OptionsUI::OptionsUI(TabContents* contents) : DOMUI(contents) {
99 DictionaryValue* localized_strings = new DictionaryValue(); 102 DictionaryValue* localized_strings = new DictionaryValue();
100 103
101 // TODO(zelidrag): Add all other page handlers here as we implement them. 104 // TODO(zelidrag): Add all other page handlers here as we implement them.
102 AddOptionsPageUIHandler(localized_strings, new CoreOptionsHandler()); 105 AddOptionsPageUIHandler(localized_strings, new CoreOptionsHandler());
106 AddOptionsPageUIHandler(localized_strings, new BrowserOptionsHandler());
107 AddOptionsPageUIHandler(localized_strings, new PersonalOptionsHandler());
108 AddOptionsPageUIHandler(localized_strings, new AdvancedOptionsHandler());
103 #if defined(OS_CHROMEOS) 109 #if defined(OS_CHROMEOS)
104 AddOptionsPageUIHandler(localized_strings, new SystemOptionsHandler()); 110 AddOptionsPageUIHandler(localized_strings, new SystemOptionsHandler());
105 AddOptionsPageUIHandler(localized_strings, new LabsHandler()); 111 AddOptionsPageUIHandler(localized_strings, new LabsHandler());
106 #endif 112 #endif
107 113
108 // |localized_strings| ownership is taken over by this constructor. 114 // |localized_strings| ownership is taken over by this constructor.
109 OptionsUIHTMLSource* html_source = 115 OptionsUIHTMLSource* html_source =
110 new OptionsUIHTMLSource(localized_strings); 116 new OptionsUIHTMLSource(localized_strings);
111 117
112 // Set up the chrome://options/ source. 118 // Set up the chrome://options/ source.
(...skipping 12 matching lines...) Expand all
125 // LoadDataResourceBytes(IDR_OPTIONS_FAVICON); 131 // LoadDataResourceBytes(IDR_OPTIONS_FAVICON);
126 return NULL; 132 return NULL;
127 } 133 }
128 134
129 void OptionsUI::AddOptionsPageUIHandler(DictionaryValue* localized_strings, 135 void OptionsUI::AddOptionsPageUIHandler(DictionaryValue* localized_strings,
130 OptionsPageUIHandler* handler) { 136 OptionsPageUIHandler* handler) {
131 DCHECK(handler); 137 DCHECK(handler);
132 handler->GetLocalizedValues(localized_strings); 138 handler->GetLocalizedValues(localized_strings);
133 AddMessageHandler(handler->Attach(this)); 139 AddMessageHandler(handler->Attach(this));
134 } 140 }
OLDNEW
« no previous file with comments | « chrome/browser/dom_ui/core_options_handler.cc ('k') | chrome/browser/dom_ui/personal_options_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698