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

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

Issue 14773004: Move download filename determination into a separate class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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_activity_observer.h" 5 #include "chrome/browser/download/download_test_file_activity_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 20 matching lines...) Expand all
31 } 31 }
32 32
33 bool TestAndResetDidShowFileChooser() { 33 bool TestAndResetDidShowFileChooser() {
34 bool did_show = file_chooser_displayed_; 34 bool did_show = file_chooser_displayed_;
35 file_chooser_displayed_ = false; 35 file_chooser_displayed_ = false;
36 return did_show; 36 return did_show;
37 } 37 }
38 38
39 protected: 39 protected:
40 40
41 virtual void ChooseDownloadPath(content::DownloadItem* item, 41 virtual void PromptUserForDownloadPath(content::DownloadItem* item,
42 const base::FilePath& suggested_path, 42 const base::FilePath& suggested_path,
43 const FileSelectedCallback& 43 const FileSelectedCallback&
44 callback) OVERRIDE { 44 callback) OVERRIDE {
45 file_chooser_displayed_ = true; 45 file_chooser_displayed_ = true;
46 MessageLoop::current()->PostTask( 46 MessageLoop::current()->PostTask(
47 FROM_HERE, base::Bind(callback, (file_chooser_enabled_ ? suggested_path 47 FROM_HERE, base::Bind(callback, (file_chooser_enabled_ ? suggested_path
48 : base::FilePath()))); 48 : base::FilePath())));
49 } 49 }
50 50
51 virtual void OpenDownload(content::DownloadItem* item) OVERRIDE {} 51 virtual void OpenDownload(content::DownloadItem* item) OVERRIDE {}
52 52
53 private: 53 private:
54 virtual ~MockDownloadManagerDelegate() {} 54 virtual ~MockDownloadManagerDelegate() {}
(...skipping 12 matching lines...) Expand all
67 DownloadTestFileActivityObserver::~DownloadTestFileActivityObserver() { 67 DownloadTestFileActivityObserver::~DownloadTestFileActivityObserver() {
68 } 68 }
69 69
70 void DownloadTestFileActivityObserver::EnableFileChooser(bool enable) { 70 void DownloadTestFileActivityObserver::EnableFileChooser(bool enable) {
71 test_delegate_->EnableFileChooser(enable); 71 test_delegate_->EnableFileChooser(enable);
72 } 72 }
73 73
74 bool DownloadTestFileActivityObserver::TestAndResetDidShowFileChooser() { 74 bool DownloadTestFileActivityObserver::TestAndResetDidShowFileChooser() {
75 return test_delegate_->TestAndResetDidShowFileChooser(); 75 return test_delegate_->TestAndResetDidShowFileChooser();
76 } 76 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698