| 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 #ifndef CHROME_BROWSER_UI_WEBUI_CHROME_URL_DATA_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_CHROME_URL_DATA_MANAGER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_CHROME_URL_DATA_MANAGER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_CHROME_URL_DATA_MANAGER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 | 100 |
| 101 // Returns true if this DataSource should replace an existing DataSource | 101 // Returns true if this DataSource should replace an existing DataSource |
| 102 // with the same name that has already been registered. The default is | 102 // with the same name that has already been registered. The default is |
| 103 // true. | 103 // true. |
| 104 // | 104 // |
| 105 // WARNING: this is invoked on the IO thread. | 105 // WARNING: this is invoked on the IO thread. |
| 106 // | 106 // |
| 107 // TODO: nuke this and convert all callers to not replace. | 107 // TODO: nuke this and convert all callers to not replace. |
| 108 virtual bool ShouldReplaceExistingSource() const; | 108 virtual bool ShouldReplaceExistingSource() const; |
| 109 | 109 |
| 110 // Returns true if responses from this DataSource can be cached. |
| 111 virtual bool AllowCaching() const { return true; } |
| 112 |
| 110 static void SetFontAndTextDirection( | 113 static void SetFontAndTextDirection( |
| 111 base::DictionaryValue* localized_strings); | 114 base::DictionaryValue* localized_strings); |
| 112 | 115 |
| 113 protected: | 116 protected: |
| 114 virtual ~DataSource(); | 117 virtual ~DataSource(); |
| 115 | 118 |
| 116 private: | 119 private: |
| 117 friend class ChromeURLDataManagerBackend; | 120 friend class ChromeURLDataManagerBackend; |
| 118 friend class ChromeURLDataManager; | 121 friend class ChromeURLDataManager; |
| 119 friend class base::DeleteHelper<DataSource>; | 122 friend class base::DeleteHelper<DataSource>; |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 const base::Callback<ChromeURLDataManagerBackend*(void)> backend_; | 188 const base::Callback<ChromeURLDataManagerBackend*(void)> backend_; |
| 186 | 189 |
| 187 // |data_sources_| that are no longer referenced and scheduled for deletion. | 190 // |data_sources_| that are no longer referenced and scheduled for deletion. |
| 188 // Protected by g_delete_lock in the .cc file. | 191 // Protected by g_delete_lock in the .cc file. |
| 189 static DataSources* data_sources_; | 192 static DataSources* data_sources_; |
| 190 | 193 |
| 191 DISALLOW_COPY_AND_ASSIGN(ChromeURLDataManager); | 194 DISALLOW_COPY_AND_ASSIGN(ChromeURLDataManager); |
| 192 }; | 195 }; |
| 193 | 196 |
| 194 #endif // CHROME_BROWSER_UI_WEBUI_CHROME_URL_DATA_MANAGER_H_ | 197 #endif // CHROME_BROWSER_UI_WEBUI_CHROME_URL_DATA_MANAGER_H_ |
| OLD | NEW |