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

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

Issue 1412833008: Draw the same portion of the frame background behind the tabstrip in maximized (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@match_frame_alignment
Patch Set: Add comment Created 5 years, 1 month 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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.h" 5 #include "chrome/browser/ui/views/frame/browser_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 } 328 }
329 329
330 gfx::Rect GetBoundsForTabStripInBrowserView() const override { 330 gfx::Rect GetBoundsForTabStripInBrowserView() const override {
331 gfx::RectF bounds_f(browser_view_->frame()->GetBoundsForTabStrip( 331 gfx::RectF bounds_f(browser_view_->frame()->GetBoundsForTabStrip(
332 browser_view_->tabstrip())); 332 browser_view_->tabstrip()));
333 views::View::ConvertRectToTarget(browser_view_->parent(), browser_view_, 333 views::View::ConvertRectToTarget(browser_view_->parent(), browser_view_,
334 &bounds_f); 334 &bounds_f);
335 return gfx::ToEnclosingRect(bounds_f); 335 return gfx::ToEnclosingRect(bounds_f);
336 } 336 }
337 337
338 int GetTopInsetInBrowserView() const override { 338 int GetTopInsetInBrowserView(bool restored) const override {
339 return browser_view_->frame()->GetTopInset() - 339 return browser_view_->frame()->GetTopInset(restored) -
340 browser_view_->y(); 340 browser_view_->y();
341 } 341 }
342 342
343 int GetThemeBackgroundXInset() const override { 343 int GetThemeBackgroundXInset() const override {
344 // TODO(pkotwicz): Return the inset with respect to the left edge of the 344 // TODO(pkotwicz): Return the inset with respect to the left edge of the
345 // BrowserView. 345 // BrowserView.
346 return browser_view_->frame()->GetThemeBackgroundXInset(); 346 return browser_view_->frame()->GetThemeBackgroundXInset();
347 } 347 }
348 348
349 bool IsToolbarVisible() const override { 349 bool IsToolbarVisible() const override {
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 tabstrip_->GetPreferredSize().height() : 0; 587 tabstrip_->GetPreferredSize().height() : 0;
588 } 588 }
589 589
590 gfx::Point BrowserView::OffsetPointForToolbarBackgroundImage( 590 gfx::Point BrowserView::OffsetPointForToolbarBackgroundImage(
591 const gfx::Point& point) const { 591 const gfx::Point& point) const {
592 // The background image starts tiling horizontally at the window left edge and 592 // The background image starts tiling horizontally at the window left edge and
593 // vertically at the top edge of the horizontal tab strip (or where it would 593 // vertically at the top edge of the horizontal tab strip (or where it would
594 // be). We expect our parent's origin to be the window origin. 594 // be). We expect our parent's origin to be the window origin.
595 gfx::Point window_point(point + GetMirroredPosition().OffsetFromOrigin()); 595 gfx::Point window_point(point + GetMirroredPosition().OffsetFromOrigin());
596 window_point.Offset(frame_->GetThemeBackgroundXInset(), 596 window_point.Offset(frame_->GetThemeBackgroundXInset(),
597 -frame_->GetTopInset()); 597 -frame_->GetTopInset(false));
598 return window_point; 598 return window_point;
599 } 599 }
600 600
601 bool BrowserView::IsTabStripVisible() const { 601 bool BrowserView::IsTabStripVisible() const {
602 if (immersive_mode_controller_->ShouldHideTopViews() && 602 if (immersive_mode_controller_->ShouldHideTopViews() &&
603 immersive_mode_controller_->ShouldHideTabIndicators()) 603 immersive_mode_controller_->ShouldHideTabIndicators())
604 return false; 604 return false;
605 return browser_->SupportsWindowFeature(Browser::FEATURE_TABSTRIP); 605 return browser_->SupportsWindowFeature(Browser::FEATURE_TABSTRIP);
606 } 606 }
607 607
(...skipping 2034 matching lines...) Expand 10 before | Expand all | Expand 10 after
2642 return immersive_mode_controller()->IsEnabled(); 2642 return immersive_mode_controller()->IsEnabled();
2643 } 2643 }
2644 2644
2645 views::Widget* BrowserView::GetBubbleAssociatedWidget() { 2645 views::Widget* BrowserView::GetBubbleAssociatedWidget() {
2646 return GetWidget(); 2646 return GetWidget();
2647 } 2647 }
2648 2648
2649 gfx::Rect BrowserView::GetTopContainerBoundsInScreen() { 2649 gfx::Rect BrowserView::GetTopContainerBoundsInScreen() {
2650 return top_container_->GetBoundsInScreen(); 2650 return top_container_->GetBoundsInScreen();
2651 } 2651 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698