| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ref_counted_memory.h" | 7 #include "base/memory/ref_counted_memory.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 core_handler_->set_handlers_host(this); | 80 core_handler_->set_handlers_host(this); |
| 81 core_handler_->GetLocalizedValues(localized_strings); | 81 core_handler_->GetLocalizedValues(localized_strings); |
| 82 web_ui->AddMessageHandler(core_handler_); | 82 web_ui->AddMessageHandler(core_handler_); |
| 83 | 83 |
| 84 proxy_handler_->GetLocalizedValues(localized_strings); | 84 proxy_handler_->GetLocalizedValues(localized_strings); |
| 85 web_ui->AddMessageHandler(proxy_handler_); | 85 web_ui->AddMessageHandler(proxy_handler_); |
| 86 | 86 |
| 87 ProxySettingsHTMLSource* source = | 87 ProxySettingsHTMLSource* source = |
| 88 new ProxySettingsHTMLSource(localized_strings); | 88 new ProxySettingsHTMLSource(localized_strings); |
| 89 Profile* profile = Profile::FromWebUI(web_ui); | 89 Profile* profile = Profile::FromWebUI(web_ui); |
| 90 profile->GetChromeURLDataManager()->AddDataSource(source); | 90 ChromeURLDataManager::AddDataSource(profile, source); |
| 91 } | 91 } |
| 92 | 92 |
| 93 ProxySettingsUI::~ProxySettingsUI() { | 93 ProxySettingsUI::~ProxySettingsUI() { |
| 94 // Uninitialize all registered handlers. The base class owns them and it will | 94 // Uninitialize all registered handlers. The base class owns them and it will |
| 95 // eventually delete them. | 95 // eventually delete them. |
| 96 core_handler_->Uninitialize(); | 96 core_handler_->Uninitialize(); |
| 97 proxy_handler_->Uninitialize(); | 97 proxy_handler_->Uninitialize(); |
| 98 } | 98 } |
| 99 | 99 |
| 100 void ProxySettingsUI::InitializeHandlers() { | 100 void ProxySettingsUI::InitializeHandlers() { |
| 101 core_handler_->InitializeHandler(); | 101 core_handler_->InitializeHandler(); |
| 102 proxy_handler_->InitializeHandler(); | 102 proxy_handler_->InitializeHandler(); |
| 103 core_handler_->InitializePage(); | 103 core_handler_->InitializePage(); |
| 104 proxy_handler_->InitializePage(); | 104 proxy_handler_->InitializePage(); |
| 105 Profile* profile = Profile::FromWebUI(web_ui()); | 105 Profile* profile = Profile::FromWebUI(web_ui()); |
| 106 PrefProxyConfigTracker* proxy_tracker = profile->GetProxyConfigTracker(); | 106 PrefProxyConfigTracker* proxy_tracker = profile->GetProxyConfigTracker(); |
| 107 proxy_tracker->UIMakeActiveNetworkCurrent(); | 107 proxy_tracker->UIMakeActiveNetworkCurrent(); |
| 108 std::string network_name; | 108 std::string network_name; |
| 109 proxy_tracker->UIGetCurrentNetworkName(&network_name); | 109 proxy_tracker->UIGetCurrentNetworkName(&network_name); |
| 110 } | 110 } |
| 111 | 111 |
| 112 } // namespace chromeos | 112 } // namespace chromeos |
| OLD | NEW |