| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/ui/webui/settings/system_handler.h" | 5 #include "chrome/browser/ui/webui/settings/system_handler.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/metrics/user_metrics.h" | 9 #include "base/metrics/user_metrics.h" |
| 10 #include "base/metrics/user_metrics_action.h" | 10 #include "base/metrics/user_metrics_action.h" |
| 11 #include "content/public/browser/web_ui.h" | 11 #include "content/public/browser/web_ui.h" |
| 12 | 12 |
| 13 #if !defined(OS_CHROMEOS) |
| 14 #include "chrome/browser/ui/webui/settings_utils.h" |
| 15 #endif |
| 16 |
| 13 namespace settings { | 17 namespace settings { |
| 14 | 18 |
| 15 SystemHandler::SystemHandler() {} | 19 SystemHandler::SystemHandler() {} |
| 16 | 20 |
| 17 SystemHandler::~SystemHandler() {} | 21 SystemHandler::~SystemHandler() {} |
| 18 | 22 |
| 19 void SystemHandler::RegisterMessages() { | 23 void SystemHandler::RegisterMessages() { |
| 20 web_ui()->RegisterMessageCallback("changeProxySettings", | 24 web_ui()->RegisterMessageCallback("changeProxySettings", |
| 21 base::Bind(&SystemHandler::HandleChangeProxySettings, | 25 base::Bind(&SystemHandler::HandleChangeProxySettings, |
| 22 base::Unretained(this))); | 26 base::Unretained(this))); |
| 23 } | 27 } |
| 24 | 28 |
| 25 void SystemHandler::HandleChangeProxySettings(const base::ListValue* /*args*/) { | 29 void SystemHandler::HandleChangeProxySettings(const base::ListValue* /*args*/) { |
| 26 base::RecordAction(base::UserMetricsAction("Options_ShowProxySettings")); | 30 base::RecordAction(base::UserMetricsAction("Options_ShowProxySettings")); |
| 27 // TODO(dbeam): port AdvancedOptionsUtilities::ShowNetworkProxySettings from | 31 #if defined(OS_CHROMEOS) |
| 28 // advanced_options_utils.h to new, settings accessible place. | 32 NOTREACHED(); |
| 33 #else |
| 34 settings_utils::ShowNetworkProxySettings(web_ui()->GetWebContents()); |
| 35 #endif |
| 29 } | 36 } |
| 30 | 37 |
| 31 } // namespace settings | 38 } // namespace settings |
| OLD | NEW |