| 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 18 matching lines...) Expand all Loading... |
| 29 namespace { | 29 namespace { |
| 30 | 30 |
| 31 const char kLocalizedStringsFile[] = "strings.js"; | 31 const char kLocalizedStringsFile[] = "strings.js"; |
| 32 | 32 |
| 33 class CertificateManagerDialogHTMLSource : public content::URLDataSource { | 33 class CertificateManagerDialogHTMLSource : public content::URLDataSource { |
| 34 public: | 34 public: |
| 35 explicit CertificateManagerDialogHTMLSource( | 35 explicit CertificateManagerDialogHTMLSource( |
| 36 base::DictionaryValue* localized_strings); | 36 base::DictionaryValue* localized_strings); |
| 37 | 37 |
| 38 // content::URLDataSource implementation. | 38 // content::URLDataSource implementation. |
| 39 virtual std::string GetSource() const override; | 39 std::string GetSource() const override; |
| 40 virtual void StartDataRequest( | 40 void StartDataRequest( |
| 41 const std::string& path, | 41 const std::string& path, |
| 42 int render_process_id, | 42 int render_process_id, |
| 43 int render_frame_id, | 43 int render_frame_id, |
| 44 const content::URLDataSource::GotDataCallback& callback) override; | 44 const content::URLDataSource::GotDataCallback& callback) override; |
| 45 virtual std::string GetMimeType(const std::string&) const override { | 45 std::string GetMimeType(const std::string&) const override { |
| 46 return "text/html"; | 46 return "text/html"; |
| 47 } | 47 } |
| 48 virtual bool ShouldAddContentSecurityPolicy() const override { | 48 bool ShouldAddContentSecurityPolicy() const override { return false; } |
| 49 return false; | |
| 50 } | |
| 51 | 49 |
| 52 protected: | 50 protected: |
| 53 virtual ~CertificateManagerDialogHTMLSource() {} | 51 ~CertificateManagerDialogHTMLSource() override {} |
| 54 | 52 |
| 55 private: | 53 private: |
| 56 scoped_ptr<base::DictionaryValue> localized_strings_; | 54 scoped_ptr<base::DictionaryValue> localized_strings_; |
| 57 | 55 |
| 58 DISALLOW_COPY_AND_ASSIGN(CertificateManagerDialogHTMLSource); | 56 DISALLOW_COPY_AND_ASSIGN(CertificateManagerDialogHTMLSource); |
| 59 }; | 57 }; |
| 60 | 58 |
| 61 CertificateManagerDialogHTMLSource::CertificateManagerDialogHTMLSource( | 59 CertificateManagerDialogHTMLSource::CertificateManagerDialogHTMLSource( |
| 62 base::DictionaryValue* localized_strings) | 60 base::DictionaryValue* localized_strings) |
| 63 : localized_strings_(localized_strings) { | 61 : localized_strings_(localized_strings) { |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 if (!initialized_handlers_) { | 131 if (!initialized_handlers_) { |
| 134 core_handler_->InitializeHandler(); | 132 core_handler_->InitializeHandler(); |
| 135 cert_handler_->InitializeHandler(); | 133 cert_handler_->InitializeHandler(); |
| 136 initialized_handlers_ = true; | 134 initialized_handlers_ = true; |
| 137 } | 135 } |
| 138 core_handler_->InitializePage(); | 136 core_handler_->InitializePage(); |
| 139 cert_handler_->InitializePage(); | 137 cert_handler_->InitializePage(); |
| 140 } | 138 } |
| 141 | 139 |
| 142 } // namespace chromeos | 140 } // namespace chromeos |
| OLD | NEW |