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 "chrome/browser/views/bookmark_bar_view.h" | 5 #include "chrome/browser/views/bookmark_bar_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 if (IsAlwaysShown()) | 405 if (IsAlwaysShown()) |
406 size_animation_->Reset(1); | 406 size_animation_->Reset(1); |
407 else | 407 else |
408 size_animation_->Reset(0); | 408 size_animation_->Reset(0); |
409 } | 409 } |
410 | 410 |
411 BookmarkBarView::~BookmarkBarView() { | 411 BookmarkBarView::~BookmarkBarView() { |
412 NotifyModelChanged(); | 412 NotifyModelChanged(); |
413 if (model_) | 413 if (model_) |
414 model_->RemoveObserver(this); | 414 model_->RemoveObserver(this); |
| 415 |
| 416 // It's possible for the menu to outlive us, reset the observer to make sure |
| 417 // it doesn't have a reference to us. |
| 418 if (bookmark_menu_) |
| 419 bookmark_menu_->set_observer(NULL); |
| 420 |
415 StopShowFolderDropMenuTimer(); | 421 StopShowFolderDropMenuTimer(); |
416 | 422 |
417 if (sync_service_) | 423 if (sync_service_) |
418 sync_service_->RemoveObserver(this); | 424 sync_service_->RemoveObserver(this); |
419 } | 425 } |
420 | 426 |
421 void BookmarkBarView::SetProfile(Profile* profile) { | 427 void BookmarkBarView::SetProfile(Profile* profile) { |
422 DCHECK(profile); | 428 DCHECK(profile); |
423 if (profile_ == profile) | 429 if (profile_ == profile) |
424 return; | 430 return; |
(...skipping 1280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1705 // The tooltip is the only way we have to display text explaining the error | 1711 // The tooltip is the only way we have to display text explaining the error |
1706 // to the user. | 1712 // to the user. |
1707 sync_error_button->SetTooltipText( | 1713 sync_error_button->SetTooltipText( |
1708 l10n_util::GetString(IDS_SYNC_BOOKMARK_BAR_ERROR_DESC)); | 1714 l10n_util::GetString(IDS_SYNC_BOOKMARK_BAR_ERROR_DESC)); |
1709 sync_error_button->SetAccessibleName( | 1715 sync_error_button->SetAccessibleName( |
1710 l10n_util::GetString(IDS_ACCNAME_SYNC_ERROR_BUTTON)); | 1716 l10n_util::GetString(IDS_ACCNAME_SYNC_ERROR_BUTTON)); |
1711 sync_error_button->SetIcon( | 1717 sync_error_button->SetIcon( |
1712 *ResourceBundle::GetSharedInstance().GetBitmapNamed(IDR_WARNING)); | 1718 *ResourceBundle::GetSharedInstance().GetBitmapNamed(IDR_WARNING)); |
1713 return sync_error_button; | 1719 return sync_error_button; |
1714 } | 1720 } |
OLD | NEW |