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

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

Issue 1891483005: [ios] Added API to enable/disable web usage for WebState. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Self review Created 4 years, 8 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
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_H_ 5 #ifndef IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_H_
6 #define IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_H_ 6 #define IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 resized, there should be a single returned bitmap. */ 83 resized, there should be a single returned bitmap. */
84 const std::vector<gfx::Size>&)> 84 const std::vector<gfx::Size>&)>
85 ImageDownloadCallback; 85 ImageDownloadCallback;
86 86
87 ~WebState() override {} 87 ~WebState() override {}
88 88
89 // Gets/Sets the delegate. 89 // Gets/Sets the delegate.
90 virtual WebStateDelegate* GetDelegate() = 0; 90 virtual WebStateDelegate* GetDelegate() = 0;
91 virtual void SetDelegate(WebStateDelegate* delegate) = 0; 91 virtual void SetDelegate(WebStateDelegate* delegate) = 0;
92 92
93 // Whether or not a web view is allowed to exist in this WebState. Defaults
94 // to false; this should be enabled before attempting to access the view.
95 virtual bool IsWebUsageEnabled() const = 0;
96 virtual void SetWebUsageEnabled(bool enabled) = 0;
97
93 // The view containing the contents of the current web page. If the view has 98 // The view containing the contents of the current web page. If the view has
94 // been purged due to low memory, this will recreate it. It is up to the 99 // been purged due to low memory, this will recreate it. It is up to the
95 // caller to size the view. 100 // caller to size the view.
96 virtual UIView* GetView() = 0; 101 virtual UIView* GetView() = 0;
97 102
98 // Gets the BrowserState associated with this WebState. Can never return null. 103 // Gets the BrowserState associated with this WebState. Can never return null.
99 virtual BrowserState* GetBrowserState() const = 0; 104 virtual BrowserState* GetBrowserState() const = 0;
100 105
101 // Opens a URL with the given disposition. The transition specifies how this 106 // Opens a URL with the given disposition. The transition specifies how this
102 // navigation should be recorded in the history system (for example, typed). 107 // navigation should be recorded in the history system (for example, typed).
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 240
236 // Returns a WeakPtr<WebState> to the current WebState. Must remain private 241 // Returns a WeakPtr<WebState> to the current WebState. Must remain private
237 // and only call must be in WebStateWeakPtrFactory. Please consult that class 242 // and only call must be in WebStateWeakPtrFactory. Please consult that class
238 // for more details. Remove as part of http://crbug.com/556736. 243 // for more details. Remove as part of http://crbug.com/556736.
239 virtual base::WeakPtr<WebState> AsWeakPtr() = 0; 244 virtual base::WeakPtr<WebState> AsWeakPtr() = 0;
240 }; 245 };
241 246
242 } // namespace web 247 } // namespace web
243 248
244 #endif // IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_H_ 249 #endif // IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_H_
OLDNEW
« no previous file with comments | « ios/web/public/test/test_web_state.mm ('k') | ios/web/shell/DEPS » ('j') | ios/web/shell/DEPS » ('J')

Powered by Google App Engine
This is Rietveld 408576698