Chromium Code Reviews| 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)browserWillBeDestroyed { | |
|
tapted
2015/07/06 07:26:18
after dealloc
jackhou1
2015/07/07 03:27:27
Done.
| |
| 91 browser_ = nullptr; | |
| 92 } | |
| 93 | |
| 90 - (void)dealloc { | 94 - (void)dealloc { |
| 91 // All animations should have been explicitly stopped before a tab is closed. | 95 // All animations should have been explicitly stopped before a tab is closed. |
| 92 DCHECK(!showHideAnimation_.get()); | 96 DCHECK(!showHideAnimation_.get()); |
| 93 DCHECK(!moveAnimation_.get()); | 97 DCHECK(!moveAnimation_.get()); |
| 94 [[NSNotificationCenter defaultCenter] removeObserver:self]; | 98 [[NSNotificationCenter defaultCenter] removeObserver:self]; |
| 95 [super dealloc]; | 99 [super dealloc]; |
| 96 } | 100 } |
| 97 | 101 |
| 98 - (void)setFindBarBridge:(FindBarBridge*)findBarBridge { | 102 - (void)setFindBarBridge:(FindBarBridge*)findBarBridge { |
| 99 DCHECK(!findBarBridge_); // should only be called once. | 103 DCHECK(!findBarBridge_); // should only be called once. |
| (...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 615 } | 619 } |
| 616 | 620 |
| 617 - (BrowserWindowController*)browserWindowController { | 621 - (BrowserWindowController*)browserWindowController { |
| 618 if (!browser_) | 622 if (!browser_) |
| 619 return nil; | 623 return nil; |
| 620 return [BrowserWindowController | 624 return [BrowserWindowController |
| 621 browserWindowControllerForWindow:browser_->window()->GetNativeWindow()]; | 625 browserWindowControllerForWindow:browser_->window()->GetNativeWindow()]; |
| 622 } | 626 } |
| 623 | 627 |
| 624 @end | 628 @end |
| OLD | NEW |