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

Side by Side Diff: chrome/browser/ui/cocoa/download/download_item_controller.h

Issue 402293002: Experience sampling instrumentation for dangerous downloads warnings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@sampling-api
Patch Set: Add default actions for tests Created 6 years, 4 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
OLDNEW
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 #import <Cocoa/Cocoa.h> 5 #import <Cocoa/Cocoa.h>
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/time/time.h" 8 #include "base/time/time.h"
9 9
10 @class ChromeUILocalizer; 10 @class ChromeUILocalizer;
11 @class DownloadItemCell; 11 @class DownloadItemCell;
12 @class DownloadItemButton; 12 @class DownloadItemButton;
13 class DownloadItemMac; 13 class DownloadItemMac;
14 class DownloadItemModel; 14 class DownloadItemModel;
15 class DownloadShelfContextMenuMac; 15 class DownloadShelfContextMenuMac;
16 @class DownloadShelfController; 16 @class DownloadShelfController;
17 @class GTMWidthBasedTweaker; 17 @class GTMWidthBasedTweaker;
18 18
19 namespace content { 19 namespace content {
20 class DownloadItem; 20 class DownloadItem;
21 class PageNavigator; 21 class PageNavigator;
22 } 22 }
23 23
24 namespace extensions {
25 class ExperienceSamplingEvent;
26 }
27
24 namespace gfx { 28 namespace gfx {
25 class FontList; 29 class FontList;
26 } 30 }
27 31
28 namespace ui { 32 namespace ui {
29 class MenuModel; 33 class MenuModel;
30 } 34 }
31 35
32 // A controller class that manages one download item. 36 // A controller class that manages one download item.
33 37
(...skipping 30 matching lines...) Expand all
64 base::Time creationTime_; 68 base::Time creationTime_;
65 69
66 // Default font list to use for text metrics. 70 // Default font list to use for text metrics.
67 scoped_ptr<gfx::FontList> font_list_; 71 scoped_ptr<gfx::FontList> font_list_;
68 72
69 // The state of this item. 73 // The state of this item.
70 enum DownoadItemState { 74 enum DownoadItemState {
71 kNormal, 75 kNormal,
72 kDangerous 76 kDangerous
73 } state_; 77 } state_;
78
79 // ExperienceSampling: This tracks dangerous/malicious downloads warning UI
80 // and the user's decisions about it.
81 scoped_ptr<extensions::ExperienceSamplingEvent> sampling_event_;
74 }; 82 };
75 83
76 // Initialize controller for |downloadItem|. 84 // Initialize controller for |downloadItem|.
77 - (id)initWithDownload:(content::DownloadItem*)downloadItem 85 - (id)initWithDownload:(content::DownloadItem*)downloadItem
78 shelf:(DownloadShelfController*)shelf 86 shelf:(DownloadShelfController*)shelf
79 navigator:(content::PageNavigator*)navigator; 87 navigator:(content::PageNavigator*)navigator;
80 88
81 // Updates the UI and menu state from |downloadModel|. 89 // Updates the UI and menu state from |downloadModel|.
82 - (void)setStateFromDownload:(DownloadItemModel*)downloadModel; 90 - (void)setStateFromDownload:(DownloadItemModel*)downloadModel;
83 91
(...skipping 28 matching lines...) Expand all
112 - (void)updateToolTip; 120 - (void)updateToolTip;
113 121
114 // Handling of dangerous downloads 122 // Handling of dangerous downloads
115 - (void)clearDangerousMode; 123 - (void)clearDangerousMode;
116 - (BOOL)isDangerousMode; 124 - (BOOL)isDangerousMode;
117 - (IBAction)saveDownload:(id)sender; 125 - (IBAction)saveDownload:(id)sender;
118 - (IBAction)discardDownload:(id)sender; 126 - (IBAction)discardDownload:(id)sender;
119 - (IBAction)dismissMaliciousDownload:(id)sender; 127 - (IBAction)dismissMaliciousDownload:(id)sender;
120 - (IBAction)showContextMenu:(id)sender; 128 - (IBAction)showContextMenu:(id)sender;
121 @end 129 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698