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

Unified Diff: chrome/browser/ui/views/find_bar_view.cc

Issue 2399033004: Fix corners of find bar view by using BubbleBackground instead of a (Closed)
Patch Set: iwyu Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/find_bar_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/find_bar_view.cc
diff --git a/chrome/browser/ui/views/find_bar_view.cc b/chrome/browser/ui/views/find_bar_view.cc
index 3364b630fd56b4bcc8687abc4e8a6a89bdb35801..d426235dc2df94b557a51e9d37b240651a2a3a8e 100644
--- a/chrome/browser/ui/views/find_bar_view.cc
+++ b/chrome/browser/ui/views/find_bar_view.cc
@@ -27,7 +27,6 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/theme_provider.h"
#include "ui/events/event.h"
-#include "ui/gfx/canvas.h"
#include "ui/gfx/color_palette.h"
#include "ui/gfx/paint_vector_icon.h"
#include "ui/gfx/vector_icons_public.h"
@@ -160,11 +159,6 @@ FindBarView::FindBarView(FindBarHost* host)
EnableCanvasFlippingForRTLUI(true);
- // The background color is not used since there's no arrow.
- SetBorder(base::MakeUnique<views::BubbleBorder>(
- views::BubbleBorder::NONE, views::BubbleBorder::SMALL_SHADOW,
- gfx::kPlaceholderColor));
-
match_count_text_->SetEventTargeter(
base::MakeUnique<views::ViewTargeter>(this));
AddChildViewAt(match_count_text_, 1);
@@ -259,16 +253,6 @@ void FindBarView::SetFocusAndSelection(bool select_all) {
///////////////////////////////////////////////////////////////////////////////
// FindBarView, views::View overrides:
-void FindBarView::OnPaintBackground(gfx::Canvas* canvas) {
- // Draw within the lines.
- canvas->Save();
- gfx::Rect bounds = GetLocalBounds();
- bounds.Inset(border()->GetInsets());
- canvas->ClipRect(bounds);
- views::View::OnPaintBackground(canvas);
- canvas->Restore();
-}
-
void FindBarView::Layout() {
views::View::Layout();
@@ -427,9 +411,13 @@ const char* FindBarView::GetClassName() const {
void FindBarView::OnNativeThemeChanged(const ui::NativeTheme* theme) {
SkColor bg_color = theme->GetSystemColor(
ui::NativeTheme::kColorId_TextfieldDefaultBackground);
- set_background(views::Background::CreateSolidBackground(bg_color));
- match_count_text_->SetBackgroundColor(bg_color);
+ auto border = base::MakeUnique<views::BubbleBorder>(
+ views::BubbleBorder::NONE, views::BubbleBorder::SMALL_SHADOW,
+ bg_color);
+ set_background(new views::BubbleBackground(border.get()));
+ SetBorder(std::move(border));
+ match_count_text_->SetBackgroundColor(bg_color);
SkColor text_color =
theme->GetSystemColor(ui::NativeTheme::kColorId_TextfieldDefaultColor);
match_count_text_->SetEnabledColor(SkColorSetA(text_color, 0x69));
« no previous file with comments | « chrome/browser/ui/views/find_bar_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698