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

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

Issue 329009: CompactNavigationBar for toolkit views build, with some design change per Cole's request. (Closed)
Patch Set: updates per review Created 11 years, 2 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
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #if defined(OS_LINUX) 7 #if defined(OS_LINUX)
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 #endif 9 #endif
10 10
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 // So return what the tabstrip height _ought_ to be right now. 561 // So return what the tabstrip height _ought_ to be right now.
562 return IsTabStripVisible() ? tabstrip_->GetView()->GetPreferredSize().height() 562 return IsTabStripVisible() ? tabstrip_->GetView()->GetPreferredSize().height()
563 : 0; 563 : 0;
564 } 564 }
565 565
566 gfx::Rect BrowserView::GetTabStripBounds() const { 566 gfx::Rect BrowserView::GetTabStripBounds() const {
567 return frame_->GetBoundsForTabStrip(tabstrip_); 567 return frame_->GetBoundsForTabStrip(tabstrip_);
568 } 568 }
569 569
570 bool BrowserView::IsToolbarVisible() const { 570 bool BrowserView::IsToolbarVisible() const {
571 #if defined(OS_CHROMEOS) 571 if (browser_extender_->ShouldForceHideToolbar())
572 if (browser_->type() & Browser::TYPE_POPUP) {
573 // Don't show toolbar if the window is a popup.
574 return false; 572 return false;
575 }
576 #endif
577 return browser_->SupportsWindowFeature(Browser::FEATURE_TOOLBAR) || 573 return browser_->SupportsWindowFeature(Browser::FEATURE_TOOLBAR) ||
578 browser_->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR); 574 browser_->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR);
579 } 575 }
580 576
581 bool BrowserView::IsTabStripVisible() const { 577 bool BrowserView::IsTabStripVisible() const {
582 return browser_->SupportsWindowFeature(Browser::FEATURE_TABSTRIP); 578 return browser_->SupportsWindowFeature(Browser::FEATURE_TABSTRIP);
583 } 579 }
584 580
585 bool BrowserView::IsOffTheRecord() const { 581 bool BrowserView::IsOffTheRecord() const {
586 return browser_->profile()->IsOffTheRecord(); 582 return browser_->profile()->IsOffTheRecord();
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after
1192 NativeWebKeyboardEvent::AltKey); 1188 NativeWebKeyboardEvent::AltKey);
1193 1189
1194 std::map<views::Accelerator, int>::const_iterator iter = 1190 std::map<views::Accelerator, int>::const_iterator iter =
1195 accelerator_table_.find(accelerator); 1191 accelerator_table_.find(accelerator);
1196 if (iter == accelerator_table_.end()) 1192 if (iter == accelerator_table_.end())
1197 return -1; 1193 return -1;
1198 1194
1199 return iter->second; 1195 return iter->second;
1200 } 1196 }
1201 1197
1198 #if defined(TOOLKIT_VIEWS)
1199 void BrowserView::ToggleCompactNavigationBar() {
1200 browser_extender_->ToggleCompactNavigationBar();
1201 Layout();
1202 }
1203 #endif
1204
1202 /////////////////////////////////////////////////////////////////////////////// 1205 ///////////////////////////////////////////////////////////////////////////////
1203 // BrowserView, BrowserWindowTesting implementation: 1206 // BrowserView, BrowserWindowTesting implementation:
1204 1207
1205 BookmarkBarView* BrowserView::GetBookmarkBarView() const { 1208 BookmarkBarView* BrowserView::GetBookmarkBarView() const {
1206 return bookmark_bar_view_.get(); 1209 return bookmark_bar_view_.get();
1207 } 1210 }
1208 1211
1209 LocationBarView* BrowserView::GetLocationBarView() const { 1212 LocationBarView* BrowserView::GetLocationBarView() const {
1210 return toolbar_->location_bar(); 1213 return toolbar_->location_bar();
1211 } 1214 }
(...skipping 1041 matching lines...) Expand 10 before | Expand all | Expand 10 after
2253 2256
2254 // static 2257 // static
2255 FindBar* BrowserWindow::CreateFindBar(Browser* browser) { 2258 FindBar* BrowserWindow::CreateFindBar(Browser* browser) {
2256 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window())); 2259 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window()));
2257 } 2260 }
2258 2261
2259 // static 2262 // static
2260 void BrowserList::AllBrowsersClosed() { 2263 void BrowserList::AllBrowsersClosed() {
2261 views::Window::CloseAllSecondaryWindows(); 2264 views::Window::CloseAllSecondaryWindows();
2262 } 2265 }
OLDNEW
« no previous file with comments | « chrome/browser/views/frame/browser_view.h ('k') | chrome/browser/views/frame/standard_extender.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698