| OLD | NEW |
| 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 <algorithm> | 5 #include <algorithm> |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
| 9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 content::Source<DownloadsNotificationSource>(source).ptr(); | 176 content::Source<DownloadsNotificationSource>(source).ptr(); |
| 177 Event* new_event = new Event( | 177 Event* new_event = new Event( |
| 178 dns->profile, | 178 dns->profile, |
| 179 dns->event_name, | 179 dns->event_name, |
| 180 *content::Details<std::string>(details).ptr(), base::Time::Now()); | 180 *content::Details<std::string>(details).ptr(), base::Time::Now()); |
| 181 events_.push_back(new_event); | 181 events_.push_back(new_event); |
| 182 if (waiting_ && | 182 if (waiting_ && |
| 183 waiting_for_.get() && | 183 waiting_for_.get() && |
| 184 waiting_for_->Equals(*new_event)) { | 184 waiting_for_->Equals(*new_event)) { |
| 185 waiting_ = false; | 185 waiting_ = false; |
| 186 MessageLoopForUI::current()->Quit(); | 186 base::MessageLoopForUI::current()->Quit(); |
| 187 } | 187 } |
| 188 break; | 188 break; |
| 189 } | 189 } |
| 190 default: | 190 default: |
| 191 NOTREACHED(); | 191 NOTREACHED(); |
| 192 } | 192 } |
| 193 } | 193 } |
| 194 | 194 |
| 195 bool WaitFor(Profile* profile, | 195 bool WaitFor(Profile* profile, |
| 196 const std::string& event_name, | 196 const std::string& event_name, |
| (...skipping 3076 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3273 item->GetId(), | 3273 item->GetId(), |
| 3274 GetFilename("42.txt.crdownload").c_str(), | 3274 GetFilename("42.txt.crdownload").c_str(), |
| 3275 GetFilename("42.txt").c_str()))); | 3275 GetFilename("42.txt").c_str()))); |
| 3276 } | 3276 } |
| 3277 | 3277 |
| 3278 // TODO(benjhayden) Figure out why DisableExtension() does not fire | 3278 // TODO(benjhayden) Figure out why DisableExtension() does not fire |
| 3279 // OnListenerRemoved. | 3279 // OnListenerRemoved. |
| 3280 | 3280 |
| 3281 // TODO(benjhayden) Test that the shelf is shown for download() both with and | 3281 // TODO(benjhayden) Test that the shelf is shown for download() both with and |
| 3282 // without a WebContents. | 3282 // without a WebContents. |
| OLD | NEW |