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

Unified Diff: ios/web/webui/crw_web_ui_manager.h

Issue 1137143004: WebUI for WKWebView (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 side-by-side diff with in-line comments
Download patch
Index: ios/web/webui/crw_web_ui_manager.h
diff --git a/ios/web/webui/crw_web_ui_manager.h b/ios/web/webui/crw_web_ui_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..a4b805325d6485edecc7bdf0b50b67f62e64647a
--- /dev/null
+++ b/ios/web/webui/crw_web_ui_manager.h
@@ -0,0 +1,40 @@
+// Copyright 2015 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_WEB_WEBUI_CRW_WEB_UI_MANAGER_H_
+#define IOS_WEB_WEBUI_CRW_WEB_UI_MANAGER_H_
+
+#import <Foundation/Foundation.h>
+
+#import "ios/web/public/web_state/web_state_observer_bridge.h"
+#import "ios/web/webui/url_fetcher_block_adapter.h"
+
+class GURL;
+
+namespace web {
+class WebStateImpl;
+} // namespace web
+
+// Class for managing WebUI pages. Manages fetching of resources and post-load
+// operations such as favicon loading. Initialized instances of CRWWebUIManager
+// will automatically register as an observer of webState, and should be kept in
+// scope for the lifetime of the WebUI page.
+@interface CRWWebUIManager : NSObject<CRWWebStateObserver>
+
+// Designated initializer.
+- (instancetype)initWithWebState:(web::WebStateImpl*)webState;
+
+@end
+
+@interface CRWWebUIManager (UsedOnlyForTesting) // Testing API.
+
+// Returns URLFetcherBlockAdapter for fetching resource for URL. Can be
+// overwritten by test classes to mock resource retrieval.
+- (scoped_ptr<web::URLFetcherBlockAdapter>)
+ fetcherForURL:(const GURL&)URL
+ completionHandler:(web::URLFetcherBlockAdapterCompletion)handler;
+
+@end
+
+#endif // IOS_WEB_WEBUI_CRW_WEB_UI_MANAGER_H_

Powered by Google App Engine
This is Rietveld 408576698