web_view_creation_util.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. #ifndef IOS_WEB_COMMON_WEB_VIEW_CREATION_UTIL_H_
  5. #define IOS_WEB_COMMON_WEB_VIEW_CREATION_UTIL_H_
  6. #import <CoreGraphics/CoreGraphics.h>
  7. #import <Foundation/Foundation.h>
  8. @class WKWebView;
  9. namespace web {
  10. class BrowserState;
  11. // Returns a new WKWebView for displaying regular web content.
  12. // WKWebViewConfiguration object for resulting web view will be obtained from
  13. // the given |browser_state|.
  14. //
  15. // Preconditions for creation of a WKWebView:
  16. // 1) |browser_state| is not null.
  17. // 2) web::BrowsingDataPartition is synchronized.
  18. //
  19. WKWebView* BuildWKWebView(CGRect frame, BrowserState* browser_state);
  20. // Returns a new WKWebView that will not be used to display content.
  21. // This WKWebView can be used to fetch some data using the same cookie store
  22. // as the other WKWebView but cannot be presented to the user as some components
  23. // are not initialized (e.g. voice search).
  24. //
  25. // Preconditions for creation of a WKWebView:
  26. // 1) |browser_state| is not null.
  27. // 2) web::BrowsingDataPartition is synchronized.
  28. //
  29. WKWebView* BuildWKWebViewForQueries(BrowserState* browser_state);
  30. } // web
  31. #endif // IOS_WEB_COMMON_WEB_VIEW_CREATION_UTIL_H_