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

Unified Diff: chrome/browser/gtk/browser_window_gtk.cc

Issue 200122: Remove code doing a no-op due to float -> int rounding. (Closed)
Patch Set: Created 11 years, 3 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/gtk/bookmark_manager_gtk.cc ('k') | chrome/browser/gtk/download_item_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/browser_window_gtk.cc
diff --git a/chrome/browser/gtk/browser_window_gtk.cc b/chrome/browser/gtk/browser_window_gtk.cc
index e0aa3357ab7f6a5723ec179c87c3f2b4c5296d1f..72e0123a3f077597064b1332d5790bb2516d66ce 100644
--- a/chrome/browser/gtk/browser_window_gtk.cc
+++ b/chrome/browser/gtk/browser_window_gtk.cc
@@ -671,7 +671,7 @@ gboolean BrowserWindowGtk::OnCustomFrameExpose(GtkWidget* widget,
IDR_WINDOW_TOP_CENTER,
IDR_WINDOW_TOP_RIGHT_CORNER,
IDR_WINDOW_LEFT_SIDE,
- NULL,
+ 0,
IDR_WINDOW_RIGHT_SIDE,
IDR_WINDOW_BOTTOM_LEFT_CORNER,
IDR_WINDOW_BOTTOM_CENTER,
@@ -1937,7 +1937,8 @@ gboolean BrowserWindowGtk::OnButtonPressEvent(GtkWidget* widget,
gdk_window_get_origin(GTK_WIDGET(browser->window_)->window, &win_x, &win_y);
GdkWindowEdge edge;
- gfx::Point point(event->x_root - win_x, event->y_root - win_y);
+ gfx::Point point(static_cast<int>(event->x_root - win_x),
+ static_cast<int>(event->y_root - win_y));
bool has_hit_edge = browser->GetWindowEdge(point.x(), point.y(), &edge);
// Ignore clicks that are in/below the browser toolbar.
@@ -1956,7 +1957,8 @@ gboolean BrowserWindowGtk::OnButtonPressEvent(GtkWidget* widget,
guint32 last_click_time = browser->last_click_time_;
gfx::Point last_click_position = browser->last_click_position_;
browser->last_click_time_ = event->time;
- browser->last_click_position_ = gfx::Point(event->x, event->y);
+ browser->last_click_position_ = gfx::Point(static_cast<int>(event->x),
+ static_cast<int>(event->y));
if (has_hit_titlebar) {
// We want to start a move when the user single clicks, but not start a
@@ -1976,19 +1978,23 @@ gboolean BrowserWindowGtk::OnButtonPressEvent(GtkWidget* widget,
NULL);
guint32 click_time = event->time - last_click_time;
- int click_move_x = event->x - last_click_position.x();
- int click_move_y = event->y - last_click_position.y();
+ int click_move_x = static_cast<int>(event->x - last_click_position.x());
+ int click_move_y = static_cast<int>(event->y - last_click_position.y());
if (click_time > static_cast<guint32>(double_click_time) ||
click_move_x > double_click_distance ||
click_move_y > double_click_distance) {
gtk_window_begin_move_drag(browser->window_, event->button,
- event->x_root, event->y_root, event->time);
+ static_cast<gint>(event->x_root),
+ static_cast<gint>(event->y_root),
+ event->time);
return TRUE;
}
} else if (has_hit_edge) {
gtk_window_begin_resize_drag(browser->window_, edge, event->button,
- event->x_root, event->y_root, event->time);
+ static_cast<gint>(event->x_root),
+ static_cast<gint>(event->y_root),
+ event->time);
return TRUE;
}
} else if (GDK_2BUTTON_PRESS == event->type) {
« no previous file with comments | « chrome/browser/gtk/bookmark_manager_gtk.cc ('k') | chrome/browser/gtk/download_item_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698