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

Unified Diff: ui/views/controls/textfield/gtk_views_entry.cc

Issue 9728002: Removing deprecated GTK-Views code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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 | « ui/views/controls/textfield/gtk_views_entry.h ('k') | ui/views/controls/textfield/gtk_views_textview.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/textfield/gtk_views_entry.cc
diff --git a/ui/views/controls/textfield/gtk_views_entry.cc b/ui/views/controls/textfield/gtk_views_entry.cc
deleted file mode 100644
index d26e370788e38f5152003543b67ee983b4254a3b..0000000000000000000000000000000000000000
--- a/ui/views/controls/textfield/gtk_views_entry.cc
+++ /dev/null
@@ -1,74 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ui/views/controls/textfield/gtk_views_entry.h"
-
-#include "base/utf_string_conversions.h"
-#include "ui/gfx/canvas_skia_paint.h"
-#include "ui/gfx/insets.h"
-#include "ui/gfx/skia_utils_gtk.h"
-#include "ui/views/controls/textfield/native_textfield_gtk.h"
-#include "ui/views/controls/textfield/textfield.h"
-
-G_BEGIN_DECLS
-
-G_DEFINE_TYPE(GtkViewsEntry, gtk_views_entry, GTK_TYPE_ENTRY)
-
-static gint gtk_views_entry_expose_event(GtkWidget *widget,
- GdkEventExpose *event) {
- views::NativeTextfieldGtk* host = GTK_VIEWS_ENTRY(widget)->host;
-#if defined(OS_CHROMEOS)
- // Draw textfield background over the default white rectangle.
- if (event->window == widget->window) {
- gfx::CanvasSkiaPaint canvas(event);
- if (!canvas.is_empty() && host) {
- host->textfield()->OnPaintBackground(&canvas);
- }
- }
-#endif
-
- gint result = GTK_WIDGET_CLASS(gtk_views_entry_parent_class)->expose_event(
- widget, event);
-
- GtkEntry* entry = GTK_ENTRY(widget);
-
- // Internally GtkEntry creates an additional window (text_area) that the
- // text is drawn to. We only need paint after that window has painted.
- if (host && event->window == entry->text_area &&
- !host->textfield()->text_to_display_when_empty().empty() &&
- g_utf8_strlen(gtk_entry_get_text(entry), -1) == 0) {
- gfx::CanvasSkiaPaint canvas(event);
- if (!canvas.is_empty()) {
- gfx::Insets insets =
- views::NativeTextfieldGtk::GetEntryInnerBorder(entry);
- gfx::Font font = host->textfield()->font();
- const string16 text = host->textfield()->text_to_display_when_empty();
- canvas.DrawStringInt(
- text, font,
- gfx::GdkColorToSkColor(widget->style->text[GTK_STATE_INSENSITIVE]),
- insets.left(), insets.top(),
- widget->allocation.width - insets.width(), font.GetHeight());
- }
- }
-
- return result;
-}
-
-static void gtk_views_entry_class_init(GtkViewsEntryClass* views_entry_class) {
- GtkWidgetClass* widget_class =
- reinterpret_cast<GtkWidgetClass*>(views_entry_class);
- widget_class->expose_event = gtk_views_entry_expose_event;
-}
-
-static void gtk_views_entry_init(GtkViewsEntry* entry) {
- entry->host = NULL;
-}
-
-GtkWidget* gtk_views_entry_new(views::NativeTextfieldGtk* host) {
- gpointer entry = g_object_new(GTK_TYPE_VIEWS_ENTRY, NULL);
- GTK_VIEWS_ENTRY(entry)->host = host;
- return GTK_WIDGET(entry);
-}
-
-G_END_DECLS
« no previous file with comments | « ui/views/controls/textfield/gtk_views_entry.h ('k') | ui/views/controls/textfield/gtk_views_textview.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698