| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/mac/bundle_locations.h" | 8 #include "base/mac/bundle_locations.h" |
| 9 #include "base/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" |
| 10 #include "chrome/browser/ui/browser_finder.h" | 10 #include "chrome/browser/ui/browser_finder.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 [[NSNotificationCenter defaultCenter] | 80 [[NSNotificationCenter defaultCenter] |
| 81 addObserver:self | 81 addObserver:self |
| 82 selector:@selector(findPboardUpdated:) | 82 selector:@selector(findPboardUpdated:) |
| 83 name:kFindPasteboardChangedNotification | 83 name:kFindPasteboardChangedNotification |
| 84 object:[FindPasteboard sharedInstance]]; | 84 object:[FindPasteboard sharedInstance]]; |
| 85 browser_ = browser; | 85 browser_ = browser; |
| 86 } | 86 } |
| 87 return self; | 87 return self; |
| 88 } | 88 } |
| 89 | 89 |
| 90 - (void)dealloc { | 90 - (void)browserWillBeDestroyed { |
| 91 // All animations should have been explicitly stopped before a tab is closed. | 91 // All animations should have been explicitly stopped before a tab is closed. |
| 92 DCHECK(!showHideAnimation_.get()); | 92 DCHECK(!showHideAnimation_.get()); |
| 93 DCHECK(!moveAnimation_.get()); | 93 DCHECK(!moveAnimation_.get()); |
| 94 [[NSNotificationCenter defaultCenter] removeObserver:self]; | 94 [[NSNotificationCenter defaultCenter] removeObserver:self]; |
| 95 [super dealloc]; | 95 browser_ = nullptr; |
| 96 } | 96 } |
| 97 | 97 |
| 98 - (void)setFindBarBridge:(FindBarBridge*)findBarBridge { | 98 - (void)setFindBarBridge:(FindBarBridge*)findBarBridge { |
| 99 DCHECK(!findBarBridge_); // should only be called once. | 99 DCHECK(!findBarBridge_); // should only be called once. |
| 100 findBarBridge_ = findBarBridge; | 100 findBarBridge_ = findBarBridge; |
| 101 } | 101 } |
| 102 | 102 |
| 103 - (void)awakeFromNib { | 103 - (void)awakeFromNib { |
| 104 [[closeButton_ cell] setImageID:IDR_CLOSE_1 | 104 [[closeButton_ cell] setImageID:IDR_CLOSE_1 |
| 105 forButtonState:image_button_cell::kDefaultState]; | 105 forButtonState:image_button_cell::kDefaultState]; |
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 615 } | 615 } |
| 616 | 616 |
| 617 - (BrowserWindowController*)browserWindowController { | 617 - (BrowserWindowController*)browserWindowController { |
| 618 if (!browser_) | 618 if (!browser_) |
| 619 return nil; | 619 return nil; |
| 620 return [BrowserWindowController | 620 return [BrowserWindowController |
| 621 browserWindowControllerForWindow:browser_->window()->GetNativeWindow()]; | 621 browserWindowControllerForWindow:browser_->window()->GetNativeWindow()]; |
| 622 } | 622 } |
| 623 | 623 |
| 624 @end | 624 @end |
| OLD | NEW |