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

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

Issue 8851007: WIP / Do not commit (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 // manager as well. 351 // manager as well.
352 if (profile->GetOriginalProfile() != profile) 352 if (profile->GetOriginalProfile() != profile)
353 DownloadServiceFactory::GetForProfile( 353 DownloadServiceFactory::GetForProfile(
354 profile->GetOriginalProfile())-> 354 profile->GetOriginalProfile())->
355 GetDownloadManager()->RemoveAllDownloads(); 355 GetDownloadManager()->RemoveAllDownloads();
356 } 356 }
357 357
358 void DownloadsDOMHandler::HandleOpenDownloadsFolder(const ListValue* args) { 358 void DownloadsDOMHandler::HandleOpenDownloadsFolder(const ListValue* args) {
359 CountDownloadsDOMEvents(DOWNLOADS_DOM_EVENT_OPEN_FOLDER); 359 CountDownloadsDOMEvents(DOWNLOADS_DOM_EVENT_OPEN_FOLDER);
360 platform_util::OpenItem( 360 platform_util::OpenItem(
361 DownloadPrefs::FromDownloadManager(download_manager_)->download_path()); 361 DownloadPrefs::FromDownloadManager(download_manager_)->download_path(),
362 NULL);
362 } 363 }
363 364
364 // DownloadsDOMHandler, private: ---------------------------------------------- 365 // DownloadsDOMHandler, private: ----------------------------------------------
365 366
366 void DownloadsDOMHandler::SendCurrentDownloads() { 367 void DownloadsDOMHandler::SendCurrentDownloads() {
367 ListValue results_value; 368 ListValue results_value;
368 for (OrderedDownloads::iterator it = download_items_.begin(); 369 for (OrderedDownloads::iterator it = download_items_.begin();
369 it != download_items_.end(); ++it) { 370 it != download_items_.end(); ++it) {
370 int index = static_cast<int>(it - download_items_.begin()); 371 int index = static_cast<int>(it - download_items_.begin());
371 if (index > kMaxDownloads) 372 if (index > kMaxDownloads)
(...skipping 28 matching lines...) Expand all
400 return NULL; 401 return NULL;
401 } 402 }
402 403
403 DownloadItem* DownloadsDOMHandler::GetDownloadByValue(const ListValue* args) { 404 DownloadItem* DownloadsDOMHandler::GetDownloadByValue(const ListValue* args) {
404 int id; 405 int id;
405 if (ExtractIntegerValue(args, &id)) { 406 if (ExtractIntegerValue(args, &id)) {
406 return GetDownloadById(id); 407 return GetDownloadById(id);
407 } 408 }
408 return NULL; 409 return NULL;
409 } 410 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/chrome_web_ui_factory.cc ('k') | chrome/browser/ui/webui/repost_form_warning_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698