| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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/frame/browser_view.h" | 5 #include "chrome/browser/views/frame/browser_view.h" |
| 6 | 6 |
| 7 #include "app/drag_drop_types.h" | 7 #include "app/drag_drop_types.h" |
| 8 #include "app/gfx/canvas.h" | 8 #include "app/gfx/canvas.h" |
| 9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "app/os_exchange_data.h" | 10 #include "app/os_exchange_data.h" |
| (...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 860 void BrowserView::ShowBookmarkBubble(const GURL& url, bool already_bookmarked) { | 860 void BrowserView::ShowBookmarkBubble(const GURL& url, bool already_bookmarked) { |
| 861 toolbar_->star_button()->ShowStarBubble(url, !already_bookmarked); | 861 toolbar_->star_button()->ShowStarBubble(url, !already_bookmarked); |
| 862 } | 862 } |
| 863 | 863 |
| 864 void BrowserView::SetDownloadShelfVisible(bool visible) { | 864 void BrowserView::SetDownloadShelfVisible(bool visible) { |
| 865 // This can be called from the superclass destructor, when it destroys our | 865 // This can be called from the superclass destructor, when it destroys our |
| 866 // child views. At that point, browser_ is already gone. | 866 // child views. At that point, browser_ is already gone. |
| 867 if (browser_ == NULL) | 867 if (browser_ == NULL) |
| 868 return; | 868 return; |
| 869 | 869 |
| 870 if (IsDownloadShelfVisible() != visible) { | 870 if (visible && IsDownloadShelfVisible() != visible) |
| 871 if (visible) { | 871 // Invoke GetDownloadShelf to force the shelf to be created. |
| 872 // Invoke GetDownloadShelf to force the shelf to be created. | 872 GetDownloadShelf(); |
| 873 GetDownloadShelf(); | |
| 874 } | |
| 875 | 873 |
| 876 if (browser_ != NULL) | 874 if (browser_ != NULL) |
| 877 browser_->UpdateDownloadShelfVisibility(visible); | 875 browser_->UpdateDownloadShelfVisibility(visible); |
| 878 } | |
| 879 | 876 |
| 880 // SetDownloadShelfVisible can force-close the shelf, so make sure we lay out | 877 // SetDownloadShelfVisible can force-close the shelf, so make sure we lay out |
| 881 // everything correctly, as if the animation had finished. This doesn't | 878 // everything correctly, as if the animation had finished. This doesn't |
| 882 // matter for showing the shelf, as the show animation will do it. | 879 // matter for showing the shelf, as the show animation will do it. |
| 883 SelectedTabToolbarSizeChanged(false); | 880 SelectedTabToolbarSizeChanged(false); |
| 884 } | 881 } |
| 885 | 882 |
| 886 bool BrowserView::IsDownloadShelfVisible() const { | 883 bool BrowserView::IsDownloadShelfVisible() const { |
| 887 return download_shelf_.get() && download_shelf_->IsShowing(); | 884 return download_shelf_.get() && download_shelf_->IsShowing(); |
| 888 } | 885 } |
| (...skipping 1065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1954 | 1951 |
| 1955 // static | 1952 // static |
| 1956 FindBar* BrowserWindow::CreateFindBar(Browser* browser) { | 1953 FindBar* BrowserWindow::CreateFindBar(Browser* browser) { |
| 1957 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window())); | 1954 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window())); |
| 1958 } | 1955 } |
| 1959 | 1956 |
| 1960 // static | 1957 // static |
| 1961 void BrowserList::AllBrowsersClosed() { | 1958 void BrowserList::AllBrowsersClosed() { |
| 1962 views::Window::CloseAllSecondaryWindows(); | 1959 views::Window::CloseAllSecondaryWindows(); |
| 1963 } | 1960 } |
| OLD | NEW |