Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(219)

Side by Side Diff: chrome/browser/views/bookmark_bar_view.cc

Issue 1664001: Fixes possible crash if the window hosting a menu was closed while the (Closed)
Patch Set: Incorporated review feedback Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/views/bookmark_bar_view_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/views/bookmark_bar_view_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698