Chromium Code Reviews| Index: chrome/browser/ui/webui/md_settings_ui.cc |
| diff --git a/chrome/browser/ui/webui/md_settings_ui.cc b/chrome/browser/ui/webui/md_settings_ui.cc |
| index 4c24d7f1a275d82fb57f36fbeabfc4585cb0bd25..39f56b99b0b356b3eb60034609e55b1a8abe6670 100644 |
| --- a/chrome/browser/ui/webui/md_settings_ui.cc |
| +++ b/chrome/browser/ui/webui/md_settings_ui.cc |
| @@ -7,6 +7,8 @@ |
| #include <string> |
| #include "base/values.h" |
| +#include "chrome/browser/profiles/profile.h" |
| +#include "chrome/browser/ui/webui/options/core_options_handler.h" |
| #include "chrome/common/url_constants.h" |
| #include "chrome/grit/generated_resources.h" |
| #include "content/public/browser/web_contents.h" |
| @@ -16,8 +18,26 @@ |
| #include "grit/settings_resources.h" |
| #include "grit/settings_resources_map.h" |
| +#if defined(OS_CHROMEOS) |
| +#include "chrome/browser/ui/webui/options/chromeos/core_chromeos_options_handler.h" |
| +#endif |
| + |
| MdSettingsUI::MdSettingsUI(content::WebUI* web_ui) |
| : content::WebUIController(web_ui) { |
| + // TODO(jlklein): Remove handler logic once settingsPrivate is ready. |
| + #if defined(OS_CHROMEOS) |
|
Dan Beam
2015/03/19 23:47:09
0-indent #ifs, e.g.
// TODO(jlklein):
#if def
Jeremy Klein
2015/03/20 00:45:38
Ah I see. Misunderstood Michael's comment here. Do
|
| + core_handler_ = new chromeos::options::CoreChromeOSOptionsHandler(); |
| + #else |
| + core_handler_ = new options::CoreOptionsHandler(); |
| + #endif |
| + |
| + core_handler_->set_handlers_host(this); |
| + scoped_ptr<options::OptionsPageUIHandler> handler(core_handler_); |
| + DCHECK(handler.get()); |
|
Dan Beam
2015/03/19 23:47:09
what are you DCHECK()ing?
Jeremy Klein
2015/03/20 00:45:38
Caught me copy-pasta-ing. Looks like this isn't ne
|
| + if (handler->IsEnabled()) { |
|
Dan Beam
2015/03/19 23:47:09
no curlies
Jeremy Klein
2015/03/20 00:45:38
Done.
|
| + web_ui->AddMessageHandler(handler.release()); |
| + } |
| + |
| content::WebUIDataSource* html_source = |
| content::WebUIDataSource::Create(chrome::kChromeUIMdSettingsHost); |
| @@ -36,3 +56,13 @@ MdSettingsUI::MdSettingsUI(content::WebUI* web_ui) |
| MdSettingsUI::~MdSettingsUI() { |
| } |
| + |
| +void MdSettingsUI::InitializeHandlers() { |
| + Profile* profile = Profile::FromWebUI(web_ui()); |
| + DCHECK(!profile->IsOffTheRecord() || profile->IsGuestSession()); |
| + |
| + core_handler_->InitializeHandler(); |
| + core_handler_->InitializePage(); |
| +} |
| + |
| +void MdSettingsUI::OnFinishedLoading() {} |
|
Dan Beam
2015/03/19 23:47:09
remove or explain why you're changing the behavior
Jeremy Klein
2015/03/20 00:45:38
Nothin' to see here, just me bein a C++ n00b think
|