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

Unified Diff: chrome/browser/ui/gtk/download/download_shelf_gtk.cc

Issue 12995025: [Mac] DownloadShelf should be notified when autoclosing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: + NSTrackingInVisibleRect Created 7 years, 9 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
Index: chrome/browser/ui/gtk/download/download_shelf_gtk.cc
diff --git a/chrome/browser/ui/gtk/download/download_shelf_gtk.cc b/chrome/browser/ui/gtk/download/download_shelf_gtk.cc
index d5a2aa569292af47f581844d32ef903f6594a9d2..4dbb12884c7f7df796ac07d0afa8e4d0d98f6fd2 100644
--- a/chrome/browser/ui/gtk/download/download_shelf_gtk.cc
+++ b/chrome/browser/ui/gtk/download/download_shelf_gtk.cc
@@ -198,7 +198,7 @@ void DownloadShelfGtk::DoShow() {
CancelAutoClose();
}
-void DownloadShelfGtk::DoClose() {
+void DownloadShelfGtk::DoClose(CloseReason reason) {
// When we are closing, we can vertically overlap the render view. Make sure
// we are on top.
gdk_window_raise(gtk_widget_get_window(shelf_.get()));
@@ -210,7 +210,7 @@ void DownloadShelfGtk::DoClose() {
++num_in_progress;
}
download_util::RecordShelfClose(
- download_items_.size(), num_in_progress, close_on_mouse_out_);
+ download_items_.size(), num_in_progress, reason == AUTOMATIC);
SetCloseOnMouseOut(false);
}
@@ -306,7 +306,7 @@ void DownloadShelfGtk::MaybeShowMoreDownloadItems() {
void DownloadShelfGtk::OnButtonClick(GtkWidget* button) {
if (button == close_button_->widget()) {
- Close();
+ Close(USER_ACTION);
} else {
// The link button was clicked.
chrome::ShowDownloads(browser_);
@@ -396,7 +396,8 @@ void DownloadShelfGtk::MouseLeftShelf() {
MessageLoop::current()->PostDelayedTask(
FROM_HERE,
- base::Bind(&DownloadShelfGtk::Close, weak_factory_.GetWeakPtr()),
+ base::Bind(&DownloadShelfGtk::Close, weak_factory_.GetWeakPtr(),
+ AUTOMATIC),
base::TimeDelta::FromMilliseconds(kAutoCloseDelayMs));
}
« no previous file with comments | « chrome/browser/ui/gtk/download/download_shelf_gtk.h ('k') | chrome/browser/ui/views/download/download_shelf_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698