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

Unified Diff: chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc

Issue 9359052: GTK: Closing in on being completely GSEALed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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/gtk/tabs/tab_strip_gtk.h ('k') | ui/base/gtk/gtk_compat.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc
diff --git a/chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc b/chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc
index 1d5435ace724128359464784984e4b415e63e811..0863e02be9a9d481506155dd141743f41d1abb5f 100644
--- a/chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc
+++ b/chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc
@@ -1450,9 +1450,12 @@ void TabStripGtk::GenerateIdealBounds() {
void TabStripGtk::LayoutNewTabButton(double last_tab_right,
double unselected_width) {
GtkWidget* toplevel = gtk_widget_get_ancestor(widget(), GTK_TYPE_WINDOW);
- bool is_maximized = toplevel &&
- ((gdk_window_get_state(toplevel->window) & GDK_WINDOW_STATE_MAXIMIZED)
- != 0);
+ bool is_maximized = false;
+ if (toplevel) {
+ GdkWindow* gdk_window = gtk_widget_get_window(toplevel);
+ is_maximized = (gdk_window_get_state(gdk_window) &
+ GDK_WINDOW_STATE_MAXIMIZED) != 0;
+ }
int y = is_maximized ? 0 : kNewTabButtonVOffset;
int height = newtab_surface_bounds_.height() + kNewTabButtonVOffset - y;
@@ -1750,7 +1753,7 @@ void TabStripGtk::SetDropIndex(int index, bool drop_before) {
drop_bounds.width(), drop_bounds.height());
}
-bool TabStripGtk::CompleteDrop(guchar* data, bool is_plain_text) {
+bool TabStripGtk::CompleteDrop(const guchar* data, bool is_plain_text) {
if (!drop_info_.get())
return false;
@@ -1767,11 +1770,11 @@ bool TabStripGtk::CompleteDrop(guchar* data, bool is_plain_text) {
if (is_plain_text) {
AutocompleteMatch match;
model_->profile()->GetAutocompleteClassifier()->Classify(
- UTF8ToUTF16(reinterpret_cast<char*>(data)), string16(), false, false,
- &match, NULL);
+ UTF8ToUTF16(reinterpret_cast<const char*>(data)), string16(),
+ false, false, &match, NULL);
url = match.destination_url;
} else {
- std::string url_string(reinterpret_cast<char*>(data));
+ std::string url_string(reinterpret_cast<const char*>(data));
url = GURL(url_string.substr(0, url_string.find_first_of('\n')));
}
if (!url.is_valid())
@@ -1824,7 +1827,7 @@ gboolean TabStripGtk::DropInfo::OnExposeEvent(GtkWidget* widget,
SetContainerShapeMask();
}
- cairo_t* cr = gdk_cairo_create(GDK_DRAWABLE(widget->window));
+ cairo_t* cr = gdk_cairo_create(gtk_widget_get_window(widget));
gdk_cairo_rectangle(cr, &event->area);
cairo_clip(cr);
@@ -1852,7 +1855,7 @@ void TabStripGtk::DropInfo::SetContainerColorMap() {
// Sets full transparency for the container window. This is used if
// compositing is available for the screen.
void TabStripGtk::DropInfo::SetContainerTransparency() {
- cairo_t* cairo_context = gdk_cairo_create(container->window);
+ cairo_t* cairo_context = gdk_cairo_create(gtk_widget_get_window(container));
if (!cairo_context)
return;
@@ -1890,7 +1893,8 @@ void TabStripGtk::DropInfo::SetContainerShapeMask() {
cairo_destroy(cairo_context);
// Set the shape mask.
- gdk_window_shape_combine_mask(container->window, pixmap, 0, 0);
+ GdkWindow* gdk_window = gtk_widget_get_window(container);
+ gdk_window_shape_combine_mask(gdk_window, pixmap, 0, 0);
g_object_unref(pixmap);
}
@@ -2157,7 +2161,8 @@ gboolean TabStripGtk::OnDragDataReceived(GtkWidget* widget,
if (info == ui::TEXT_URI_LIST ||
info == ui::NETSCAPE_URL ||
info == ui::TEXT_PLAIN) {
- success = CompleteDrop(data->data, info == ui::TEXT_PLAIN);
+ success = CompleteDrop(gtk_selection_data_get_data(data),
+ info == ui::TEXT_PLAIN);
}
gtk_drag_finish(context, success, FALSE, time);
« no previous file with comments | « chrome/browser/ui/gtk/tabs/tab_strip_gtk.h ('k') | ui/base/gtk/gtk_compat.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698