Commit c1d1aef1 authored by Peter Kasting's avatar Peter Kasting Committed by Commit Bot

Remove GetInfoBarSeparatorColor() and compute it directly.

This was just needless indirection.

BUG=none
TEST=none
TBR=rohitrao

Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: I9b052d50e21b29e5a18181c99f0b4be974e10046
Reviewed-on: https://chromium-review.googlesource.com/987101Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Reviewed-by: default avatarEvan Stade <estade@chromium.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#547058}
parent 6ce63e96
...@@ -27,7 +27,6 @@ class InfoBarContainerCocoa : public infobars::InfoBarContainer, ...@@ -27,7 +27,6 @@ class InfoBarContainerCocoa : public infobars::InfoBarContainer,
void PlatformSpecificRemoveInfoBar(infobars::InfoBar* infobar) override; void PlatformSpecificRemoveInfoBar(infobars::InfoBar* infobar) override;
// InfoBarContainerDelegate: // InfoBarContainerDelegate:
SkColor GetInfoBarSeparatorColor() const override;
void InfoBarContainerStateChanged(bool is_animating) override; void InfoBarContainerStateChanged(bool is_animating) override;
bool DrawInfoBarArrows(int* x) const override; bool DrawInfoBarArrows(int* x) const override;
......
...@@ -30,10 +30,6 @@ void InfoBarContainerCocoa::PlatformSpecificRemoveInfoBar( ...@@ -30,10 +30,6 @@ void InfoBarContainerCocoa::PlatformSpecificRemoveInfoBar(
[controller_ removeInfoBar:infobar_cocoa]; [controller_ removeInfoBar:infobar_cocoa];
} }
SkColor InfoBarContainerCocoa::GetInfoBarSeparatorColor() const {
return SK_ColorBLACK;
}
void InfoBarContainerCocoa::InfoBarContainerStateChanged(bool is_animating) { void InfoBarContainerCocoa::InfoBarContainerStateChanged(bool is_animating) {
[controller_ positionInfoBarsAndRedraw:is_animating]; [controller_ positionInfoBarsAndRedraw:is_animating];
} }
......
...@@ -2149,11 +2149,6 @@ void BrowserView::OnOmniboxPopupShownOrHidden() { ...@@ -2149,11 +2149,6 @@ void BrowserView::OnOmniboxPopupShownOrHidden() {
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// BrowserView, InfoBarContainerDelegate overrides: // BrowserView, InfoBarContainerDelegate overrides:
SkColor BrowserView::GetInfoBarSeparatorColor() const {
return GetThemeProvider()->GetColor(
ThemeProperties::COLOR_DETACHED_BOOKMARK_BAR_SEPARATOR);
}
void BrowserView::InfoBarContainerStateChanged(bool is_animating) { void BrowserView::InfoBarContainerStateChanged(bool is_animating) {
ToolbarSizeChanged(is_animating); ToolbarSizeChanged(is_animating);
} }
......
...@@ -445,7 +445,6 @@ class BrowserView : public BrowserWindow, ...@@ -445,7 +445,6 @@ class BrowserView : public BrowserWindow,
gfx::Size GetMinimumSize() const override; gfx::Size GetMinimumSize() const override;
// InfoBarContainerDelegate: // InfoBarContainerDelegate:
SkColor GetInfoBarSeparatorColor() const override;
void InfoBarContainerStateChanged(bool is_animating) override; void InfoBarContainerStateChanged(bool is_animating) override;
bool DrawInfoBarArrows(int* x) const override; bool DrawInfoBarArrows(int* x) const override;
......
...@@ -6,10 +6,12 @@ ...@@ -6,10 +6,12 @@
#include "cc/paint/paint_canvas.h" #include "cc/paint/paint_canvas.h"
#include "cc/paint/paint_flags.h" #include "cc/paint/paint_flags.h"
#include "chrome/browser/themes/theme_properties.h"
#include "chrome/browser/ui/infobar_container_delegate.h" #include "chrome/browser/ui/infobar_container_delegate.h"
#include "chrome/browser/ui/views/infobars/infobar_view.h" #include "chrome/browser/ui/views/infobars/infobar_view.h"
#include "components/infobars/core/infobar.h" #include "components/infobars/core/infobar.h"
#include "ui/base/material_design/material_design_controller.h" #include "ui/base/material_design/material_design_controller.h"
#include "ui/base/theme_provider.h"
#include "ui/gfx/canvas.h" #include "ui/gfx/canvas.h"
#include "ui/gfx/scoped_canvas.h" #include "ui/gfx/scoped_canvas.h"
#include "ui/views/view.h" #include "ui/views/view.h"
...@@ -41,7 +43,8 @@ void InfoBarBackground::Paint(gfx::Canvas* canvas, views::View* view) const { ...@@ -41,7 +43,8 @@ void InfoBarBackground::Paint(gfx::Canvas* canvas, views::View* view) const {
SkScalar arrow_height = scale(infobar->arrow_height()); SkScalar arrow_height = scale(infobar->arrow_height());
SkScalar infobar_width = scale(infobar->width()); SkScalar infobar_width = scale(infobar->width());
if (delegate) { if (delegate) {
separator_color = delegate->GetInfoBarSeparatorColor(); separator_color = view->GetThemeProvider()->GetColor(
ThemeProperties::COLOR_DETACHED_BOOKMARK_BAR_SEPARATOR);
int arrow_x; int arrow_x;
if (delegate->DrawInfoBarArrows(&arrow_x) && infobar->arrow_height() > 0) { if (delegate->DrawInfoBarArrows(&arrow_x) && infobar->arrow_height() > 0) {
// Compensate for the fact that a relative movement of n creates a line of // Compensate for the fact that a relative movement of n creates a line of
......
...@@ -34,9 +34,6 @@ class InfoBarContainer : public InfoBarManager::Observer { ...@@ -34,9 +34,6 @@ class InfoBarContainer : public InfoBarManager::Observer {
public: public:
class Delegate { class Delegate {
public: public:
// The separator color may vary depending on where the container is hosted.
virtual SkColor GetInfoBarSeparatorColor() const = 0;
// The delegate is notified each time the infobar container changes height, // The delegate is notified each time the infobar container changes height,
// as well as when it stops animating. // as well as when it stops animating.
virtual void InfoBarContainerStateChanged(bool is_animating) = 0; virtual void InfoBarContainerStateChanged(bool is_animating) = 0;
......
...@@ -28,9 +28,6 @@ class InfoBarContainerDelegateIOS ...@@ -28,9 +28,6 @@ class InfoBarContainerDelegateIOS
~InfoBarContainerDelegateIOS() override {} ~InfoBarContainerDelegateIOS() override {}
// Calling this method on iOS is a programming error.
SkColor GetInfoBarSeparatorColor() const override;
// This method always returns 0 on iOS. // This method always returns 0 on iOS.
int ArrowTargetHeightForInfoBar( int ArrowTargetHeightForInfoBar(
size_t index, size_t index,
......
...@@ -12,11 +12,6 @@ ...@@ -12,11 +12,6 @@
#error "This file requires ARC support." #error "This file requires ARC support."
#endif #endif
SkColor InfoBarContainerDelegateIOS::GetInfoBarSeparatorColor() const {
NOTIMPLEMENTED();
return SK_ColorBLACK;
}
int InfoBarContainerDelegateIOS::ArrowTargetHeightForInfoBar( int InfoBarContainerDelegateIOS::ArrowTargetHeightForInfoBar(
size_t index, size_t index,
const gfx::SlideAnimation& animation) const { const gfx::SlideAnimation& animation) const {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment