OLD | NEW |
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_layout.h" | 5 #include "chrome/browser/ui/views/frame/browser_view_layout.h" |
6 | 6 |
7 #include "chrome/browser/sidebar/sidebar_manager.h" | 7 #include "chrome/browser/sidebar/sidebar_manager.h" |
8 #include "chrome/browser/ui/find_bar/find_bar.h" | 8 #include "chrome/browser/ui/find_bar/find_bar.h" |
9 #include "chrome/browser/ui/find_bar/find_bar_controller.h" | 9 #include "chrome/browser/ui/find_bar/find_bar_controller.h" |
10 #include "chrome/browser/ui/view_ids.h" | 10 #include "chrome/browser/ui/view_ids.h" |
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
549 } else { | 549 } else { |
550 contents_bounds = sidebar_split_bounds; | 550 contents_bounds = sidebar_split_bounds; |
551 } | 551 } |
552 | 552 |
553 // Layout resize corner, sidebar mini tabs and calculate reserved contents | 553 // Layout resize corner, sidebar mini tabs and calculate reserved contents |
554 // rects here as all contents view bounds are already determined, but not yet | 554 // rects here as all contents view bounds are already determined, but not yet |
555 // set at this point, so contents will be laid out once at most. | 555 // set at this point, so contents will be laid out once at most. |
556 // TODO(alekseys): layout sidebar minitabs and adjust reserved rect | 556 // TODO(alekseys): layout sidebar minitabs and adjust reserved rect |
557 // accordingly. | 557 // accordingly. |
558 gfx::Rect browser_reserved_rect; | 558 gfx::Rect browser_reserved_rect; |
559 if (!browser_view_->frame_->GetWindow()->IsMaximized() && | 559 if (!browser_view_->frame_->IsMaximized() && |
560 !browser_view_->frame_->GetWindow()->IsFullscreen()) { | 560 !browser_view_->frame_->IsFullscreen()) { |
561 gfx::Size resize_corner_size = browser_view_->GetResizeCornerSize(); | 561 gfx::Size resize_corner_size = browser_view_->GetResizeCornerSize(); |
562 if (!resize_corner_size.IsEmpty()) { | 562 if (!resize_corner_size.IsEmpty()) { |
563 gfx::Rect bounds = browser_view_->GetContentsBounds(); | 563 gfx::Rect bounds = browser_view_->GetContentsBounds(); |
564 gfx::Point resize_corner_origin( | 564 gfx::Point resize_corner_origin( |
565 bounds.right() - resize_corner_size.width(), | 565 bounds.right() - resize_corner_size.width(), |
566 bounds.bottom() - resize_corner_size.height()); | 566 bounds.bottom() - resize_corner_size.height()); |
567 browser_reserved_rect = | 567 browser_reserved_rect = |
568 gfx::Rect(resize_corner_origin, resize_corner_size); | 568 gfx::Rect(resize_corner_origin, resize_corner_size); |
569 } | 569 } |
570 } | 570 } |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 bottom -= height; | 628 bottom -= height; |
629 } | 629 } |
630 return bottom; | 630 return bottom; |
631 } | 631 } |
632 | 632 |
633 bool BrowserViewLayout::InfobarVisible() const { | 633 bool BrowserViewLayout::InfobarVisible() const { |
634 // NOTE: Can't check if the size IsEmpty() since it's always 0-width. | 634 // NOTE: Can't check if the size IsEmpty() since it's always 0-width. |
635 return browser()->SupportsWindowFeature(Browser::FEATURE_INFOBAR) && | 635 return browser()->SupportsWindowFeature(Browser::FEATURE_INFOBAR) && |
636 (infobar_container_->GetPreferredSize().height() != 0); | 636 (infobar_container_->GetPreferredSize().height() != 0); |
637 } | 637 } |
OLD | NEW |