| 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/options2/options_ui2.h" | 5 #include "chrome/browser/ui/webui/options2/options_ui2.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 //////////////////////////////////////////////////////////////////////////////// | 102 //////////////////////////////////////////////////////////////////////////////// |
| 103 // | 103 // |
| 104 // OptionsUIHTMLSource | 104 // OptionsUIHTMLSource |
| 105 // | 105 // |
| 106 //////////////////////////////////////////////////////////////////////////////// | 106 //////////////////////////////////////////////////////////////////////////////// |
| 107 | 107 |
| 108 class OptionsUIHTMLSource : public ChromeURLDataManager::DataSource { | 108 class OptionsUIHTMLSource : public ChromeURLDataManager::DataSource { |
| 109 public: | 109 public: |
| 110 // The constructor takes over ownership of |localized_strings|. | 110 // The constructor takes over ownership of |localized_strings|. |
| 111 explicit OptionsUIHTMLSource(DictionaryValue* localized_strings); | 111 explicit OptionsUIHTMLSource(DictionaryValue* localized_strings); |
| 112 virtual ~OptionsUIHTMLSource(); | |
| 113 | 112 |
| 114 // Called when the network layer has requested a resource underneath | 113 // Called when the network layer has requested a resource underneath |
| 115 // the path we registered. | 114 // the path we registered. |
| 116 virtual void StartDataRequest(const std::string& path, | 115 virtual void StartDataRequest(const std::string& path, |
| 117 bool is_incognito, | 116 bool is_incognito, |
| 118 int request_id); | 117 int request_id); |
| 119 virtual std::string GetMimeType(const std::string&) const; | 118 virtual std::string GetMimeType(const std::string&) const; |
| 120 | 119 |
| 121 private: | 120 private: |
| 121 virtual ~OptionsUIHTMLSource(); |
| 122 |
| 122 // Localized strings collection. | 123 // Localized strings collection. |
| 123 scoped_ptr<DictionaryValue> localized_strings_; | 124 scoped_ptr<DictionaryValue> localized_strings_; |
| 124 | 125 |
| 125 DISALLOW_COPY_AND_ASSIGN(OptionsUIHTMLSource); | 126 DISALLOW_COPY_AND_ASSIGN(OptionsUIHTMLSource); |
| 126 }; | 127 }; |
| 127 | 128 |
| 128 OptionsUIHTMLSource::OptionsUIHTMLSource(DictionaryValue* localized_strings) | 129 OptionsUIHTMLSource::OptionsUIHTMLSource(DictionaryValue* localized_strings) |
| 129 : DataSource(chrome::kChromeUISettingsFrameHost, MessageLoop::current()) { | 130 : DataSource(chrome::kChromeUISettingsFrameHost, MessageLoop::current()) { |
| 130 DCHECK(localized_strings); | 131 DCHECK(localized_strings); |
| 131 localized_strings_.reset(localized_strings); | 132 localized_strings_.reset(localized_strings); |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 WideToASCII(CommandLine::ForCurrentProcess()->GetCommandLineString()); | 414 WideToASCII(CommandLine::ForCurrentProcess()->GetCommandLineString()); |
| 414 #else | 415 #else |
| 415 command_line_string = | 416 command_line_string = |
| 416 CommandLine::ForCurrentProcess()->GetCommandLineString(); | 417 CommandLine::ForCurrentProcess()->GetCommandLineString(); |
| 417 #endif | 418 #endif |
| 418 | 419 |
| 419 render_view_host->SetWebUIProperty("commandLineString", command_line_string); | 420 render_view_host->SetWebUIProperty("commandLineString", command_line_string); |
| 420 } | 421 } |
| 421 | 422 |
| 422 } // namespace options2 | 423 } // namespace options2 |
| OLD | NEW |