Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / ios / web / webui / crw_web_ui_manager.h
bloba4b805325d6485edecc7bdf0b50b67f62e64647a
1 // Copyright 2015 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.
5 #ifndef IOS_WEB_WEBUI_CRW_WEB_UI_MANAGER_H_
6 #define IOS_WEB_WEBUI_CRW_WEB_UI_MANAGER_H_
8 #import <Foundation/Foundation.h>
10 #import "ios/web/public/web_state/web_state_observer_bridge.h"
11 #import "ios/web/webui/url_fetcher_block_adapter.h"
13 class GURL;
15 namespace web {
16 class WebStateImpl;
17 } // namespace web
19 // Class for managing WebUI pages. Manages fetching of resources and post-load
20 // operations such as favicon loading. Initialized instances of CRWWebUIManager
21 // will automatically register as an observer of webState, and should be kept in
22 // scope for the lifetime of the WebUI page.
23 @interface CRWWebUIManager : NSObject<CRWWebStateObserver>
25 // Designated initializer.
26 - (instancetype)initWithWebState:(web::WebStateImpl*)webState;
28 @end
30 @interface CRWWebUIManager (UsedOnlyForTesting) // Testing API.
32 // Returns URLFetcherBlockAdapter for fetching resource for URL. Can be
33 // overwritten by test classes to mock resource retrieval.
34 - (scoped_ptr<web::URLFetcherBlockAdapter>)
35 fetcherForURL:(const GURL&)URL
36 completionHandler:(web::URLFetcherBlockAdapterCompletion)handler;
38 @end
40 #endif // IOS_WEB_WEBUI_CRW_WEB_UI_MANAGER_H_