1 // Copyright 2013 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_PUBLIC_PROVIDER_CHROME_BROWSER_CHROME_BROWSER_PROVIDER_H_
6 #define IOS_PUBLIC_PROVIDER_CHROME_BROWSER_CHROME_BROWSER_PROVIDER_H_
11 class URLRequestContextGetter
;
18 // TODO(ios): Determine the best way to interface with Obj-C code through
19 // the ChromeBrowserProvider. crbug/298181
22 @protocol InfoBarViewProtocol
;
23 typedef UIView
<InfoBarViewProtocol
> InfoBarViewPlaceholder
;
25 class InfoBarViewPlaceholder
;
31 class ChromeBrowserProvider
;
32 class GeolocationUpdaterProvider
;
34 class UpdatableResourceProvider
;
36 // Setter and getter for the provider. The provider should be set early, before
37 // any browser code is called.
38 void SetChromeBrowserProvider(ChromeBrowserProvider
* provider
);
39 ChromeBrowserProvider
* GetChromeBrowserProvider();
41 // A class that allows embedding iOS-specific functionality in the
42 // ios_chrome_browser target.
43 class ChromeBrowserProvider
{
45 ChromeBrowserProvider();
46 virtual ~ChromeBrowserProvider();
48 // Gets the system URL request context.
49 virtual net::URLRequestContextGetter
* GetSystemURLRequestContext();
50 // Gets the local state.
51 virtual PrefService
* GetLocalState();
52 // Returns an UpdatableResourceProvider instance.
53 virtual UpdatableResourceProvider
* GetUpdatableResourceProvider();
54 // Returns an instance of an infobar view. The caller is responsible for
55 // initializing the returned object and releasing it when appropriate.
56 virtual InfoBarViewPlaceholder
* CreateInfoBarView();
57 // Returns an instance of a string provider.
58 virtual StringProvider
* GetStringProvider();
59 virtual GeolocationUpdaterProvider
* GetGeolocationUpdaterProvider();
60 // Displays the Translate settings screen.
61 virtual void ShowTranslateSettings();
62 // Returns the chrome UI scheme.
63 // TODO(droger): Remove this method once chrome no longer needs to match
65 virtual const char* GetChromeUIScheme();
66 // Sets the alpha property of an UIView with an animation.
67 virtual void SetUIViewAlphaWithAnimation(UIView
* view
, float alpha
);
72 #endif // IOS_PUBLIC_PROVIDER_CHROME_BROWSER_CHROME_BROWSER_PROVIDER_H_