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

Side by Side Diff: chrome/browser/ui/views/frame/browser_view.cc

Issue 7105026: Delete the download shelf before we destroy the browser (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: " Created 9 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/ui/views/frame/browser_view.h" 5 #include "chrome/browser/ui/views/frame/browser_view.h"
6 6
7 #if defined(TOOLKIT_USES_GTK) 7 #if defined(TOOLKIT_USES_GTK)
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 #endif 9 #endif
10 10
(...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after
941 void BrowserView::SaveFocusedView() { 941 void BrowserView::SaveFocusedView() {
942 views::ViewStorage* view_storage = views::ViewStorage::GetInstance(); 942 views::ViewStorage* view_storage = views::ViewStorage::GetInstance();
943 if (view_storage->RetrieveView(last_focused_view_storage_id_)) 943 if (view_storage->RetrieveView(last_focused_view_storage_id_))
944 view_storage->RemoveView(last_focused_view_storage_id_); 944 view_storage->RemoveView(last_focused_view_storage_id_);
945 views::View* focused_view = GetFocusManager()->GetFocusedView(); 945 views::View* focused_view = GetFocusManager()->GetFocusedView();
946 if (focused_view) 946 if (focused_view)
947 view_storage->StoreView(last_focused_view_storage_id_, focused_view); 947 view_storage->StoreView(last_focused_view_storage_id_, focused_view);
948 } 948 }
949 949
950 void BrowserView::DestroyBrowser() { 950 void BrowserView::DestroyBrowser() {
951 // Explicitly delete the BookmarkBarView now. That way we don't have to 951 // Explicitly delete the BookmarkBarView, DownloadShelfView and child views
952 // worry about the BookmarkBarView potentially outliving the Browser & 952 // owned by BrowserView before destroying |browser_|. That way we don't have
953 // Profile. 953 // to worry about them potentially outliving the Browser & Profile.
954 bookmark_bar_view_.reset(); 954 bookmark_bar_view_.reset();
955 download_shelf_.reset();
956 RemoveAllChildViews(true);
955 browser_.reset(); 957 browser_.reset();
956 } 958 }
957 959
958 bool BrowserView::IsBookmarkBarVisible() const { 960 bool BrowserView::IsBookmarkBarVisible() const {
959 return browser_->SupportsWindowFeature(Browser::FEATURE_BOOKMARKBAR) && 961 return browser_->SupportsWindowFeature(Browser::FEATURE_BOOKMARKBAR) &&
960 active_bookmark_bar_ && 962 active_bookmark_bar_ &&
961 (active_bookmark_bar_->GetPreferredSize().height() != 0); 963 (active_bookmark_bar_->GetPreferredSize().height() != 0);
962 } 964 }
963 965
964 bool BrowserView::IsBookmarkBarAnimating() const { 966 bool BrowserView::IsBookmarkBarAnimating() const {
(...skipping 1636 matching lines...) Expand 10 before | Expand all | Expand 10 after
2601 view->GetWindow()->non_client_view()->SetAccessibleName( 2603 view->GetWindow()->non_client_view()->SetAccessibleName(
2602 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); 2604 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME));
2603 return view; 2605 return view;
2604 } 2606 }
2605 #endif 2607 #endif
2606 2608
2607 // static 2609 // static
2608 FindBar* BrowserWindow::CreateFindBar(Browser* browser) { 2610 FindBar* BrowserWindow::CreateFindBar(Browser* browser) {
2609 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window())); 2611 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window()));
2610 } 2612 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698