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

Side by Side Diff: chrome/browser/download/download_test_file_chooser_observer.cc

Issue 12047039: download: Remove DownloadManager::MockDownloadOpenForTesting (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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 #include "chrome/browser/download/download_test_file_chooser_observer.h" 5 #include "chrome/browser/download/download_test_file_chooser_observer.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "chrome/browser/download/chrome_download_manager_delegate.h" 9 #include "chrome/browser/download/chrome_download_manager_delegate.h"
10 #include "chrome/browser/download/download_service.h" 10 #include "chrome/browser/download/download_service.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 const FilePath& suggested_path, 43 const FilePath& suggested_path,
44 const FileSelectedCallback& 44 const FileSelectedCallback&
45 callback) OVERRIDE { 45 callback) OVERRIDE {
46 file_chooser_displayed_ = true; 46 file_chooser_displayed_ = true;
47 MessageLoop::current()->PostTask( 47 MessageLoop::current()->PostTask(
48 FROM_HERE, 48 FROM_HERE,
49 base::Bind(callback, 49 base::Bind(callback,
50 (file_chooser_enabled_ ? suggested_path : FilePath()))); 50 (file_chooser_enabled_ ? suggested_path : FilePath())));
51 } 51 }
52 52
53 virtual void OpenDownload(content::DownloadItem* item) OVERRIDE {}
Randy Smith (Not in Mondays) 2013/01/23 21:23:34 Is this class being used in DownloadTest.AutoOpen?
hashimoto 2013/01/24 05:52:31 Both DownloadTest.AutoOpen and DownloadExtensionTe
54
53 private: 55 private:
54 virtual ~MockFileChooserDownloadManagerDelegate() {} 56 virtual ~MockFileChooserDownloadManagerDelegate() {}
55 57
56 bool file_chooser_enabled_; 58 bool file_chooser_enabled_;
57 bool file_chooser_displayed_; 59 bool file_chooser_displayed_;
58 }; 60 };
59 61
60 } // namespace internal 62 } // namespace internal
61 63
62 DownloadTestFileChooserObserver::DownloadTestFileChooserObserver( 64 DownloadTestFileChooserObserver::DownloadTestFileChooserObserver(
63 Profile* profile) { 65 Profile* profile) {
64 test_delegate_ = 66 test_delegate_ =
65 new internal::MockFileChooserDownloadManagerDelegate(profile); 67 new internal::MockFileChooserDownloadManagerDelegate(profile);
66 DownloadServiceFactory::GetForProfile(profile)-> 68 DownloadServiceFactory::GetForProfile(profile)->
67 SetDownloadManagerDelegateForTesting(test_delegate_.get()); 69 SetDownloadManagerDelegateForTesting(test_delegate_.get());
68 } 70 }
69 71
70 DownloadTestFileChooserObserver::~DownloadTestFileChooserObserver() { 72 DownloadTestFileChooserObserver::~DownloadTestFileChooserObserver() {
71 } 73 }
72 74
73 void DownloadTestFileChooserObserver::EnableFileChooser(bool enable) { 75 void DownloadTestFileChooserObserver::EnableFileChooser(bool enable) {
74 test_delegate_->EnableFileChooser(enable); 76 test_delegate_->EnableFileChooser(enable);
75 } 77 }
76 78
77 bool DownloadTestFileChooserObserver::TestAndResetDidShowFileChooser() { 79 bool DownloadTestFileChooserObserver::TestAndResetDidShowFileChooser() {
78 return test_delegate_->TestAndResetDidShowFileChooser(); 80 return test_delegate_->TestAndResetDidShowFileChooser();
79 } 81 }
80
OLDNEW
« no previous file with comments | « chrome/browser/download/download_browsertest.cc ('k') | chrome/browser/extensions/api/downloads/downloads_api_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698