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

Unified Diff: chrome/browser/ui/views/frame/browser_view_layout.cc

Issue 9006027: Rip Out the Sidebar API (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 8 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/frame/browser_view_layout.cc
===================================================================
--- chrome/browser/ui/views/frame/browser_view_layout.cc (revision 116830)
+++ chrome/browser/ui/views/frame/browser_view_layout.cc (working copy)
@@ -4,7 +4,6 @@
#include "chrome/browser/ui/views/frame/browser_view_layout.h"
-#include "chrome/browser/sidebar/sidebar_manager.h"
#include "chrome/browser/ui/find_bar/find_bar.h"
#include "chrome/browser/ui/find_bar/find_bar_controller.h"
#include "chrome/browser/ui/view_ids.h"
@@ -414,48 +413,26 @@
}
void BrowserViewLayout::LayoutTabContents(int top, int bottom) {
- // The ultimate idea is to calcualte bounds and reserved areas for all
+ // The ultimate idea is to calculate bounds and reserved areas for all
// contents views first and then resize them all, so every view
// (and its contents) is resized and laid out only once.
// The views hierarcy (see browser_view.h for more details):
- // 1) Sidebar is not allowed:
- // contents_split_ -> [contents_container_ | devtools]
- // 2) Sidebar is allowed:
- // contents_split_ ->
- // [sidebar_split -> [contents_container_ | sidebar]] | devtools
+ // contents_split_ -> [contents_container_ | devtools]
- gfx::Rect sidebar_split_bounds;
gfx::Rect contents_bounds;
- gfx::Rect sidebar_bounds;
gfx::Rect devtools_bounds;
gfx::Rect contents_split_bounds(vertical_layout_rect_.x(), top,
vertical_layout_rect_.width(),
std::max(0, bottom - top));
- contents_split_->CalculateChildrenBounds(
- contents_split_bounds, &sidebar_split_bounds, &devtools_bounds);
gfx::Point contents_split_offset(
contents_split_bounds.x() - contents_split_->bounds().x(),
contents_split_bounds.y() - contents_split_->bounds().y());
- gfx::Point sidebar_split_offset(contents_split_offset);
- sidebar_split_offset.Offset(sidebar_split_bounds.x(),
- sidebar_split_bounds.y());
- views::SingleSplitView* sidebar_split = browser_view_->sidebar_split_;
- if (sidebar_split) {
- DCHECK(sidebar_split == contents_split_->child_at(0));
- sidebar_split->CalculateChildrenBounds(
- sidebar_split_bounds, &contents_bounds, &sidebar_bounds);
- } else {
- contents_bounds = sidebar_split_bounds;
- }
-
- // Layout resize corner, sidebar mini tabs and calculate reserved contents
- // rects here as all contents view bounds are already determined, but not yet
- // set at this point, so contents will be laid out once at most.
- // TODO(alekseys): layout sidebar minitabs and adjust reserved rect
- // accordingly.
+ // Layout resize corner and calculate reserved contents rects here as all
+ // contents view bounds are already determined, but not yet set at this point,
+ // so contents will be laid out once at most.
gfx::Rect browser_reserved_rect;
if (!browser_view_->frame_->IsMaximized() &&
!browser_view_->frame_->IsFullscreen()) {
@@ -473,13 +450,7 @@
UpdateReservedContentsRect(browser_reserved_rect,
browser_view_->contents_container_,
contents_bounds,
- sidebar_split_offset);
- if (sidebar_split) {
- UpdateReservedContentsRect(browser_reserved_rect,
- browser_view_->sidebar_container_,
- sidebar_bounds,
- sidebar_split_offset);
- }
+ contents_split_offset);
UpdateReservedContentsRect(browser_reserved_rect,
browser_view_->devtools_container_,
devtools_bounds,
@@ -487,8 +458,6 @@
// Now it's safe to actually resize all contents views in the hierarchy.
contents_split_->SetBoundsRect(contents_split_bounds);
- if (sidebar_split)
- sidebar_split->SetBoundsRect(sidebar_split_bounds);
}
int BrowserViewLayout::GetTopMarginForActiveContent() {
@@ -500,13 +469,6 @@
if (contents_split_->child_at(1) && contents_split_->child_at(1)->visible())
return 0;
- if (SidebarManager::IsSidebarAllowed()) {
- views::View* sidebar_split = contents_split_->child_at(0);
- if (sidebar_split->child_count() >= 2 &&
- sidebar_split->child_at(1)->visible())
- return 0;
- }
-
// Adjust for separator.
return active_bookmark_bar_->height() -
views::NonClientFrameView::kClientEdgeThickness;
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.cc ('k') | chrome/browser/ui/views/tab_contents/tab_contents_container.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698