diff options
author | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-03 19:51:33 +0000 |
---|---|---|
committer | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-03 19:51:33 +0000 |
commit | 6e73472fa6749ec5cfe7bbe961ca0487d0a43bb3 (patch) | |
tree | 93ca6ac939e843f3e41d9ab674af1ae04c0a7cbe /chrome/browser/views/frame/browser_view.cc | |
parent | 67e4a1e97749307ead19746a1b81f36efcaa6589 (diff) | |
download | chromium_src-6e73472fa6749ec5cfe7bbe961ca0487d0a43bb3.zip chromium_src-6e73472fa6749ec5cfe7bbe961ca0487d0a43bb3.tar.gz chromium_src-6e73472fa6749ec5cfe7bbe961ca0487d0a43bb3.tar.bz2 |
Revert "Use grit to generate locale rc files and remove the old locale rc files from the tree."
Revert "window_ is null during BrowserWindow creation. Assume full screen"
Revert "Move SupportsWindowFeature from BrowserView to Browser so"
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10814 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/frame/browser_view.cc')
-rw-r--r-- | chrome/browser/views/frame/browser_view.cc | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc index fc0bca3..de73484 100644 --- a/chrome/browser/views/frame/browser_view.cc +++ b/chrome/browser/views/frame/browser_view.cc @@ -323,12 +323,12 @@ int BrowserView::GetTabStripHeight() const { } bool BrowserView::IsToolbarVisible() const { - return browser_->SupportsWindowFeature(Browser::FEATURE_TOOLBAR) || - browser_->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR); + return SupportsWindowFeature(FEATURE_TOOLBAR) || + SupportsWindowFeature(FEATURE_LOCATIONBAR); } bool BrowserView::IsTabStripVisible() const { - return browser_->SupportsWindowFeature(Browser::FEATURE_TABSTRIP); + return SupportsWindowFeature(FEATURE_TABSTRIP); } bool BrowserView::IsOffTheRecord() const { @@ -706,7 +706,7 @@ void BrowserView::DestroyBrowser() { } bool BrowserView::IsBookmarkBarVisible() const { - return browser_->SupportsWindowFeature(Browser::FEATURE_BOOKMARKBAR) && + return SupportsWindowFeature(FEATURE_BOOKMARKBAR) && active_bookmark_bar_ && (active_bookmark_bar_->GetPreferredSize().height() != 0); } @@ -972,7 +972,7 @@ views::View* BrowserView::GetInitiallyFocusedView() { } bool BrowserView::ShouldShowWindowTitle() const { - return browser_->SupportsWindowFeature(Browser::FEATURE_TITLEBAR); + return SupportsWindowFeature(FEATURE_TITLEBAR); } SkBitmap BrowserView::GetWindowIcon() { @@ -982,7 +982,7 @@ SkBitmap BrowserView::GetWindowIcon() { } bool BrowserView::ShouldShowWindowIcon() const { - return browser_->SupportsWindowFeature(Browser::FEATURE_TITLEBAR); + return SupportsWindowFeature(FEATURE_TITLEBAR); } bool BrowserView::ExecuteWindowsCommand(int command_id) { @@ -1289,6 +1289,21 @@ void BrowserView::InitSystemMenu() { } } +bool BrowserView::SupportsWindowFeature(WindowFeature feature) const { + unsigned int features = FEATURE_INFOBAR | FEATURE_DOWNLOADSHELF; + if (IsBrowserTypeNormal()) + features |= FEATURE_BOOKMARKBAR; + if (!fullscreen_) { + if (IsBrowserTypeNormal()) + features |= FEATURE_TABSTRIP | FEATURE_TOOLBAR; + else + features |= FEATURE_TITLEBAR; + if ((browser_->type() & Browser::TYPE_APP) == 0) + features |= FEATURE_LOCATIONBAR; + } + return !!(features & feature); +} + bool BrowserView::ShouldForwardToTabStrip( const views::DropTargetEvent& event) { if (!tabstrip_->IsVisible()) @@ -1380,7 +1395,7 @@ int BrowserView::LayoutBookmarkBar(int top) { } int BrowserView::LayoutInfoBar(int top) { - bool visible = browser_->SupportsWindowFeature(Browser::FEATURE_INFOBAR); + bool visible = SupportsWindowFeature(FEATURE_INFOBAR); int height = visible ? infobar_container_->GetPreferredSize().height() : 0; infobar_container_->SetVisible(visible); infobar_container_->SetBounds(0, top, width(), height); @@ -1394,8 +1409,7 @@ void BrowserView::LayoutTabContents(int top, int bottom) { int BrowserView::LayoutDownloadShelf() { int bottom = height(); if (active_download_shelf_) { - bool visible = browser_->SupportsWindowFeature( - Browser::FEATURE_DOWNLOADSHELF); + bool visible = SupportsWindowFeature(FEATURE_DOWNLOADSHELF); int height = visible ? active_download_shelf_->GetPreferredSize().height() : 0; active_download_shelf_->SetVisible(visible); @@ -1419,8 +1433,7 @@ void BrowserView::LayoutStatusBubble(int top) { bool BrowserView::MaybeShowBookmarkBar(TabContents* contents) { views::View* new_bookmark_bar_view = NULL; - if (browser_->SupportsWindowFeature(Browser::FEATURE_BOOKMARKBAR) - && contents) { + if (SupportsWindowFeature(FEATURE_BOOKMARKBAR) && contents) { if (!bookmark_bar_view_.get()) { bookmark_bar_view_.reset(new BookmarkBarView(contents->profile(), browser_.get())); |