OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ios/chrome/browser/infobars/infobar_container_ios.h" | 5 #include "ios/chrome/browser/infobars/infobar_container_ios.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #import <UIKit/UIKit.h> | 8 #import <UIKit/UIKit.h> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/threading/thread_task_runner_handle.h" | 11 #include "base/threading/thread_task_runner_handle.h" |
12 #include "ios/chrome/browser/infobars/infobar.h" | 12 #include "ios/chrome/browser/infobars/infobar.h" |
13 #include "ios/chrome/browser/infobars/infobar_container_view.h" | 13 #include "ios/chrome/browser/infobars/infobar_container_view.h" |
14 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" | 14 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" |
15 | 15 |
| 16 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 17 #error "This file requires ARC support." |
| 18 #endif |
| 19 |
16 InfoBarContainerIOS::InfoBarContainerIOS( | 20 InfoBarContainerIOS::InfoBarContainerIOS( |
17 infobars::InfoBarContainer::Delegate* delegate) | 21 infobars::InfoBarContainer::Delegate* delegate) |
18 : InfoBarContainer(delegate), delegate_(delegate) { | 22 : InfoBarContainer(delegate), delegate_(delegate) { |
19 DCHECK(delegate); | 23 DCHECK(delegate); |
20 container_view_.reset([[InfoBarContainerView alloc] init]); | 24 container_view_.reset([[InfoBarContainerView alloc] init]); |
21 [container_view_ setAutoresizingMask:UIViewAutoresizingFlexibleWidth | | 25 [container_view_ setAutoresizingMask:UIViewAutoresizingFlexibleWidth | |
22 UIViewAutoresizingFlexibleTopMargin]; | 26 UIViewAutoresizingFlexibleTopMargin]; |
23 } | 27 } |
24 | 28 |
25 InfoBarContainerIOS::~InfoBarContainerIOS() { | 29 InfoBarContainerIOS::~InfoBarContainerIOS() { |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 | 67 |
64 void InfoBarContainerIOS::SuspendInfobars() { | 68 void InfoBarContainerIOS::SuspendInfobars() { |
65 ios::GetChromeBrowserProvider()->SetUIViewAlphaWithAnimation(container_view_, | 69 ios::GetChromeBrowserProvider()->SetUIViewAlphaWithAnimation(container_view_, |
66 0); | 70 0); |
67 } | 71 } |
68 | 72 |
69 void InfoBarContainerIOS::RestoreInfobars() { | 73 void InfoBarContainerIOS::RestoreInfobars() { |
70 ios::GetChromeBrowserProvider()->SetUIViewAlphaWithAnimation(container_view_, | 74 ios::GetChromeBrowserProvider()->SetUIViewAlphaWithAnimation(container_view_, |
71 1); | 75 1); |
72 } | 76 } |
OLD | NEW |