diff options
Diffstat (limited to 'chrome/browser/gtk')
-rw-r--r-- | chrome/browser/gtk/back_forward_button_gtk.cc | 2 | ||||
-rw-r--r-- | chrome/browser/gtk/bookmark_bar_gtk.cc | 4 | ||||
-rw-r--r-- | chrome/browser/gtk/bookmark_manager_gtk.cc | 12 | ||||
-rw-r--r-- | chrome/browser/gtk/browser_window_gtk.cc | 20 | ||||
-rw-r--r-- | chrome/browser/gtk/constrained_window_gtk.h | 3 | ||||
-rw-r--r-- | chrome/browser/gtk/download_item_gtk.cc | 6 | ||||
-rw-r--r-- | chrome/browser/gtk/download_request_dialog_delegate_gtk.cc | 2 | ||||
-rw-r--r-- | chrome/browser/gtk/find_bar_gtk.cc | 6 | ||||
-rw-r--r-- | chrome/browser/gtk/gtk_floating_container.cc | 2 | ||||
-rw-r--r-- | chrome/browser/gtk/info_bubble_gtk.h | 3 | ||||
-rw-r--r-- | chrome/browser/gtk/slide_animator_gtk.cc | 4 | ||||
-rw-r--r-- | chrome/browser/gtk/slide_animator_gtk.h | 3 | ||||
-rw-r--r-- | chrome/browser/gtk/tab_contents_drag_source.cc | 4 | ||||
-rw-r--r-- | chrome/browser/gtk/tabs/dragged_tab_gtk.cc | 11 | ||||
-rw-r--r-- | chrome/browser/gtk/tabs/tab_gtk.h | 3 | ||||
-rw-r--r-- | chrome/browser/gtk/tabs/tab_renderer_gtk.cc | 6 | ||||
-rw-r--r-- | chrome/browser/gtk/view_id_util.h | 2 |
17 files changed, 61 insertions, 32 deletions
diff --git a/chrome/browser/gtk/back_forward_button_gtk.cc b/chrome/browser/gtk/back_forward_button_gtk.cc index 7f4bd69..e5f6125 100644 --- a/chrome/browser/gtk/back_forward_button_gtk.cc +++ b/chrome/browser/gtk/back_forward_button_gtk.cc @@ -110,7 +110,7 @@ gboolean BackForwardButtonGtk::OnButtonPress(GtkWidget* widget, if (event->button != 1) return FALSE; - button->y_position_of_last_press_ = event->y; + button->y_position_of_last_press_ = static_cast<int>(event->y); MessageLoop::current()->PostDelayedTask(FROM_HERE, button->show_menu_factory_.NewRunnableMethod( &BackForwardButtonGtk::ShowBackForwardMenu), diff --git a/chrome/browser/gtk/bookmark_bar_gtk.cc b/chrome/browser/gtk/bookmark_bar_gtk.cc index 373ce0f..909243d 100644 --- a/chrome/browser/gtk/bookmark_bar_gtk.cc +++ b/chrome/browser/gtk/bookmark_bar_gtk.cc @@ -399,8 +399,8 @@ void BookmarkBarGtk::AnimationProgressed(const Animation* animation) { DCHECK_EQ(animation, slide_animation_.get()); gtk_widget_set_size_request(event_box_.get(), -1, - animation->GetCurrentValue() * - kBookmarkBarHeight); + static_cast<gint>(animation->GetCurrentValue() * + kBookmarkBarHeight)); } void BookmarkBarGtk::AnimationEnded(const Animation* animation) { diff --git a/chrome/browser/gtk/bookmark_manager_gtk.cc b/chrome/browser/gtk/bookmark_manager_gtk.cc index f38512c..0d005e9 100644 --- a/chrome/browser/gtk/bookmark_manager_gtk.cc +++ b/chrome/browser/gtk/bookmark_manager_gtk.cc @@ -1183,7 +1183,9 @@ gboolean BookmarkManagerGtk::OnRightTreeViewButtonPress( GtkTreePath* path; gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(tree_view), - event->x, event->y, &path, NULL, NULL, NULL); + static_cast<gint>(event->x), + static_cast<gint>(event->y), &path, + NULL, NULL, NULL); if (path == NULL) return TRUE; @@ -1207,10 +1209,10 @@ gboolean BookmarkManagerGtk::OnRightTreeViewMotion( return FALSE; if (gtk_drag_check_threshold(tree_view, - bm->mousedown_event_.x, - bm->mousedown_event_.y, - event->x, - event->y)) { + static_cast<gint>(bm->mousedown_event_.x), + static_cast<gint>(bm->mousedown_event_.y), + static_cast<gint>(event->x), + static_cast<gint>(event->y))) { bm->delaying_mousedown_ = false; GtkTargetList* targets = GtkDndUtil::GetTargetListFromCodeMask( GtkDndUtil::CHROME_BOOKMARK_ITEM | diff --git a/chrome/browser/gtk/browser_window_gtk.cc b/chrome/browser/gtk/browser_window_gtk.cc index 9c295ac..278f973 100644 --- a/chrome/browser/gtk/browser_window_gtk.cc +++ b/chrome/browser/gtk/browser_window_gtk.cc @@ -603,7 +603,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, @@ -1825,7 +1825,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. @@ -1844,7 +1845,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 @@ -1864,19 +1866,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) { diff --git a/chrome/browser/gtk/constrained_window_gtk.h b/chrome/browser/gtk/constrained_window_gtk.h index 91fa9ac..d2003a9 100644 --- a/chrome/browser/gtk/constrained_window_gtk.h +++ b/chrome/browser/gtk/constrained_window_gtk.h @@ -22,6 +22,9 @@ class ConstrainedWindowGtkDelegate { // Tells the delegate to either delete itself or set up a task to delete // itself later. virtual void DeleteDelegate() = 0; + + protected: + ~ConstrainedWindowGtkDelegate() {} }; // Constrained window implementation for the GTK port. Unlike the Win32 system, diff --git a/chrome/browser/gtk/download_item_gtk.cc b/chrome/browser/gtk/download_item_gtk.cc index 815459a..90bb019 100644 --- a/chrome/browser/gtk/download_item_gtk.cc +++ b/chrome/browser/gtk/download_item_gtk.cc @@ -428,9 +428,9 @@ void DownloadItemGtk::AnimationProgressed(const Animation* animation) { gtk_widget_queue_draw(progress_area_.get()); } else { if (IsDangerous()) { - int progress = (dangerous_hbox_full_width_ - - dangerous_hbox_start_width_) * - new_item_animation_->GetCurrentValue(); + int progress = static_cast<int>((dangerous_hbox_full_width_ - + dangerous_hbox_start_width_) * + new_item_animation_->GetCurrentValue()); int showing_width = dangerous_hbox_start_width_ + progress; gtk_widget_set_size_request(dangerous_hbox_, showing_width, -1); } else { diff --git a/chrome/browser/gtk/download_request_dialog_delegate_gtk.cc b/chrome/browser/gtk/download_request_dialog_delegate_gtk.cc index 8903ee2..7e499b1 100644 --- a/chrome/browser/gtk/download_request_dialog_delegate_gtk.cc +++ b/chrome/browser/gtk/download_request_dialog_delegate_gtk.cc @@ -29,7 +29,7 @@ DownloadRequestDialogDelegateGtk::DownloadRequestDialogDelegateGtk( : DownloadRequestDialogDelegate(host), responded_(false) { // Create dialog. - root_.Own(gtk_vbox_new(NULL, gtk_util::kContentAreaBorder)); + root_.Own(gtk_vbox_new(false, gtk_util::kContentAreaBorder)); GtkWidget* label = gtk_label_new( l10n_util::GetStringUTF8(IDS_MULTI_DOWNLOAD_WARNING).c_str()); gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); diff --git a/chrome/browser/gtk/find_bar_gtk.cc b/chrome/browser/gtk/find_bar_gtk.cc index 0bf856a..231aa00 100644 --- a/chrome/browser/gtk/find_bar_gtk.cc +++ b/chrome/browser/gtk/find_bar_gtk.cc @@ -116,7 +116,7 @@ void SetDialogShape(GtkWidget* widget) { IDR_FIND_DLG_LEFT_BACKGROUND, IDR_FIND_DLG_MIDDLE_BACKGROUND, IDR_FIND_DLG_RIGHT_BACKGROUND, - NULL, NULL, NULL, NULL, NULL, NULL); + 0, 0, 0, 0, 0, 0); dialog_shape->ChangeWhiteToTransparent(); } @@ -132,7 +132,7 @@ const NineBox* GetDialogBorder() { IDR_FIND_DIALOG_LEFT, IDR_FIND_DIALOG_MIDDLE, IDR_FIND_DIALOG_RIGHT, - NULL, NULL, NULL, NULL, NULL, NULL); + 0, 0, 0, 0, 0, 0); } return dialog_border; @@ -512,7 +512,7 @@ void FindBarGtk::Observe(NotificationType type, &kEntryBackgroundColor); gtk_alignment_set_padding(GTK_ALIGNMENT(content_alignment_), - 0.0, 0.0, 0.0, 0.0); + 0, 0, 0, 0); gtk_widget_modify_bg(border_bin_, GTK_STATE_NORMAL, &kTextBorderColor); gtk_widget_modify_bg(border_bin_aa_, GTK_STATE_NORMAL, &kTextBorderColorAA); diff --git a/chrome/browser/gtk/gtk_floating_container.cc b/chrome/browser/gtk/gtk_floating_container.cc index b9d0e46..51f9632 100644 --- a/chrome/browser/gtk/gtk_floating_container.cc +++ b/chrome/browser/gtk/gtk_floating_container.cc @@ -115,7 +115,7 @@ static void gtk_floating_container_class_init( G_OBJECT_CLASS_TYPE(object_class), static_cast<GSignalFlags>(G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION), - NULL, + 0u, NULL, NULL, gtk_marshal_VOID__BOXED, G_TYPE_NONE, 1, diff --git a/chrome/browser/gtk/info_bubble_gtk.h b/chrome/browser/gtk/info_bubble_gtk.h index 137b395..eb88724 100644 --- a/chrome/browser/gtk/info_bubble_gtk.h +++ b/chrome/browser/gtk/info_bubble_gtk.h @@ -34,6 +34,9 @@ class InfoBubbleGtkDelegate { // NOTE: The Views interface has CloseOnEscape, except I can't find a place // where it ever returns false, so we always allow you to close via escape. + + protected: + ~InfoBubbleGtkDelegate() {} }; class InfoBubbleGtk : public NotificationObserver { diff --git a/chrome/browser/gtk/slide_animator_gtk.cc b/chrome/browser/gtk/slide_animator_gtk.cc index 866aca5..519a58f 100644 --- a/chrome/browser/gtk/slide_animator_gtk.cc +++ b/chrome/browser/gtk/slide_animator_gtk.cc @@ -107,8 +107,8 @@ bool SlideAnimatorGtk::IsClosing() { } void SlideAnimatorGtk::AnimationProgressed(const Animation* animation) { - int showing_height = child_->allocation.height * - animation_->GetCurrentValue(); + int showing_height = static_cast<int>(child_->allocation.height * + animation_->GetCurrentValue()); if (direction_ == DOWN) { gtk_fixed_move(GTK_FIXED(widget_.get()), child_, 0, showing_height - child_->allocation.height); diff --git a/chrome/browser/gtk/slide_animator_gtk.h b/chrome/browser/gtk/slide_animator_gtk.h index a4cf657..547ae83 100644 --- a/chrome/browser/gtk/slide_animator_gtk.h +++ b/chrome/browser/gtk/slide_animator_gtk.h @@ -28,6 +28,9 @@ class SlideAnimatorGtk : public AnimationDelegate { public: // Called when a call to Close() finishes animating. virtual void Closed() = 0; + + protected: + ~Delegate() {} }; enum Direction { diff --git a/chrome/browser/gtk/tab_contents_drag_source.cc b/chrome/browser/gtk/tab_contents_drag_source.cc index b27ef57..7953ba8 100644 --- a/chrome/browser/gtk/tab_contents_drag_source.cc +++ b/chrome/browser/gtk/tab_contents_drag_source.cc @@ -112,7 +112,9 @@ void TabContentsDragSource::DidProcessEvent(GdkEvent* event) { if (tab_contents()->render_view_host()) { tab_contents()->render_view_host()->DragSourceMovedTo( - client.x(), client.y(), event_motion->x_root, event_motion->y_root); + client.x(), client.y(), + static_cast<int>(event_motion->x_root), + static_cast<int>(event_motion->y_root)); } } diff --git a/chrome/browser/gtk/tabs/dragged_tab_gtk.cc b/chrome/browser/gtk/tabs/dragged_tab_gtk.cc index 2ddb607..5809cd1 100644 --- a/chrome/browser/gtk/tabs/dragged_tab_gtk.cc +++ b/chrome/browser/gtk/tabs/dragged_tab_gtk.cc @@ -263,8 +263,9 @@ void DraggedTabGtk::SetContainerShapeMask(GdkPixbuf* pixbuf) { // border). cairo_identity_matrix(cairo_context); cairo_set_source_rgba(cairo_context, 1.0f, 1.0f, 1.0f, 1.0f); - int tab_height = kScalingFactor * gdk_pixbuf_get_height(pixbuf) - - kDragFrameBorderSize; + int tab_height = static_cast<int>(kScalingFactor * + gdk_pixbuf_get_height(pixbuf) - + kDragFrameBorderSize); cairo_rectangle(cairo_context, 0, tab_height, size.width(), size.height() - tab_height); @@ -295,8 +296,10 @@ gboolean DraggedTabGtk::OnExposeEvent(GtkWidget* widget, } // Only used when not attached. - int tab_height = kScalingFactor * gdk_pixbuf_get_height(pixbuf); - int tab_width = kScalingFactor * gdk_pixbuf_get_width(pixbuf); + int tab_height = static_cast<int>(kScalingFactor * + gdk_pixbuf_get_height(pixbuf)); + int tab_width = static_cast<int>(kScalingFactor * + gdk_pixbuf_get_width(pixbuf)); // Draw the render area. if (dragged_tab->backing_store_ && !dragged_tab->attached_) { diff --git a/chrome/browser/gtk/tabs/tab_gtk.h b/chrome/browser/gtk/tabs/tab_gtk.h index dd8547b..2667b42 100644 --- a/chrome/browser/gtk/tabs/tab_gtk.h +++ b/chrome/browser/gtk/tabs/tab_gtk.h @@ -73,6 +73,9 @@ class TabGtk : public TabRendererGtk, // Returns the theme provider for icons and colors. virtual ThemeProvider* GetThemeProvider() = 0; + + protected: + ~TabDelegate() {} }; explicit TabGtk(TabDelegate* delegate); diff --git a/chrome/browser/gtk/tabs/tab_renderer_gtk.cc b/chrome/browser/gtk/tabs/tab_renderer_gtk.cc index 6a60e2b..867d9245 100644 --- a/chrome/browser/gtk/tabs/tab_renderer_gtk.cc +++ b/chrome/browser/gtk/tabs/tab_renderer_gtk.cc @@ -236,7 +236,9 @@ TabRendererGtk::TabRendererGtk(ThemeProvider* theme_provider) fav_icon_hiding_offset_(0), should_display_crashed_favicon_(false), loading_animation_(theme_provider), - close_button_color_(NULL) { + // Zero is not a valid SkColor. It'll be replaced by the + // theme tab_text_color. + close_button_color_(0u) { InitResources(); data_.pinned = false; @@ -590,7 +592,7 @@ void TabRendererGtk::Layout() { if (theme_provider_) { SkColor tab_text_color = theme_provider_->GetColor(BrowserThemeProvider::COLOR_TAB_TEXT); - if (!close_button_color_ || tab_text_color != close_button_color_) { + if (close_button_color_ == 0u || tab_text_color != close_button_color_) { close_button_color_ = tab_text_color; ResourceBundle& rb = ResourceBundle::GetSharedInstance(); close_button_->SetBackground(close_button_color_, diff --git a/chrome/browser/gtk/view_id_util.h b/chrome/browser/gtk/view_id_util.h index 1ec65e8..6c6f328 100644 --- a/chrome/browser/gtk/view_id_util.h +++ b/chrome/browser/gtk/view_id_util.h @@ -15,6 +15,8 @@ class ViewIDUtil { class Delegate { public: virtual GtkWidget* GetWidgetForViewID(ViewID id) = 0; + protected: + ~Delegate() {} }; static void SetID(GtkWidget* widget, ViewID id); |