| 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" |
| 11 #include "chrome/browser/chromeos/proxy_config_service_impl.h" | 11 #include "chrome/browser/chromeos/proxy_config_service_impl.h" |
| 12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
| 13 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" | 13 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" |
| 14 #include "chrome/browser/ui/webui/options/chromeos/core_chromeos_options_handler
.h" | 14 #include "chrome/browser/ui/webui/options/chromeos/core_chromeos_options_handler
.h" |
| 15 #include "chrome/browser/ui/webui/options/chromeos/proxy_handler.h" | 15 #include "chrome/browser/ui/webui/options/chromeos/proxy_handler.h" |
| 16 #include "chrome/common/jstemplate_builder.h" | 16 #include "chrome/common/jstemplate_builder.h" |
| 17 #include "chrome/common/url_constants.h" | 17 #include "chrome/common/url_constants.h" |
| 18 #include "content/public/browser/web_contents.h" | 18 #include "content/public/browser/web_contents.h" |
| 19 #include "content/public/browser/web_ui_message_handler.h" |
| 19 #include "grit/browser_resources.h" | 20 #include "grit/browser_resources.h" |
| 20 #include "ui/base/resource/resource_bundle.h" | 21 #include "ui/base/resource/resource_bundle.h" |
| 21 | 22 |
| 22 using content::WebContents; | 23 using content::WebContents; |
| 24 using content::WebUIMessageHandler; |
| 23 | 25 |
| 24 namespace { | 26 namespace { |
| 25 | 27 |
| 26 class ProxySettingsHTMLSource : public ChromeURLDataManager::DataSource { | 28 class ProxySettingsHTMLSource : public ChromeURLDataManager::DataSource { |
| 27 public: | 29 public: |
| 28 explicit ProxySettingsHTMLSource(DictionaryValue* localized_strings); | 30 explicit ProxySettingsHTMLSource(DictionaryValue* localized_strings); |
| 29 | 31 |
| 30 // Called when the network layer has requested a resource underneath | 32 // Called when the network layer has requested a resource underneath |
| 31 // the path we registered. | 33 // the path we registered. |
| 32 virtual void StartDataRequest(const std::string& path, | 34 virtual void StartDataRequest(const std::string& path, |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 (static_cast<OptionsPageUIHandler*>(*iter))->Initialize(); | 106 (static_cast<OptionsPageUIHandler*>(*iter))->Initialize(); |
| 105 } | 107 } |
| 106 PrefProxyConfigTracker* proxy_tracker = GetProfile()->GetProxyConfigTracker(); | 108 PrefProxyConfigTracker* proxy_tracker = GetProfile()->GetProxyConfigTracker(); |
| 107 proxy_tracker->UIMakeActiveNetworkCurrent(); | 109 proxy_tracker->UIMakeActiveNetworkCurrent(); |
| 108 std::string network_name; | 110 std::string network_name; |
| 109 proxy_tracker->UIGetCurrentNetworkName(&network_name); | 111 proxy_tracker->UIGetCurrentNetworkName(&network_name); |
| 110 proxy_handler_->SetNetworkName(network_name); | 112 proxy_handler_->SetNetworkName(network_name); |
| 111 } | 113 } |
| 112 | 114 |
| 113 } // namespace chromeos | 115 } // namespace chromeos |
| OLD | NEW |