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/values.h" | 9 #include "base/values.h" |
| 10 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/chromeos/system/input_device_settings.h" | 11 #include "chrome/browser/chromeos/system/input_device_settings.h" |
11 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
12 #include "chrome/browser/ui/webui/options/chromeos/core_chromeos_options_handler
.h" | 13 #include "chrome/browser/ui/webui/options/chromeos/core_chromeos_options_handler
.h" |
13 #include "chrome/browser/ui/webui/options/chromeos/proxy_handler.h" | 14 #include "chrome/browser/ui/webui/options/chromeos/proxy_handler.h" |
14 #include "chrome/common/chrome_constants.h" | 15 #include "chrome/common/chrome_constants.h" |
15 #include "chrome/common/url_constants.h" | 16 #include "chrome/common/url_constants.h" |
16 #include "chromeos/chromeos_constants.h" | 17 #include "chromeos/chromeos_constants.h" |
17 #include "content/public/browser/url_data_source.h" | 18 #include "content/public/browser/url_data_source.h" |
18 #include "content/public/browser/web_contents.h" | 19 #include "content/public/browser/web_contents.h" |
19 #include "content/public/browser/web_ui.h" | 20 #include "content/public/browser/web_ui.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 61 |
61 std::string ProxySettingsHTMLSource::GetSource() const { | 62 std::string ProxySettingsHTMLSource::GetSource() const { |
62 return chrome::kChromeUIProxySettingsHost; | 63 return chrome::kChromeUIProxySettingsHost; |
63 } | 64 } |
64 | 65 |
65 void ProxySettingsHTMLSource::StartDataRequest( | 66 void ProxySettingsHTMLSource::StartDataRequest( |
66 const std::string& path, | 67 const std::string& path, |
67 int render_process_id, | 68 int render_process_id, |
68 int render_frame_id, | 69 int render_frame_id, |
69 const content::URLDataSource::GotDataCallback& callback) { | 70 const content::URLDataSource::GotDataCallback& callback) { |
70 webui::SetFontAndTextDirection(localized_strings_.get()); | 71 const std::string& app_locale = g_browser_process->GetApplicationLocale(); |
| 72 webui::SetLoadTimeDataDefaults(app_locale, localized_strings_.get()); |
71 | 73 |
72 static const base::StringPiece html( | 74 static const base::StringPiece html( |
73 ResourceBundle::GetSharedInstance().GetRawDataResource( | 75 ResourceBundle::GetSharedInstance().GetRawDataResource( |
74 IDR_PROXY_SETTINGS_HTML)); | 76 IDR_PROXY_SETTINGS_HTML)); |
75 std::string full_html = webui::GetI18nTemplateHtml( | 77 std::string full_html = webui::GetI18nTemplateHtml( |
76 html, localized_strings_.get()); | 78 html, localized_strings_.get()); |
77 | 79 |
78 callback.Run(base::RefCountedString::TakeString(&full_html)); | 80 callback.Run(base::RefCountedString::TakeString(&full_html)); |
79 } | 81 } |
80 | 82 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 if (!initialized_handlers_) { | 124 if (!initialized_handlers_) { |
123 core_handler_->InitializeHandler(); | 125 core_handler_->InitializeHandler(); |
124 proxy_handler_->InitializeHandler(); | 126 proxy_handler_->InitializeHandler(); |
125 initialized_handlers_ = true; | 127 initialized_handlers_ = true; |
126 } | 128 } |
127 core_handler_->InitializePage(); | 129 core_handler_->InitializePage(); |
128 proxy_handler_->InitializePage(); | 130 proxy_handler_->InitializePage(); |
129 } | 131 } |
130 | 132 |
131 } // namespace chromeos | 133 } // namespace chromeos |
OLD | NEW |