| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/download/download_shelf_gtk.h" | 5 #include "chrome/browser/ui/gtk/download/download_shelf_gtk.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "chrome/browser/download/download_item_model.h" | 10 #include "chrome/browser/download/download_item_model.h" |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 GtkWidget* vbox = gtk_vbox_new(FALSE, 0); | 113 GtkWidget* vbox = gtk_vbox_new(FALSE, 0); |
| 114 gtk_box_pack_start(GTK_BOX(vbox), top_border_, FALSE, FALSE, 0); | 114 gtk_box_pack_start(GTK_BOX(vbox), top_border_, FALSE, FALSE, 0); |
| 115 gtk_box_pack_start(GTK_BOX(vbox), padding_bg_, FALSE, FALSE, 0); | 115 gtk_box_pack_start(GTK_BOX(vbox), padding_bg_, FALSE, FALSE, 0); |
| 116 | 116 |
| 117 // Put the shelf in an event box so it gets its own window, which makes it | 117 // Put the shelf in an event box so it gets its own window, which makes it |
| 118 // easier to get z-ordering right. | 118 // easier to get z-ordering right. |
| 119 shelf_.Own(gtk_event_box_new()); | 119 shelf_.Own(gtk_event_box_new()); |
| 120 gtk_container_add(GTK_CONTAINER(shelf_.get()), vbox); | 120 gtk_container_add(GTK_CONTAINER(shelf_.get()), vbox); |
| 121 | 121 |
| 122 // Create and pack the close button. | 122 // Create and pack the close button. |
| 123 close_button_.reset(CustomDrawButton::CloseButton(theme_service_)); | 123 close_button_.reset(CustomDrawButton::CloseButtonBar(theme_service_)); |
| 124 gtk_util::CenterWidgetInHBox(outer_hbox, close_button_->widget(), true, 0); | 124 gtk_util::CenterWidgetInHBox(outer_hbox, close_button_->widget(), true, 0); |
| 125 g_signal_connect(close_button_->widget(), "clicked", | 125 g_signal_connect(close_button_->widget(), "clicked", |
| 126 G_CALLBACK(OnButtonClickThunk), this); | 126 G_CALLBACK(OnButtonClickThunk), this); |
| 127 | 127 |
| 128 // Create the "Show all downloads..." link and connect to the click event. | 128 // Create the "Show all downloads..." link and connect to the click event. |
| 129 link_button_ = theme_service_->BuildChromeLinkButton( | 129 link_button_ = theme_service_->BuildChromeLinkButton( |
| 130 l10n_util::GetStringUTF8(IDS_SHOW_ALL_DOWNLOADS)); | 130 l10n_util::GetStringUTF8(IDS_SHOW_ALL_DOWNLOADS)); |
| 131 g_signal_connect(link_button_, "clicked", | 131 g_signal_connect(link_button_, "clicked", |
| 132 G_CALLBACK(OnButtonClickThunk), this); | 132 G_CALLBACK(OnButtonClickThunk), this); |
| 133 gtk_util::SetButtonTriggersNavigation(link_button_); | 133 gtk_util::SetButtonTriggersNavigation(link_button_); |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 | 396 |
| 397 MessageLoop::current()->PostDelayedTask( | 397 MessageLoop::current()->PostDelayedTask( |
| 398 FROM_HERE, | 398 FROM_HERE, |
| 399 base::Bind(&DownloadShelfGtk::Close, weak_factory_.GetWeakPtr()), | 399 base::Bind(&DownloadShelfGtk::Close, weak_factory_.GetWeakPtr()), |
| 400 base::TimeDelta::FromMilliseconds(kAutoCloseDelayMs)); | 400 base::TimeDelta::FromMilliseconds(kAutoCloseDelayMs)); |
| 401 } | 401 } |
| 402 | 402 |
| 403 void DownloadShelfGtk::MouseEnteredShelf() { | 403 void DownloadShelfGtk::MouseEnteredShelf() { |
| 404 weak_factory_.InvalidateWeakPtrs(); | 404 weak_factory_.InvalidateWeakPtrs(); |
| 405 } | 405 } |
| OLD | NEW |