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

Side by Side Diff: chrome/browser/ui/webui/chromeos/imageburner/imageburner_ui.cc

Issue 7796014: Make cancel remove cancelled download from active queues at time of cancel. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix to try to get past main waterfall failure. Created 9 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) 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/chromeos/imageburner/imageburner_ui.h" 5 #include "chrome/browser/ui/webui/chromeos/imageburner/imageburner_ui.h"
6 #include "chrome/browser/ui/webui/chromeos/imageburner/webui_handler.h" 6 #include "chrome/browser/ui/webui/chromeos/imageburner/webui_handler.h"
7 7
8 #include "base/i18n/rtl.h" 8 #include "base/i18n/rtl.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/task.h" 10 #include "base/task.h"
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 502
503 // Do cleanup. 503 // Do cleanup.
504 if (state == StateMachine::DOWNLOADING) { 504 if (state == StateMachine::DOWNLOADING) {
505 if (active_download_item_) { 505 if (active_download_item_) {
506 // This will trigger Download canceled event. As a response to that event, 506 // This will trigger Download canceled event. As a response to that event,
507 // handlers will remove themselves as observers from download manager and 507 // handlers will remove themselves as observers from download manager and
508 // item. 508 // item.
509 // We don't want to process Download Cancelled signal. 509 // We don't want to process Download Cancelled signal.
510 active_download_item_->RemoveObserver(this); 510 active_download_item_->RemoveObserver(this);
511 if (active_download_item_->IsPartialDownload()) 511 if (active_download_item_->IsPartialDownload())
512 active_download_item_->Cancel(true); 512 active_download_item_->Cancel();
513 active_download_item_->Delete(DownloadItem::DELETE_DUE_TO_USER_DISCARD); 513 active_download_item_->Delete(DownloadItem::DELETE_DUE_TO_USER_DISCARD);
514 active_download_item_ = NULL; 514 active_download_item_ = NULL;
515 CleanupDownloadObjects(); 515 CleanupDownloadObjects();
516 } 516 }
517 } else if (state == StateMachine::BURNING) { 517 } else if (state == StateMachine::BURNING) {
518 DCHECK(observing_burn_lib_); 518 DCHECK(observing_burn_lib_);
519 // Burn library doesn't send cancelled signal upon CancelBurnImage 519 // Burn library doesn't send cancelled signal upon CancelBurnImage
520 // invokation. 520 // invokation.
521 chromeos::CrosLibrary::Get()->GetBurnLibrary()->CancelBurnImage(); 521 chromeos::CrosLibrary::Get()->GetBurnLibrary()->CancelBurnImage();
522 chromeos::CrosLibrary::Get()->GetBurnLibrary()->RemoveObserver(this); 522 chromeos::CrosLibrary::Get()->GetBurnLibrary()->RemoveObserver(this);
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 // 664 //
665 //////////////////////////////////////////////////////////////////////////////// 665 ////////////////////////////////////////////////////////////////////////////////
666 666
667 ImageBurnUI::ImageBurnUI(TabContents* contents) : ChromeWebUI(contents) { 667 ImageBurnUI::ImageBurnUI(TabContents* contents) : ChromeWebUI(contents) {
668 imageburner::WebUIHandler* handler = new imageburner::WebUIHandler(contents); 668 imageburner::WebUIHandler* handler = new imageburner::WebUIHandler(contents);
669 AddMessageHandler((handler)->Attach(this)); 669 AddMessageHandler((handler)->Attach(this));
670 imageburner::UIHTMLSource* html_source = new imageburner::UIHTMLSource(); 670 imageburner::UIHTMLSource* html_source = new imageburner::UIHTMLSource();
671 Profile* profile = Profile::FromBrowserContext(contents->browser_context()); 671 Profile* profile = Profile::FromBrowserContext(contents->browser_context());
672 profile->GetChromeURLDataManager()->AddDataSource(html_source); 672 profile->GetChromeURLDataManager()->AddDataSource(html_source);
673 } 673 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/active_downloads_ui.cc ('k') | chrome/browser/ui/webui/downloads_dom_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698