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

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

Issue 135863002: Reland Merge NativeTextfieldViews into views::Textfield. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Handle Ctrl-Shift-Delete and Backspace on Linux, like on ChromeOS. Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/find_bar_view.h ('k') | chrome/browser/ui/views/location_bar/location_bar_view.h » ('j') | 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 a87902df1c5c059914bbaf6cefb3bed0aed4160e..6b9ef16984a228f5b3daa4e2608078edc2ae085e 100644
--- a/chrome/browser/ui/views/find_bar_view.cc
+++ b/chrome/browser/ui/views/find_bar_view.cc
@@ -28,6 +28,7 @@
#include "ui/base/theme_provider.h"
#include "ui/events/event.h"
#include "ui/gfx/canvas.h"
+#include "ui/views/border.h"
#include "ui/views/controls/button/image_button.h"
#include "ui/views/controls/label.h"
#include "ui/views/controls/textfield/textfield.h"
@@ -85,6 +86,10 @@ FindBarView::FindBarView(FindBarHost* host)
find_text_->set_default_width_in_chars(kDefaultCharWidth);
find_text_->SetController(this);
find_text_->SetAccessibleName(l10n_util::GetStringUTF16(IDS_ACCNAME_FIND));
+ // The find bar textfield has a background image instead of a border.
+ const gfx::Insets insets = find_text_->GetInsets();
+ find_text_->set_border(
+ views::Border::CreateEmptyBorder(insets.top(), 0, insets.bottom(), 2));
AddChildView(find_text_);
@@ -339,14 +344,6 @@ void FindBarView::Layout() {
find_previous_button_->height());
}
-void FindBarView::ViewHierarchyChanged(
- const ViewHierarchyChangedDetails& details) {
- if (details.is_add && details.child == this) {
- find_text_->SetHorizontalMargins(0, 2); // Left and Right margins.
- find_text_->RemoveBorder(); // We draw our own border (a background image).
- }
-}
-
gfx::Size FindBarView::GetPreferredSize() {
gfx::Size prefsize = find_text_->GetPreferredSize();
prefsize.set_height(preferred_height_);
« no previous file with comments | « chrome/browser/ui/views/find_bar_view.h ('k') | chrome/browser/ui/views/location_bar/location_bar_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698