Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 CONTENT_PUBLIC_BROWSER_WEB_UI_DATA_SOURCE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_WEB_UI_DATA_SOURCE_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_WEB_UI_DATA_SOURCE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_WEB_UI_DATA_SOURCE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | |
| 9 | |
| 8 #include "base/callback.h" | 10 #include "base/callback.h" |
| 9 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
| 10 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
| 11 | 13 |
| 12 namespace base { | 14 namespace base { |
| 13 class DictionaryValue; | 15 class DictionaryValue; |
| 14 class RefCountedMemory; | 16 class RefCountedMemory; |
| 15 } | 17 } |
| 16 | 18 |
| 17 namespace content { | 19 namespace content { |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 40 // dictionary. | 42 // dictionary. |
| 41 virtual void AddLocalizedString(const std::string& name, int ids) = 0; | 43 virtual void AddLocalizedString(const std::string& name, int ids) = 0; |
| 42 | 44 |
| 43 // Add strings from |localized_strings| to our dictionary. | 45 // Add strings from |localized_strings| to our dictionary. |
| 44 virtual void AddLocalizedStrings( | 46 virtual void AddLocalizedStrings( |
| 45 const base::DictionaryValue& localized_strings) = 0; | 47 const base::DictionaryValue& localized_strings) = 0; |
| 46 | 48 |
| 47 // Adds a boolean keyed to its name to our dictionary. | 49 // Adds a boolean keyed to its name to our dictionary. |
| 48 virtual void AddBoolean(const std::string& name, bool value) = 0; | 50 virtual void AddBoolean(const std::string& name, bool value) = 0; |
| 49 | 51 |
| 52 // Adds a signed 32-bit integer keyed to its name to our dictionary. Larger | |
| 53 // integers may not be exactly representable in JavaScript. See | |
| 54 // MAX_SAFE_INTEGER in /v8/src/globals.h. | |
| 55 virtual void AddInteger(const std::string& name, int32_t value) = 0; | |
|
Charlie Reis
2016/10/06 20:47:06
We generally don't allow adding things to content/
michaelpg
2016/10/06 21:32:04
Are you asking me to land a usage with this CL, or
Charlie Reis
2016/10/06 21:36:11
Yes, we need to land it with a usage. (jam@ has i
michaelpg
2016/10/06 23:58:37
Done.
| |
| 56 | |
| 50 // Sets the path which will return the JSON strings. | 57 // Sets the path which will return the JSON strings. |
| 51 virtual void SetJsonPath(const std::string& path) = 0; | 58 virtual void SetJsonPath(const std::string& path) = 0; |
| 52 | 59 |
| 53 // Adds a mapping between a path name and a resource to return. | 60 // Adds a mapping between a path name and a resource to return. |
| 54 virtual void AddResourcePath(const std::string& path, int resource_id) = 0; | 61 virtual void AddResourcePath(const std::string& path, int resource_id) = 0; |
| 55 | 62 |
| 56 // Sets the resource to returned when no other paths match. | 63 // Sets the resource to returned when no other paths match. |
| 57 virtual void SetDefaultResource(int resource_id) = 0; | 64 virtual void SetDefaultResource(int resource_id) = 0; |
| 58 | 65 |
| 59 // Used as a parameter to GotDataCallback. The caller has to run this callback | 66 // Used as a parameter to GotDataCallback. The caller has to run this callback |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 87 virtual void DisableDenyXFrameOptions() = 0; | 94 virtual void DisableDenyXFrameOptions() = 0; |
| 88 | 95 |
| 89 // Tells the loading code that resources are gzipped on disk. TODO(dbeam): | 96 // Tells the loading code that resources are gzipped on disk. TODO(dbeam): |
| 90 // write a streaming $i18n{} replacer and remove the "DisableI18n" part. | 97 // write a streaming $i18n{} replacer and remove the "DisableI18n" part. |
| 91 virtual void DisableI18nAndUseGzipForAllPaths() = 0; | 98 virtual void DisableI18nAndUseGzipForAllPaths() = 0; |
| 92 }; | 99 }; |
| 93 | 100 |
| 94 } // namespace content | 101 } // namespace content |
| 95 | 102 |
| 96 #endif // CONTENT_PUBLIC_BROWSER_WEB_UI_DATA_SOURCE_H_ | 103 #endif // CONTENT_PUBLIC_BROWSER_WEB_UI_DATA_SOURCE_H_ |
| OLD | NEW |