blob: a4b805325d6485edecc7bdf0b50b67f62e64647a [file] [log] [blame]
// 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.
#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;
@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