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

Unified Diff: ios/chrome/browser/ui/chrome_web_view_factory.h

Issue 2588713002: Upstream Chrome on iOS source code [4/11]. (Closed)
Patch Set: Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/ui/chrome_web_view_factory.h
diff --git a/ios/chrome/browser/ui/chrome_web_view_factory.h b/ios/chrome/browser/ui/chrome_web_view_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..02d9ff6c6082bc3ac7d867f787a6070178577fd3
--- /dev/null
+++ b/ios/chrome/browser/ui/chrome_web_view_factory.h
@@ -0,0 +1,82 @@
+// Copyright 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef IOS_CHROME_BROWSER_UI_CHROME_WEB_VIEW_FACTORY_H_
+#define IOS_CHROME_BROWSER_UI_CHROME_WEB_VIEW_FACTORY_H_
+
+#import <Foundation/Foundation.h>
+#include <string>
+
+#include "base/files/file_path.h"
+#include "base/memory/ref_counted.h"
+#include "base/time/time.h"
+#import "ios/public/provider/chrome/browser/ui/default_ios_web_view_factory.h"
+
+class ChromeBrowserStateIOData;
+
+namespace ios {
+class ChromeBrowserState;
+}
+
+namespace ChromeWebView {
+// Shared desktop user agent used to mimic Safari on a mac.
+extern NSString* const kDesktopUserAgent;
+
+// RequestGroupID for external library, used by tests.
+extern NSString* const kExternalRequestGroupID;
+
+// Gets the external service name, used in tests.
+const std::string GetExternalServiceName(
+ IOSWebViewFactoryExternalService service);
+} // namespace ChromeWebView
+
+namespace net {
+class URLRequestContextGetter;
+}
+
+@interface ChromeWebViewFactory : NSObject<IOSWebViewFactory>
+
+// Sets the browser state that will be used when creating UIWebView's for
+// external libraries. Should be called before each external session.
++ (void)setBrowserStateToUseForExternal:(ios::ChromeBrowserState*)browserState;
+
+// Should be called whenever a external session finishes.
++ (void)externalSessionFinished;
+
+// Returns the request context from the browser state currently set for external
+// library that the given external service should use for any requests that it
+// makes.
++ (net::URLRequestContextGetter*)requestContextForExternalService:
+ (IOSWebViewFactoryExternalService)externalService;
+
+// Gets the partition path associated with an external service.
++ (base::FilePath)partitionPathForExternalService:
+ (IOSWebViewFactoryExternalService)externalService;
+
+// Gets the ChromeBrowserStateIOData associated with external web views.
++ (ChromeBrowserStateIOData*)ioDataForExternalWebViews;
+
+// Clears the cookies for the |contextGetter| and the time interval between
+// |deleteBegin| and |deleteEnd|.
++ (void)clearCookiesForContextGetter:
+ (scoped_refptr<net::URLRequestContextGetter>)contextGetter
+ fromTime:(base::Time)deleteBegin
+ toTime:(base::Time)deleteEnd;
+
+// Clears the cookies from the external request context for the given browser
+// state and the time interval between |deleteBegin| and |deleteEnd|.
++ (void)clearExternalCookies:(IOSWebViewFactoryExternalService)externalService
+ browserState:(ios::ChromeBrowserState*)browserState
+ fromTime:(base::Time)deleteBegin
+ toTime:(base::Time)deleteEnd;
+
+// Clears the cookies in the external request contexts for the given
+// browser state and the time interval between |deleteBegin| and |deleteEnd|.
++ (void)clearExternalCookies:(ios::ChromeBrowserState*)browserState
+ fromTime:(base::Time)deleteBegin
+ toTime:(base::Time)deleteEnd;
+
+@end
+
+#endif // IOS_CHROME_BROWSER_UI_CHROME_WEB_VIEW_FACTORY_H_
« no previous file with comments | « ios/chrome/browser/ui/browser_view_controller_unittest.mm ('k') | ios/chrome/browser/ui/chrome_web_view_factory.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698