diff options
author | droger <droger@chromium.org> | 2014-12-19 00:28:45 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-19 08:29:35 +0000 |
commit | 5922f8c9686e4871c61fd276083bc25c9186cad7 (patch) | |
tree | b6b318b580b94b6019c5d0e0a8b706e7374db7ac /ios/chrome/browser/infobars/infobar_container_ios.h | |
parent | 081bd5578343012915bcb079aba951505352eb37 (diff) | |
download | chromium_src-5922f8c9686e4871c61fd276083bc25c9186cad7.zip chromium_src-5922f8c9686e4871c61fd276083bc25c9186cad7.tar.gz chromium_src-5922f8c9686e4871c61fd276083bc25c9186cad7.tar.bz2 |
Upstream ios/chrome/browser/infobars
Review URL: https://codereview.chromium.org/811313002
Cr-Commit-Position: refs/heads/master@{#309167}
Diffstat (limited to 'ios/chrome/browser/infobars/infobar_container_ios.h')
-rw-r--r-- | ios/chrome/browser/infobars/infobar_container_ios.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/ios/chrome/browser/infobars/infobar_container_ios.h b/ios/chrome/browser/infobars/infobar_container_ios.h new file mode 100644 index 0000000..44db6c6 --- /dev/null +++ b/ios/chrome/browser/infobars/infobar_container_ios.h @@ -0,0 +1,45 @@ +// Copyright 2012 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. + +#ifndef IOS_CHROME_BROWSER_INFOBARS_INFOBAR_CONTAINER_IOS_H_ +#define IOS_CHROME_BROWSER_INFOBARS_INFOBAR_CONTAINER_IOS_H_ + +#include "components/infobars/core/infobar_container.h" + +#include "base/mac/scoped_nsobject.h" + +@class InfoBarContainerView; +class InfoBarIOS; + +// IOS infobar container specialization, managing infobars visibility so +// that only the front most one is visible at any time. +class InfoBarContainerIOS : public infobars::InfoBarContainer { + public: + explicit InfoBarContainerIOS(infobars::InfoBarContainer::Delegate* delegate); + ~InfoBarContainerIOS() override; + + // Returns the UIView container. + InfoBarContainerView* view(); + + // Hides the current infobar keeping the current state. If a new infobar is + // added, it will be hidden as well. + void SuspendInfobars(); + + // Restores the normal behavior of the infobars. + void RestoreInfobars(); + + protected: + void PlatformSpecificAddInfoBar(infobars::InfoBar* infobar, + size_t position) override; + void PlatformSpecificRemoveInfoBar(infobars::InfoBar* infobar) override; + void PlatformSpecificInfoBarStateChanged(bool is_animating) override; + + private: + base::scoped_nsobject<InfoBarContainerView> container_view_; + InfoBarContainer::Delegate* delegate_; + + DISALLOW_COPY_AND_ASSIGN(InfoBarContainerIOS); +}; + +#endif // IOS_CHROME_BROWSER_INFOBARS_INFOBAR_CONTAINER_IOS_H_ |