OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "base/logging.h" | 5 #include "base/logging.h" |
6 #include "base/mac_util.h" | 6 #include "base/mac_util.h" |
7 #import "chrome/browser/cocoa/animatable_view.h" | 7 #import "chrome/browser/cocoa/animatable_view.h" |
8 #include "chrome/browser/cocoa/infobar.h" | 8 #include "chrome/browser/cocoa/infobar.h" |
9 #import "chrome/browser/cocoa/infobar_container_controller.h" | 9 #import "chrome/browser/cocoa/infobar_container_controller.h" |
10 #import "chrome/browser/cocoa/infobar_controller.h" | 10 #import "chrome/browser/cocoa/infobar_controller.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 case NotificationType::TAB_CONTENTS_INFOBAR_ADDED: | 31 case NotificationType::TAB_CONTENTS_INFOBAR_ADDED: |
32 [controller_ addInfoBar:Details<InfoBarDelegate>(details).ptr() | 32 [controller_ addInfoBar:Details<InfoBarDelegate>(details).ptr() |
33 animate:YES]; | 33 animate:YES]; |
34 break; | 34 break; |
35 case NotificationType::TAB_CONTENTS_INFOBAR_REMOVED: | 35 case NotificationType::TAB_CONTENTS_INFOBAR_REMOVED: |
36 [controller_ | 36 [controller_ |
37 closeInfoBarsForDelegate:Details<InfoBarDelegate>(details).ptr() | 37 closeInfoBarsForDelegate:Details<InfoBarDelegate>(details).ptr() |
38 animate:YES]; | 38 animate:YES]; |
39 break; | 39 break; |
40 case NotificationType::TAB_CONTENTS_INFOBAR_REPLACED: { | 40 case NotificationType::TAB_CONTENTS_INFOBAR_REPLACED: { |
41 typedef std::pair<InfoBarDelegate*, InfoBarDelegate*> | 41 typedef std::pair<InfoBarDelegate*, InfoBarDelegate*> DelegatePair; |
42 InfoBarDelegatePair; | 42 DelegatePair* delegate_pair = Details<DelegatePair>(details).ptr(); |
43 InfoBarDelegatePair* delegates = | 43 [controller_ replaceInfoBarsForDelegate:delegate_pair->first |
44 Details<InfoBarDelegatePair>(details).ptr(); | 44 with:delegate_pair->second]; |
45 [controller_ | |
46 replaceInfoBarsForDelegate:delegates->first with:delegates->second]; | |
47 break; | 45 break; |
48 } | 46 } |
49 default: | 47 default: |
50 NOTREACHED(); // we don't ask for anything else! | 48 NOTREACHED(); // we don't ask for anything else! |
51 break; | 49 break; |
52 } | 50 } |
53 | 51 |
54 [controller_ positionInfoBarsAndRedraw]; | 52 [controller_ positionInfoBarsAndRedraw]; |
55 } | 53 } |
56 | 54 |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 frame.size.width = NSWidth(containerBounds); | 217 frame.size.width = NSWidth(containerBounds); |
220 frame.origin.y = minY; | 218 frame.origin.y = minY; |
221 minY += frame.size.height; | 219 minY += frame.size.height; |
222 [view setFrame:frame]; | 220 [view setFrame:frame]; |
223 } | 221 } |
224 | 222 |
225 [resizeDelegate_ resizeView:[self view] newHeight:[self desiredHeight]]; | 223 [resizeDelegate_ resizeView:[self view] newHeight:[self desiredHeight]]; |
226 } | 224 } |
227 | 225 |
228 @end | 226 @end |
OLD | NEW |