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

Side by Side Diff: chrome/browser/ui/gtk/gtk_util.cc

Issue 6995032: Fix a browser crash involving omnibox extension keywords. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: latest Created 9 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/gtk/gtk_util.h" 5 #include "chrome/browser/ui/gtk/gtk_util.h"
6 6
7 #include <cairo/cairo.h> 7 #include <cairo/cairo.h>
8 #include <gdk/gdkx.h> 8 #include <gdk/gdkx.h>
9 #include <gtk/gtk.h> 9 #include <gtk/gtk.h>
10 10
(...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after
982 GtkClipboard* clipboard = gtk_clipboard_get(GDK_SELECTION_PRIMARY); 982 GtkClipboard* clipboard = gtk_clipboard_get(GDK_SELECTION_PRIMARY);
983 DCHECK(clipboard); 983 DCHECK(clipboard);
984 gchar* selection_text = gtk_clipboard_wait_for_text(clipboard); 984 gchar* selection_text = gtk_clipboard_wait_for_text(clipboard);
985 if (!selection_text) 985 if (!selection_text)
986 return false; 986 return false;
987 987
988 // Use autocomplete to clean up the text, going so far as to turn it into 988 // Use autocomplete to clean up the text, going so far as to turn it into
989 // a search query if necessary. 989 // a search query if necessary.
990 AutocompleteMatch match; 990 AutocompleteMatch match;
991 profile->GetAutocompleteClassifier()->Classify(UTF8ToUTF16(selection_text), 991 profile->GetAutocompleteClassifier()->Classify(UTF8ToUTF16(selection_text),
992 string16(), false, &match, NULL); 992 string16(), false, false, &match, NULL);
993 g_free(selection_text); 993 g_free(selection_text);
994 if (!match.destination_url.is_valid()) 994 if (!match.destination_url.is_valid())
995 return false; 995 return false;
996 996
997 *url = match.destination_url; 997 *url = match.destination_url;
998 return true; 998 return true;
999 } 999 }
1000 1000
1001 bool AddWindowAlphaChannel(GtkWidget* window) { 1001 bool AddWindowAlphaChannel(GtkWidget* window) {
1002 GdkScreen* screen = gtk_widget_get_screen(window); 1002 GdkScreen* screen = gtk_widget_get_screen(window);
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
1282 1282
1283 void DoCopy(BrowserWindow* window) { 1283 void DoCopy(BrowserWindow* window) {
1284 DoCutCopyPaste(window, &RenderViewHost::Copy, "copy-clipboard"); 1284 DoCutCopyPaste(window, &RenderViewHost::Copy, "copy-clipboard");
1285 } 1285 }
1286 1286
1287 void DoPaste(BrowserWindow* window) { 1287 void DoPaste(BrowserWindow* window) {
1288 DoCutCopyPaste(window, &RenderViewHost::Paste, "paste-clipboard"); 1288 DoCutCopyPaste(window, &RenderViewHost::Paste, "paste-clipboard");
1289 } 1289 }
1290 1290
1291 } // namespace gtk_util 1291 } // namespace gtk_util
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm ('k') | chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698