| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
| 6 #import "chrome/browser/ui/cocoa/translate/translate_infobar_base.h" | 6 #import "chrome/browser/ui/cocoa/translate/translate_infobar_base.h" |
| 7 | 7 |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/sys_string_conversions.h" | 10 #include "base/sys_string_conversions.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 [[AfterTranslateInfobarController alloc] initWithDelegate:this]; | 121 [[AfterTranslateInfobarController alloc] initWithDelegate:this]; |
| 122 break; | 122 break; |
| 123 case TRANSLATING: | 123 case TRANSLATING: |
| 124 case TRANSLATION_ERROR: | 124 case TRANSLATION_ERROR: |
| 125 infobar_controller = | 125 infobar_controller = |
| 126 [[TranslateMessageInfobarController alloc] initWithDelegate:this]; | 126 [[TranslateMessageInfobarController alloc] initWithDelegate:this]; |
| 127 break; | 127 break; |
| 128 default: | 128 default: |
| 129 NOTREACHED(); | 129 NOTREACHED(); |
| 130 } | 130 } |
| 131 return new InfoBar(infobar_controller); | 131 return new InfoBar(infobar_controller, this); |
| 132 } | 132 } |
| 133 | 133 |
| 134 @implementation TranslateInfoBarControllerBase (FrameChangeObserver) | 134 @implementation TranslateInfoBarControllerBase (FrameChangeObserver) |
| 135 | 135 |
| 136 // Triggered when the frame changes. This will figure out what size and | 136 // Triggered when the frame changes. This will figure out what size and |
| 137 // visibility the options popup should be. | 137 // visibility the options popup should be. |
| 138 - (void)didChangeFrame:(NSNotification*)notification { | 138 - (void)didChangeFrame:(NSNotification*)notification { |
| 139 [self adjustOptionsButtonSizeAndVisibilityForView: | 139 [self adjustOptionsButtonSizeAndVisibilityForView: |
| 140 [[self visibleControls] lastObject]]; | 140 [[self visibleControls] lastObject]]; |
| 141 } | 141 } |
| (...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 return false; | 646 return false; |
| 647 } | 647 } |
| 648 previousControl = control; | 648 previousControl = control; |
| 649 } | 649 } |
| 650 | 650 |
| 651 return true; | 651 return true; |
| 652 } | 652 } |
| 653 | 653 |
| 654 @end // TranslateInfoBarControllerBase (TestingAPI) | 654 @end // TranslateInfoBarControllerBase (TestingAPI) |
| 655 | 655 |
| OLD | NEW |