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 "chrome/browser/ui/cocoa/extensions/browser_actions_controller.h" | 5 #import "chrome/browser/ui/cocoa/extensions/browser_actions_controller.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" |
| 10 #include "chrome/browser/extensions/extension_message_bubble_controller.h" | 10 #include "chrome/browser/extensions/extension_message_bubble_controller.h" |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 386 name:kBrowserActionsContainerMouseEntered | 386 name:kBrowserActionsContainerMouseEntered |
| 387 object:containerView_]; | 387 object:containerView_]; |
| 388 } | 388 } |
| 389 | 389 |
| 390 focusedViewIndex_ = -1; | 390 focusedViewIndex_ = -1; |
| 391 } | 391 } |
| 392 | 392 |
| 393 return self; | 393 return self; |
| 394 } | 394 } |
| 395 | 395 |
| 396 - (void)browserWillBeDestroyed { | |
|
tapted
2015/07/06 07:26:18
after dealloc
jackhou1
2015/07/07 03:27:27
Done.
| |
| 397 browser_ = nullptr; | |
| 398 } | |
|
tapted
2015/07/06 07:26:18
hm - toolbarActionsBar_ has a weak reference to Br
jackhou1
2015/07/07 03:27:27
Done in patch set 7.
| |
| 399 | |
| 396 - (void)dealloc { | 400 - (void)dealloc { |
| 397 // Explicitly destroy the ToolbarActionsBar so all buttons get removed with a | 401 // Explicitly destroy the ToolbarActionsBar so all buttons get removed with a |
| 398 // valid BrowserActionsController, and so we can verify state before | 402 // valid BrowserActionsController, and so we can verify state before |
| 399 // destruction. | 403 // destruction. |
| 400 toolbarActionsBar_->DeleteActions(); | 404 toolbarActionsBar_->DeleteActions(); |
| 401 toolbarActionsBar_.reset(); | 405 toolbarActionsBar_.reset(); |
| 402 DCHECK_EQ(0u, [buttons_ count]); | 406 DCHECK_EQ(0u, [buttons_ count]); |
| 403 [[NSNotificationCenter defaultCenter] removeObserver:self]; | 407 [[NSNotificationCenter defaultCenter] removeObserver:self]; |
| 404 [super dealloc]; | 408 [super dealloc]; |
| 405 } | 409 } |
| (...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1027 } | 1031 } |
| 1028 | 1032 |
| 1029 #pragma mark - | 1033 #pragma mark - |
| 1030 #pragma mark Testing Methods | 1034 #pragma mark Testing Methods |
| 1031 | 1035 |
| 1032 - (BrowserActionButton*)buttonWithIndex:(NSUInteger)index { | 1036 - (BrowserActionButton*)buttonWithIndex:(NSUInteger)index { |
| 1033 return index < [buttons_ count] ? [buttons_ objectAtIndex:index] : nil; | 1037 return index < [buttons_ count] ? [buttons_ objectAtIndex:index] : nil; |
| 1034 } | 1038 } |
| 1035 | 1039 |
| 1036 @end | 1040 @end |
| OLD | NEW |