roll libyuv from 1483 to 1487
[chromium-blink-merge.git] / ios / chrome / browser / infobars / infobar_manager_impl.h
bloba9ee0dc433adc37bd78897d66e821cbef627ee50
1 // Copyright 2014 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_MANAGER_IMPL_H_
6 #define IOS_CHROME_BROWSER_INFOBARS_INFOBAR_MANAGER_IMPL_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "components/infobars/core/infobar_manager.h"
10 #include "ios/web/public/web_state/web_state_observer.h"
11 #include "ios/web/public/web_state/web_state_user_data.h"
13 namespace infobars {
14 class InfoBar;
17 namespace web {
18 struct LoadCommittedDetails;
19 class WebState;
22 // Associates a Tab to an InfoBarManager and manages its lifetime.
23 // It responds to navigation events.
24 class InfoBarManagerImpl : public infobars::InfoBarManager,
25 public web::WebStateObserver,
26 public web::WebStateUserData<InfoBarManagerImpl> {
27 public:
28 // This function must only be called on infobars that are owned by an
29 // InfoBarManagerImpl instance (or not owned at all, in which case this
30 // returns null).
31 static web::WebState* WebStateFromInfoBar(infobars::InfoBar* infobar);
33 private:
34 friend class web::WebStateUserData<InfoBarManagerImpl>;
36 explicit InfoBarManagerImpl(web::WebState* web_state);
37 ~InfoBarManagerImpl() override;
39 // InfoBarManager implementation.
40 int GetActiveEntryID() override;
41 scoped_ptr<infobars::InfoBar> CreateConfirmInfoBar(
42 scoped_ptr<ConfirmInfoBarDelegate> delegate) override;
44 // web::WebStateObserver implementation.
45 void NavigationItemCommitted(
46 const web::LoadCommittedDetails& load_details) override;
47 void WebStateDestroyed() override;
49 DISALLOW_COPY_AND_ASSIGN(InfoBarManagerImpl);
52 #endif // IOS_CHROME_BROWSER_INFOBARS_INFOBAR_MANAGER_IMPL_H_