Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Side by Side Diff: chrome/browser/ui/webui/chromeos/proxy_settings_ui.cc

Issue 9814030: get rid of old options pages (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more fixes Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/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/options2/chromeos/core_chromeos_options_handle r2.h"
15 #include "chrome/browser/ui/webui/options/chromeos/proxy_handler.h" 15 #include "chrome/browser/ui/webui/options2/chromeos/proxy_handler2.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.h" 19 #include "content/public/browser/web_ui.h"
20 #include "content/public/browser/web_ui_message_handler.h" 20 #include "content/public/browser/web_ui_message_handler.h"
21 #include "grit/browser_resources.h" 21 #include "grit/browser_resources.h"
22 #include "ui/base/resource/resource_bundle.h" 22 #include "ui/base/resource/resource_bundle.h"
23 23
24 using content::WebContents; 24 using content::WebContents;
25 using content::WebUIMessageHandler; 25 using content::WebUIMessageHandler;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 64
65 SendResponse(request_id, base::RefCountedString::TakeString(&full_html)); 65 SendResponse(request_id, base::RefCountedString::TakeString(&full_html));
66 } 66 }
67 67
68 } // namespace 68 } // namespace
69 69
70 namespace chromeos { 70 namespace chromeos {
71 71
72 ProxySettingsUI::ProxySettingsUI(content::WebUI* web_ui) 72 ProxySettingsUI::ProxySettingsUI(content::WebUI* web_ui)
73 : WebUIController(web_ui), 73 : WebUIController(web_ui),
74 proxy_handler_(new ProxyHandler()), 74 proxy_handler_(new options2::ProxyHandler()),
75 core_handler_(new CoreChromeOSOptionsHandler()) { 75 core_handler_(new options2::CoreChromeOSOptionsHandler()) {
76 // |localized_strings| will be owned by ProxySettingsHTMLSource. 76 // |localized_strings| will be owned by ProxySettingsHTMLSource.
77 DictionaryValue* localized_strings = new DictionaryValue(); 77 DictionaryValue* localized_strings = new DictionaryValue();
78 78
79 core_handler_->set_handlers_host(this); 79 core_handler_->set_handlers_host(this);
80 core_handler_->GetLocalizedValues(localized_strings); 80 core_handler_->GetLocalizedValues(localized_strings);
81 web_ui->AddMessageHandler(core_handler_); 81 web_ui->AddMessageHandler(core_handler_);
82 82
83 proxy_handler_->GetLocalizedValues(localized_strings); 83 proxy_handler_->GetLocalizedValues(localized_strings);
84 web_ui->AddMessageHandler(proxy_handler_); 84 web_ui->AddMessageHandler(proxy_handler_);
85 85
(...skipping 17 matching lines...) Expand all
103 proxy_handler_->InitializePage(); 103 proxy_handler_->InitializePage();
104 Profile* profile = Profile::FromWebUI(web_ui()); 104 Profile* profile = Profile::FromWebUI(web_ui());
105 PrefProxyConfigTracker* proxy_tracker = profile->GetProxyConfigTracker(); 105 PrefProxyConfigTracker* proxy_tracker = profile->GetProxyConfigTracker();
106 proxy_tracker->UIMakeActiveNetworkCurrent(); 106 proxy_tracker->UIMakeActiveNetworkCurrent();
107 std::string network_name; 107 std::string network_name;
108 proxy_tracker->UIGetCurrentNetworkName(&network_name); 108 proxy_tracker->UIGetCurrentNetworkName(&network_name);
109 proxy_handler_->SetNetworkName(network_name); 109 proxy_handler_->SetNetworkName(network_name);
110 } 110 }
111 111
112 } // namespace chromeos 112 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698