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

Side by Side Diff: chrome/browser/ui/infobar_container_delegate.cc

Issue 2196203002: [Mac] The infobar's top arrow should be hidden while the omnibox popup is shown (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert to the patch set 1 Created 4 years, 4 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/infobar_container_delegate.h" 5 #include "chrome/browser/ui/infobar_container_delegate.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "ui/base/material_design/material_design_controller.h" 8 #include "ui/base/material_design/material_design_controller.h"
9 #include "ui/gfx/animation/slide_animation.h" 9 #include "ui/gfx/animation/slide_animation.h"
10 10
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 63
64 void InfoBarContainerDelegate::SetMaxTopArrowHeight( 64 void InfoBarContainerDelegate::SetMaxTopArrowHeight(
65 int height, 65 int height,
66 infobars::InfoBarContainer* container) { 66 infobars::InfoBarContainer* container) {
67 top_arrow_target_height_ = 67 top_arrow_target_height_ =
68 std::min(std::max(height - GetSeparatorLineHeightForLayout(), 0), 68 std::min(std::max(height - GetSeparatorLineHeightForLayout(), 0),
69 kMaximumArrowTargetHeight); 69 kMaximumArrowTargetHeight);
70 container->UpdateInfoBarArrowTargetHeights(); 70 container->UpdateInfoBarArrowTargetHeights();
71 } 71 }
72 72
73 int InfoBarContainerDelegate::DefaultMaxTopArrowHeight() const {
74 return GetDefaultArrowTargetHeight();
75 }
76
73 int InfoBarContainerDelegate::ArrowTargetHeightForInfoBar( 77 int InfoBarContainerDelegate::ArrowTargetHeightForInfoBar(
74 size_t index, 78 size_t index,
75 const gfx::SlideAnimation& animation) const { 79 const gfx::SlideAnimation& animation) const {
76 if (!DrawInfoBarArrows(nullptr)) 80 if (!DrawInfoBarArrows(nullptr))
77 return 0; 81 return 0;
78 if (index == 0) 82 if (index == 0)
79 return top_arrow_target_height_; 83 return top_arrow_target_height_;
80 if ((index > 1) || animation.IsShowing()) 84 if ((index > 1) || animation.IsShowing())
81 return GetDefaultArrowTargetHeight(); 85 return GetDefaultArrowTargetHeight();
82 // When the first infobar is animating closed, we animate the second infobar's 86 // When the first infobar is animating closed, we animate the second infobar's
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 if (*arrow_height && !ui::MaterialDesignController::IsModeMaterial()) 127 if (*arrow_height && !ui::MaterialDesignController::IsModeMaterial())
124 *arrow_height += GetSeparatorLineHeightForLayout(); 128 *arrow_height += GetSeparatorLineHeightForLayout();
125 129
126 int target_height = bar_target_height != -1 130 int target_height = bar_target_height != -1
127 ? bar_target_height 131 ? bar_target_height
128 : ui::MaterialDesignController::IsModeMaterial() 132 : ui::MaterialDesignController::IsModeMaterial()
129 ? kDefaultBarTargetHeightMd 133 ? kDefaultBarTargetHeightMd
130 : kDefaultBarTargetHeight; 134 : kDefaultBarTargetHeight;
131 *bar_height = animation.CurrentValueBetween(0, target_height); 135 *bar_height = animation.CurrentValueBetween(0, target_height);
132 } 136 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698