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

Side by Side Diff: chrome/browser/download/download_test_file_activity_observer.h

Issue 12047039: download: Remove DownloadManager::MockDownloadOpenForTesting (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase and comment fix Created 7 years, 10 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) 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 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_TEST_FILE_CHOOSER_OBSERVER_H_ 5 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_TEST_FILE_ACTIVITY_OBSERVER_H_
6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_TEST_FILE_CHOOSER_OBSERVER_H_ 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_TEST_FILE_ACTIVITY_OBSERVER_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 9
10 class Profile; 10 class Profile;
11 11
12 namespace internal { 12 // Observes and overrides file chooser dialog and open activity for a profile.
13 class MockFileChooserDownloadManagerDelegate; 13 // By default, once attached to a profile, this class overrides the default file
14 } 14 // related activity by replacing the ChromeDownloadManagerDelegate associated
15 15 // with |profile|.
16 // Observes and overrides file chooser activity for a profile. By default, once
17 // attached to a profile, this class overrides the default file chooser by
18 // replacing the ChromeDownloadManagerDelegate associated with |profile|.
19 // NOTE: Again, this overrides the ChromeDownloadManagerDelegate for |profile|. 16 // NOTE: Again, this overrides the ChromeDownloadManagerDelegate for |profile|.
20 class DownloadTestFileChooserObserver { 17 class DownloadTestFileActivityObserver {
21 public: 18 public:
22 // Attaches to |profile|. By default file chooser dialogs will be disabled 19 // Attaches to |profile|. By default file chooser dialogs will be disabled
23 // once attached. Call EnableFileChooser() to re-enable. 20 // once attached. Call EnableFileChooser() to re-enable.
24 explicit DownloadTestFileChooserObserver(Profile* profile); 21 explicit DownloadTestFileActivityObserver(Profile* profile);
25 ~DownloadTestFileChooserObserver(); 22 ~DownloadTestFileActivityObserver();
26 23
27 // Sets whether the file chooser dialog is enabled. If |enable| is false, any 24 // Sets whether the file chooser dialog is enabled. If |enable| is false, any
28 // attempt to display a file chooser dialog will cause the download to be 25 // attempt to display a file chooser dialog will cause the download to be
29 // canceled. Otherwise, attempting to display a file chooser dialog will 26 // canceled. Otherwise, attempting to display a file chooser dialog will
30 // result in the download continuing with the suggested path. 27 // result in the download continuing with the suggested path.
31 void EnableFileChooser(bool enable); 28 void EnableFileChooser(bool enable);
32 29
33 // Returns true if a file chooser dialog was displayed since the last time 30 // Returns true if a file chooser dialog was displayed since the last time
34 // this method was called. 31 // this method was called.
35 bool TestAndResetDidShowFileChooser(); 32 bool TestAndResetDidShowFileChooser();
36 33
37 private: 34 private:
38 scoped_refptr<internal::MockFileChooserDownloadManagerDelegate> 35 class MockDownloadManagerDelegate;
39 test_delegate_; 36
37 scoped_refptr<MockDownloadManagerDelegate> test_delegate_;
40 }; 38 };
41 39
42 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_TEST_FILE_CHOOSER_OBSERVER_H_ 40 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_TEST_FILE_ACTIVITY_OBSERVER_H_
OLDNEW
« no previous file with comments | « chrome/browser/download/download_browsertest.cc ('k') | chrome/browser/download/download_test_file_activity_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698