OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "content/browser/indexed_db/indexed_db_internals_ui.h" | 5 #include "content/browser/indexed_db/indexed_db_internals_ui.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 explicit FileDeleter(const base::FilePath& temp_dir) : temp_dir_(temp_dir) {} | 303 explicit FileDeleter(const base::FilePath& temp_dir) : temp_dir_(temp_dir) {} |
304 virtual ~FileDeleter(); | 304 virtual ~FileDeleter(); |
305 | 305 |
306 virtual void OnDownloadUpdated(DownloadItem* download) OVERRIDE; | 306 virtual void OnDownloadUpdated(DownloadItem* download) OVERRIDE; |
307 virtual void OnDownloadOpened(DownloadItem* item) OVERRIDE {} | 307 virtual void OnDownloadOpened(DownloadItem* item) OVERRIDE {} |
308 virtual void OnDownloadRemoved(DownloadItem* item) OVERRIDE {} | 308 virtual void OnDownloadRemoved(DownloadItem* item) OVERRIDE {} |
309 virtual void OnDownloadDestroyed(DownloadItem* item) OVERRIDE {} | 309 virtual void OnDownloadDestroyed(DownloadItem* item) OVERRIDE {} |
310 | 310 |
311 private: | 311 private: |
312 const base::FilePath temp_dir_; | 312 const base::FilePath temp_dir_; |
| 313 |
| 314 DISALLOW_COPY_AND_ASSIGN(FileDeleter); |
313 }; | 315 }; |
314 | 316 |
315 void FileDeleter::OnDownloadUpdated(DownloadItem* item) { | 317 void FileDeleter::OnDownloadUpdated(DownloadItem* item) { |
316 switch (item->GetState()) { | 318 switch (item->GetState()) { |
317 case DownloadItem::IN_PROGRESS: | 319 case DownloadItem::IN_PROGRESS: |
318 break; | 320 break; |
319 case DownloadItem::COMPLETE: | 321 case DownloadItem::COMPLETE: |
320 case DownloadItem::CANCELLED: | 322 case DownloadItem::CANCELLED: |
321 case DownloadItem::INTERRUPTED: { | 323 case DownloadItem::INTERRUPTED: { |
322 item->RemoveObserver(this); | 324 item->RemoveObserver(this); |
(...skipping 27 matching lines...) Expand all Loading... |
350 | 352 |
351 item->AddObserver(new FileDeleter(temp_path)); | 353 item->AddObserver(new FileDeleter(temp_path)); |
352 web_ui()->CallJavascriptFunction( | 354 web_ui()->CallJavascriptFunction( |
353 "indexeddb.onOriginDownloadReady", | 355 "indexeddb.onOriginDownloadReady", |
354 base::StringValue(partition_path.value()), | 356 base::StringValue(partition_path.value()), |
355 base::StringValue(origin_url.spec()), | 357 base::StringValue(origin_url.spec()), |
356 base::FundamentalValue(double(connection_count))); | 358 base::FundamentalValue(double(connection_count))); |
357 } | 359 } |
358 | 360 |
359 } // namespace content | 361 } // namespace content |
OLD | NEW |