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

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

Issue 640353003: Use scoped_ptr::Pass instead of scoped_ptr::PassAs<T>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix typo Created 6 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
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/message_loop.h" 8 #include "base/message_loop/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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 bool file_chooser_enabled_; 65 bool file_chooser_enabled_;
66 bool file_chooser_displayed_; 66 bool file_chooser_displayed_;
67 base::WeakPtrFactory<MockDownloadManagerDelegate> weak_ptr_factory_; 67 base::WeakPtrFactory<MockDownloadManagerDelegate> weak_ptr_factory_;
68 }; 68 };
69 69
70 DownloadTestFileActivityObserver::DownloadTestFileActivityObserver( 70 DownloadTestFileActivityObserver::DownloadTestFileActivityObserver(
71 Profile* profile) { 71 Profile* profile) {
72 scoped_ptr<MockDownloadManagerDelegate> mock_delegate( 72 scoped_ptr<MockDownloadManagerDelegate> mock_delegate(
73 new MockDownloadManagerDelegate(profile)); 73 new MockDownloadManagerDelegate(profile));
74 test_delegate_ = mock_delegate->GetWeakPtr(); 74 test_delegate_ = mock_delegate->GetWeakPtr();
75 DownloadServiceFactory::GetForBrowserContext(profile)-> 75 DownloadServiceFactory::GetForBrowserContext(profile)
76 SetDownloadManagerDelegateForTesting( 76 ->SetDownloadManagerDelegateForTesting(mock_delegate.Pass());
77 mock_delegate.PassAs<ChromeDownloadManagerDelegate>());
78 } 77 }
79 78
80 DownloadTestFileActivityObserver::~DownloadTestFileActivityObserver() { 79 DownloadTestFileActivityObserver::~DownloadTestFileActivityObserver() {
81 } 80 }
82 81
83 void DownloadTestFileActivityObserver::EnableFileChooser(bool enable) { 82 void DownloadTestFileActivityObserver::EnableFileChooser(bool enable) {
84 if (test_delegate_.get()) 83 if (test_delegate_.get())
85 test_delegate_->EnableFileChooser(enable); 84 test_delegate_->EnableFileChooser(enable);
86 } 85 }
87 86
88 bool DownloadTestFileActivityObserver::TestAndResetDidShowFileChooser() { 87 bool DownloadTestFileActivityObserver::TestAndResetDidShowFileChooser() {
89 return test_delegate_.get() && 88 return test_delegate_.get() &&
90 test_delegate_->TestAndResetDidShowFileChooser(); 89 test_delegate_->TestAndResetDidShowFileChooser();
91 } 90 }
OLDNEW
« no previous file with comments | « chrome/browser/dom_distiller/tab_utils.cc ('k') | chrome/browser/download/download_ui_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698