| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/certificate_manager_dialog_ui.h" | 5 #include "chrome/browser/ui/webui/chromeos/certificate_manager_dialog_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/chromeos/system/input_device_settings.h" | 10 #include "chrome/browser/chromeos/system/input_device_settings.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 std::string CertificateManagerDialogHTMLSource::GetSource() const { | 64 std::string CertificateManagerDialogHTMLSource::GetSource() const { |
| 65 return chrome::kChromeUICertificateManagerHost; | 65 return chrome::kChromeUICertificateManagerHost; |
| 66 } | 66 } |
| 67 | 67 |
| 68 void CertificateManagerDialogHTMLSource::StartDataRequest( | 68 void CertificateManagerDialogHTMLSource::StartDataRequest( |
| 69 const std::string& path, | 69 const std::string& path, |
| 70 int render_process_id, | 70 int render_process_id, |
| 71 int render_frame_id, | 71 int render_frame_id, |
| 72 const content::URLDataSource::GotDataCallback& callback) { | 72 const content::URLDataSource::GotDataCallback& callback) { |
| 73 scoped_refptr<base::RefCountedMemory> response_bytes; | 73 scoped_refptr<base::RefCountedMemory> response_bytes; |
| 74 webui::SetFontAndTextDirection(localized_strings_.get()); | 74 webui::SetTextDirection(localized_strings_.get()); |
| 75 | 75 |
| 76 if (path == kLocalizedStringsFile) { | 76 if (path == kLocalizedStringsFile) { |
| 77 // Return dynamically-generated strings from memory. | 77 // Return dynamically-generated strings from memory. |
| 78 std::string strings_js; | 78 std::string strings_js; |
| 79 webui::AppendJsonJS(localized_strings_.get(), &strings_js); | 79 webui::AppendJsonJS(localized_strings_.get(), &strings_js); |
| 80 response_bytes = base::RefCountedString::TakeString(&strings_js); | 80 response_bytes = base::RefCountedString::TakeString(&strings_js); |
| 81 } else { | 81 } else { |
| 82 // Return (and cache) the main options html page as the default. | 82 // Return (and cache) the main options html page as the default. |
| 83 response_bytes = ui::ResourceBundle::GetSharedInstance(). | 83 response_bytes = ui::ResourceBundle::GetSharedInstance(). |
| 84 LoadDataResourceBytes(IDR_CERT_MANAGER_DIALOG_HTML); | 84 LoadDataResourceBytes(IDR_CERT_MANAGER_DIALOG_HTML); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 if (!initialized_handlers_) { | 131 if (!initialized_handlers_) { |
| 132 core_handler_->InitializeHandler(); | 132 core_handler_->InitializeHandler(); |
| 133 cert_handler_->InitializeHandler(); | 133 cert_handler_->InitializeHandler(); |
| 134 initialized_handlers_ = true; | 134 initialized_handlers_ = true; |
| 135 } | 135 } |
| 136 core_handler_->InitializePage(); | 136 core_handler_->InitializePage(); |
| 137 cert_handler_->InitializePage(); | 137 cert_handler_->InitializePage(); |
| 138 } | 138 } |
| 139 | 139 |
| 140 } // namespace chromeos | 140 } // namespace chromeos |
| OLD | NEW |