Extract code handling PrinterProviderAPI from PrintPreviewHandler
[chromium-blink-merge.git] / ios / chrome / browser / infobars / infobar.h
blobfead4379dba455435f63e7a3e912b8f8c67dd0e8
1 // Copyright 2012 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_CHROME_BROWSER_INFOBARS_INFOBAR_H_
6 #define IOS_CHROME_BROWSER_INFOBARS_INFOBAR_H_
8 #include "base/mac/scoped_nsobject.h"
9 #include "components/infobars/core/infobar.h"
10 #include "components/infobars/core/infobar_delegate.h"
11 #include "ios/chrome/browser/infobars/infobar_controller.h"
12 #import "ios/public/provider/chrome/browser/ui/infobar_view_delegate.h"
14 // InfoBar for iOS acts as a UIViewController for InfoBarView.
15 class InfoBarIOS : public infobars::InfoBar, public InfoBarViewDelegate {
16 public:
17 explicit InfoBarIOS(scoped_ptr<infobars::InfoBarDelegate> delegate);
18 ~InfoBarIOS() override;
20 // Layouts the infobar using data from delegate and prepare it for adding to
21 // superview.
22 void Layout(CGRect container_bounds);
24 // Returns UIView holding content of this infobar.
25 UIView* view();
27 // Remove the infobar view from infobar container view.
28 void RemoveView();
30 // Sets the controller. Should be called right after the infobar's creation.
31 void SetController(InfoBarController* controller);
33 private:
34 // InfoBar overrides:
35 void PlatformSpecificOnHeightsRecalculated() override;
37 // InfoBarViewDelegate:
38 void SetInfoBarTargetHeight(int height) override;
39 void InfoBarDidCancel() override;
40 void InfoBarButtonDidPress(NSUInteger button_id) override;
42 base::scoped_nsobject<InfoBarController> controller_;
43 DISALLOW_COPY_AND_ASSIGN(InfoBarIOS);
46 #endif // IOS_CHROME_BROWSER_INFOBARS_INFOBAR_H_