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

Side by Side Diff: chrome/browser/ui/views/toolbar/toolbar_view.cc

Issue 1636703002: Implement MD specs for non-tabbed windows in Ash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix tabstrip bottom edge Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/toolbar/toolbar_view.h" 5 #include "chrome/browser/ui/views/toolbar/toolbar_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/i18n/number_formatting.h" 10 #include "base/i18n/number_formatting.h"
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after
681 #if defined(OS_WIN) 681 #if defined(OS_WIN)
682 ConflictingModuleView::MaybeShow(browser_, app_menu_button_); 682 ConflictingModuleView::MaybeShow(browser_, app_menu_button_);
683 #endif 683 #endif
684 } 684 }
685 incompatibility_badge_showing = true; 685 incompatibility_badge_showing = true;
686 return; 686 return;
687 } 687 }
688 } 688 }
689 689
690 int ToolbarView::PopupTopSpacing() const { 690 int ToolbarView::PopupTopSpacing() const {
691 if (ui::MaterialDesignController::IsModeMaterial())
692 return 0;
693
691 const int kAdditionalPopupTopSpacingNonGlass = 2; 694 const int kAdditionalPopupTopSpacingNonGlass = 2;
692 return views::NonClientFrameView::kClientEdgeThickness + 695 return views::NonClientFrameView::kClientEdgeThickness +
693 (GetWidget()->ShouldWindowContentsBeTransparent() ? 696 (GetWidget()->ShouldWindowContentsBeTransparent() ?
694 0 : kAdditionalPopupTopSpacingNonGlass); 697 0 : kAdditionalPopupTopSpacingNonGlass);
695 } 698 }
696 699
697 gfx::Size ToolbarView::GetSizeInternal( 700 gfx::Size ToolbarView::GetSizeInternal(
698 gfx::Size (View::*get_size)() const) const { 701 gfx::Size (View::*get_size)() const) const {
699 gfx::Size size((location_bar_->*get_size)()); 702 gfx::Size size((location_bar_->*get_size)());
700 if (is_display_mode_normal()) { 703 if (is_display_mode_normal()) {
(...skipping 28 matching lines...) Expand all
729 location_bar_->GetPreferredSize().height()); 732 location_bar_->GetPreferredSize().height());
730 int padding = GetLayoutInsets(TOOLBAR).height(); 733 int padding = GetLayoutInsets(TOOLBAR).height();
731 size.SetToMax(gfx::Size(0, content_height + padding)); 734 size.SetToMax(gfx::Size(0, content_height + padding));
732 } else { 735 } else {
733 gfx::ImageSkia* normal_background = 736 gfx::ImageSkia* normal_background =
734 GetThemeProvider()->GetImageSkiaNamed(IDR_CONTENT_TOP_CENTER); 737 GetThemeProvider()->GetImageSkiaNamed(IDR_CONTENT_TOP_CENTER);
735 size.SetToMax( 738 size.SetToMax(
736 gfx::Size(0, normal_background->height() - content_shadow_height())); 739 gfx::Size(0, normal_background->height() - content_shadow_height()));
737 } 740 }
738 } else if (size.height() == 0) { 741 } else if (size.height() == 0) {
739 // Location mode with a 0 height location bar. If on ash, expand by one 742 // Location mode with a 0 height location bar. For pre-material design Ash,
740 // pixel to show a border in the title bar, otherwise leave the size as zero 743 // expand by one pixel to show a border in the title bar, otherwise leave
741 // height. 744 // the size as zero height.
742 const int kAshBorderSpacing = 1; 745 const int kAshBorderSpacing = 1;
743 if (browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) 746 if (browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH &&
747 !ui::MaterialDesignController::IsModeMaterial()) {
744 size.Enlarge(0, kAshBorderSpacing); 748 size.Enlarge(0, kAshBorderSpacing);
749 }
745 } else { 750 } else {
746 size.Enlarge( 751 size.Enlarge(
747 0, PopupTopSpacing() + views::NonClientFrameView::kClientEdgeThickness); 752 0, PopupTopSpacing() + views::NonClientFrameView::kClientEdgeThickness);
748 } 753 }
749 return size; 754 return size;
750 } 755 }
751 756
752 void ToolbarView::LoadImages() { 757 void ToolbarView::LoadImages() {
753 const ui::ThemeProvider* tp = GetThemeProvider(); 758 const ui::ThemeProvider* tp = GetThemeProvider();
754 759
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 void ToolbarView::OnShowHomeButtonChanged() { 816 void ToolbarView::OnShowHomeButtonChanged() {
812 Layout(); 817 Layout();
813 SchedulePaint(); 818 SchedulePaint();
814 } 819 }
815 820
816 int ToolbarView::content_shadow_height() const { 821 int ToolbarView::content_shadow_height() const {
817 return GetLayoutConstant( 822 return GetLayoutConstant(
818 (browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) ? 823 (browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) ?
819 TOOLBAR_CONTENT_SHADOW_HEIGHT_ASH : TOOLBAR_CONTENT_SHADOW_HEIGHT); 824 TOOLBAR_CONTENT_SHADOW_HEIGHT_ASH : TOOLBAR_CONTENT_SHADOW_HEIGHT);
820 } 825 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698