| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/chromeos/proxy_settings_ui.h" | 5 #include "chrome/browser/ui/webui/chromeos/proxy_settings_ui.h" |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "chrome/browser/chromeos/cros_settings.h" | 10 #include "chrome/browser/chromeos/cros_settings.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 html, localized_strings_.get()); | 62 html, localized_strings_.get()); |
| 63 | 63 |
| 64 SendResponse(request_id, base::RefCountedString::TakeString(&full_html)); | 64 SendResponse(request_id, base::RefCountedString::TakeString(&full_html)); |
| 65 } | 65 } |
| 66 | 66 |
| 67 } // namespace | 67 } // namespace |
| 68 | 68 |
| 69 namespace chromeos { | 69 namespace chromeos { |
| 70 | 70 |
| 71 ProxySettingsUI::ProxySettingsUI(WebContents* contents) | 71 ProxySettingsUI::ProxySettingsUI(WebContents* contents) |
| 72 : WebUI(contents), | 72 : WebUI(contents, this), |
| 73 proxy_handler_(new ProxyHandler()) { | 73 proxy_handler_(new ProxyHandler()) { |
| 74 // |localized_strings| will be owned by ProxySettingsHTMLSource. | 74 // |localized_strings| will be owned by ProxySettingsHTMLSource. |
| 75 DictionaryValue* localized_strings = new DictionaryValue(); | 75 DictionaryValue* localized_strings = new DictionaryValue(); |
| 76 | 76 |
| 77 CoreChromeOSOptionsHandler* core_handler = new CoreChromeOSOptionsHandler(); | 77 CoreChromeOSOptionsHandler* core_handler = new CoreChromeOSOptionsHandler(); |
| 78 core_handler->set_handlers_host(this); | 78 core_handler->set_handlers_host(this); |
| 79 core_handler->GetLocalizedValues(localized_strings); | 79 core_handler->GetLocalizedValues(localized_strings); |
| 80 AddMessageHandler(core_handler); | 80 AddMessageHandler(core_handler); |
| 81 | 81 |
| 82 proxy_handler_->GetLocalizedValues(localized_strings); | 82 proxy_handler_->GetLocalizedValues(localized_strings); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 108 Profile* profile = | 108 Profile* profile = |
| 109 Profile::FromBrowserContext(web_contents()->GetBrowserContext()); | 109 Profile::FromBrowserContext(web_contents()->GetBrowserContext()); |
| 110 PrefProxyConfigTracker* proxy_tracker = profile->GetProxyConfigTracker(); | 110 PrefProxyConfigTracker* proxy_tracker = profile->GetProxyConfigTracker(); |
| 111 proxy_tracker->UIMakeActiveNetworkCurrent(); | 111 proxy_tracker->UIMakeActiveNetworkCurrent(); |
| 112 std::string network_name; | 112 std::string network_name; |
| 113 proxy_tracker->UIGetCurrentNetworkName(&network_name); | 113 proxy_tracker->UIGetCurrentNetworkName(&network_name); |
| 114 proxy_handler_->SetNetworkName(network_name); | 114 proxy_handler_->SetNetworkName(network_name); |
| 115 } | 115 } |
| 116 | 116 |
| 117 } // namespace chromeos | 117 } // namespace chromeos |
| OLD | NEW |