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

Side by Side Diff: chrome/browser/ui/gtk/download/download_item_gtk.cc

Issue 8342048: Make NotificationService an interface in the content namespace, and switch callers to use it. Mov... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_item_gtk.h" 5 #include "chrome/browser/ui/gtk/download/download_item_gtk.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
11 #include "base/time.h" 11 #include "base/time.h"
12 #include "base/utf_string_conversions.h" 12 #include "base/utf_string_conversions.h"
13 #include "chrome/browser/browser_process.h" 13 #include "chrome/browser/browser_process.h"
14 #include "chrome/browser/download/chrome_download_manager_delegate.h" 14 #include "chrome/browser/download/chrome_download_manager_delegate.h"
15 #include "chrome/browser/download/download_item_model.h" 15 #include "chrome/browser/download/download_item_model.h"
16 #include "chrome/browser/download/download_util.h" 16 #include "chrome/browser/download/download_util.h"
17 #include "chrome/browser/ui/browser.h" 17 #include "chrome/browser/ui/browser.h"
18 #include "chrome/browser/ui/gtk/custom_drag.h" 18 #include "chrome/browser/ui/gtk/custom_drag.h"
19 #include "chrome/browser/ui/gtk/download/download_shelf_context_menu_gtk.h" 19 #include "chrome/browser/ui/gtk/download/download_shelf_context_menu_gtk.h"
20 #include "chrome/browser/ui/gtk/download/download_shelf_gtk.h" 20 #include "chrome/browser/ui/gtk/download/download_shelf_gtk.h"
21 #include "chrome/browser/ui/gtk/gtk_theme_service.h" 21 #include "chrome/browser/ui/gtk/gtk_theme_service.h"
22 #include "chrome/browser/ui/gtk/gtk_util.h" 22 #include "chrome/browser/ui/gtk/gtk_util.h"
23 #include "chrome/browser/ui/gtk/nine_box.h" 23 #include "chrome/browser/ui/gtk/nine_box.h"
24 #include "chrome/common/chrome_notification_types.h" 24 #include "chrome/common/chrome_notification_types.h"
25 #include "content/browser/download/download_item.h" 25 #include "content/browser/download/download_item.h"
26 #include "content/browser/download/download_manager.h" 26 #include "content/browser/download/download_manager.h"
27 #include "content/common/notification_service.h" 27 #include "content/public/browser/notification_source.h"
28 #include "grit/generated_resources.h" 28 #include "grit/generated_resources.h"
29 #include "grit/theme_resources.h" 29 #include "grit/theme_resources.h"
30 #include "third_party/skia/include/core/SkBitmap.h" 30 #include "third_party/skia/include/core/SkBitmap.h"
31 #include "ui/base/animation/slide_animation.h" 31 #include "ui/base/animation/slide_animation.h"
32 #include "ui/base/l10n/l10n_util.h" 32 #include "ui/base/l10n/l10n_util.h"
33 #include "ui/base/resource/resource_bundle.h" 33 #include "ui/base/resource/resource_bundle.h"
34 #include "ui/base/text/text_elider.h" 34 #include "ui/base/text/text_elider.h"
35 #include "ui/gfx/canvas_skia_paint.h" 35 #include "ui/gfx/canvas_skia_paint.h"
36 #include "ui/gfx/color_utils.h" 36 #include "ui/gfx/color_utils.h"
37 #include "ui/gfx/font.h" 37 #include "ui/gfx/font.h"
(...skipping 846 matching lines...) Expand 10 before | Expand all | Expand 10 after
884 get_download()->DangerousDownloadValidated(); 884 get_download()->DangerousDownloadValidated();
885 } 885 }
886 886
887 void DownloadItemGtk::OnDangerousDecline(GtkWidget* button) { 887 void DownloadItemGtk::OnDangerousDecline(GtkWidget* button) {
888 UMA_HISTOGRAM_LONG_TIMES("clickjacking.discard_download", 888 UMA_HISTOGRAM_LONG_TIMES("clickjacking.discard_download",
889 base::Time::Now() - creation_time_); 889 base::Time::Now() - creation_time_);
890 if (get_download()->IsPartialDownload()) 890 if (get_download()->IsPartialDownload())
891 get_download()->Cancel(true); 891 get_download()->Cancel(true);
892 get_download()->Delete(DownloadItem::DELETE_DUE_TO_USER_DISCARD); 892 get_download()->Delete(DownloadItem::DELETE_DUE_TO_USER_DISCARD);
893 } 893 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/custom_button.cc ('k') | chrome/browser/ui/gtk/download/download_shelf_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698