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

Unified Diff: chrome/browser/ui/gtk/gtk_util.cc

Issue 9187009: Basic Drawn text for new GTK Autofill popup. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Responding to Comments Created 8 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
« chrome/browser/ui/gtk/gtk_util.h ('K') | « chrome/browser/ui/gtk/gtk_util.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/gtk/gtk_util.cc
diff --git a/chrome/browser/ui/gtk/gtk_util.cc b/chrome/browser/ui/gtk/gtk_util.cc
index c963216a08ad971287610ef464e0f25c9d8c8940..486728363bb278eff5574fdac6329ec320ddec8b 100644
--- a/chrome/browser/ui/gtk/gtk_util.cc
+++ b/chrome/browser/ui/gtk/gtk_util.cc
@@ -762,6 +762,18 @@ void DrawTextEntryBackground(GtkWidget* offscreen_entry,
g_object_unref(our_style);
}
+void SetLayoutText(PangoLayout* layout, const string16& text) {
+ // Pango is really easy to overflow and send into a computational death
+ // spiral that can corrupt the screen. Assume that we'll never have more than
+ // 2000 characters, which should be a safe assumption until we all get robot
+ // eyes. http://crbug.com/66576
+ std::string text_utf8 = UTF16ToUTF8(text);
+ if (text_utf8.length() > 2000)
+ text_utf8 = text_utf8.substr(0, 2000);
+
+ pango_layout_set_text(layout, text_utf8.data(), text_utf8.length());
+}
+
void DrawThemedToolbarBackground(GtkWidget* widget,
cairo_t* cr,
GdkEventExpose* event,
« chrome/browser/ui/gtk/gtk_util.h ('K') | « chrome/browser/ui/gtk/gtk_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698