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

Side by Side Diff: chrome/browser/ui/webui/downloads_dom_handler.cc

Issue 10915180: Make DownloadHistory observe manager, items (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 3 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/ui/webui/downloads_dom_handler.h" 5 #include "chrome/browser/ui/webui/downloads_dom_handler.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 CountDownloadsDOMEvents(DOWNLOADS_DOM_EVENT_PAUSE); 409 CountDownloadsDOMEvents(DOWNLOADS_DOM_EVENT_PAUSE);
410 content::DownloadItem* file = GetDownloadByValue(args); 410 content::DownloadItem* file = GetDownloadByValue(args);
411 if (file) 411 if (file)
412 file->TogglePause(); 412 file->TogglePause();
413 } 413 }
414 414
415 void DownloadsDOMHandler::HandleRemove(const base::ListValue* args) { 415 void DownloadsDOMHandler::HandleRemove(const base::ListValue* args) {
416 CountDownloadsDOMEvents(DOWNLOADS_DOM_EVENT_REMOVE); 416 CountDownloadsDOMEvents(DOWNLOADS_DOM_EVENT_REMOVE);
417 content::DownloadItem* file = GetDownloadByValue(args); 417 content::DownloadItem* file = GetDownloadByValue(args);
418 if (file) { 418 if (file) {
419 DCHECK(file->IsPersisted());
Randy Smith (Not in Mondays) 2012/09/11 18:36:53 Any idea why this check was here in the first plac
benjhayden 2012/09/13 15:18:16 When a user clicks "Remove" on chrome://downloads,
420 file->Remove(); 419 file->Remove();
421 } 420 }
422 } 421 }
423 422
424 void DownloadsDOMHandler::HandleCancel(const base::ListValue* args) { 423 void DownloadsDOMHandler::HandleCancel(const base::ListValue* args) {
425 CountDownloadsDOMEvents(DOWNLOADS_DOM_EVENT_CANCEL); 424 CountDownloadsDOMEvents(DOWNLOADS_DOM_EVENT_CANCEL);
426 content::DownloadItem* file = GetDownloadByValue(args); 425 content::DownloadItem* file = GetDownloadByValue(args);
427 if (file) 426 if (file)
428 file->Cancel(true); 427 file->Cancel(true);
429 } 428 }
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 } 523 }
525 524
526 void DownloadsDOMHandler::CallDownloadsList(const base::ListValue& downloads) { 525 void DownloadsDOMHandler::CallDownloadsList(const base::ListValue& downloads) {
527 web_ui()->CallJavascriptFunction("downloadsList", downloads); 526 web_ui()->CallJavascriptFunction("downloadsList", downloads);
528 } 527 }
529 528
530 void DownloadsDOMHandler::CallDownloadUpdated( 529 void DownloadsDOMHandler::CallDownloadUpdated(
531 const base::ListValue& download_item) { 530 const base::ListValue& download_item) {
532 web_ui()->CallJavascriptFunction("downloadUpdated", download_item); 531 web_ui()->CallJavascriptFunction("downloadUpdated", download_item);
533 } 532 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698