Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(114)

Side by Side Diff: ios/web/public/web_ui_ios_data_source.h

Issue 1110213002: Upstream most of the iOS WebUI support in ios/web/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef IOS_WEB_PUBLIC_WEB_UI_IOS_DATA_SOURCE_H_
6 #define IOS_WEB_PUBLIC_WEB_UI_IOS_DATA_SOURCE_H_
7
8 #include "base/callback.h"
9 #include "base/strings/string16.h"
10 #include "base/supports_user_data.h"
11
12 namespace base {
13 class DictionaryValue;
14 class RefCountedMemory;
15 }
16
17 namespace web {
18 class BrowserState;
19
20 // A data source that can help with implementing the common operations needed by
21 // WebUIIOS pages.
22 class WebUIIOSDataSource : public base::SupportsUserData {
23 public:
24 ~WebUIIOSDataSource() override {}
25
Eugene But (OOO till 7-30) 2015/04/28 20:23:01 ditto
26 static WebUIIOSDataSource* Create(const std::string& source_name);
27
28 // Adds a WebUIIOS data source to |browser_state|.
29 static void Add(BrowserState* browser_state, WebUIIOSDataSource* source);
30
31 // Adds a string keyed to its name to our dictionary.
32 virtual void AddString(const std::string& name,
33 const base::string16& value) = 0;
34
35 // Adds a string keyed to its name to our dictionary.
36 virtual void AddString(const std::string& name, const std::string& value) = 0;
37
38 // Adds a localized string with resource |ids| keyed to its name to our
39 // dictionary.
40 virtual void AddLocalizedString(const std::string& name, int ids) = 0;
41
42 // Adds a boolean keyed to its name to our dictionary.
43 virtual void AddBoolean(const std::string& name, bool value) = 0;
44
45 // Sets the path which will return the JSON strings.
46 virtual void SetJsonPath(const std::string& path) = 0;
47
48 // Adds a mapping between a path name and a resource to return.
49 virtual void AddResourcePath(const std::string& path, int resource_id) = 0;
50
51 // Sets the resource to returned when no other paths match.
52 virtual void SetDefaultResource(int resource_id) = 0;
53
54 // The following map to methods on URLDataSource. See the documentation there.
55 virtual void DisableDenyXFrameOptions() = 0;
56 };
57
58 } // namespace web
59
60 #endif // IOS_WEB_PUBLIC_WEB_UI_IOS_DATA_SOURCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698