OLD | NEW |
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 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 | 506 |
507 // Do cleanup. | 507 // Do cleanup. |
508 if (state == StateMachine::DOWNLOADING) { | 508 if (state == StateMachine::DOWNLOADING) { |
509 if (active_download_item_) { | 509 if (active_download_item_) { |
510 // This will trigger Download canceled event. As a response to that event, | 510 // This will trigger Download canceled event. As a response to that event, |
511 // handlers will remove themselves as observers from download manager and | 511 // handlers will remove themselves as observers from download manager and |
512 // item. | 512 // item. |
513 // We don't want to process Download Cancelled signal. | 513 // We don't want to process Download Cancelled signal. |
514 active_download_item_->RemoveObserver(this); | 514 active_download_item_->RemoveObserver(this); |
515 if (active_download_item_->IsPartialDownload()) | 515 if (active_download_item_->IsPartialDownload()) |
516 active_download_item_->Cancel(true); | 516 active_download_item_->Cancel(); |
517 active_download_item_->Delete(DownloadItem::DELETE_DUE_TO_USER_DISCARD); | 517 active_download_item_->Delete(DownloadItem::DELETE_DUE_TO_USER_DISCARD); |
518 active_download_item_ = NULL; | 518 active_download_item_ = NULL; |
519 CleanupDownloadObjects(); | 519 CleanupDownloadObjects(); |
520 } | 520 } |
521 } else if (state == StateMachine::BURNING) { | 521 } else if (state == StateMachine::BURNING) { |
522 DCHECK(observing_burn_lib_); | 522 DCHECK(observing_burn_lib_); |
523 // Burn library doesn't send cancelled signal upon CancelBurnImage | 523 // Burn library doesn't send cancelled signal upon CancelBurnImage |
524 // invokation. | 524 // invokation. |
525 chromeos::CrosLibrary::Get()->GetBurnLibrary()->CancelBurnImage(); | 525 chromeos::CrosLibrary::Get()->GetBurnLibrary()->CancelBurnImage(); |
526 chromeos::CrosLibrary::Get()->GetBurnLibrary()->RemoveObserver(this); | 526 chromeos::CrosLibrary::Get()->GetBurnLibrary()->RemoveObserver(this); |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
667 // ImageBurnUI | 667 // ImageBurnUI |
668 // | 668 // |
669 //////////////////////////////////////////////////////////////////////////////// | 669 //////////////////////////////////////////////////////////////////////////////// |
670 | 670 |
671 ImageBurnUI::ImageBurnUI(TabContents* contents) : ChromeWebUI(contents) { | 671 ImageBurnUI::ImageBurnUI(TabContents* contents) : ChromeWebUI(contents) { |
672 imageburner::WebUIHandler* handler = new imageburner::WebUIHandler(contents); | 672 imageburner::WebUIHandler* handler = new imageburner::WebUIHandler(contents); |
673 AddMessageHandler((handler)->Attach(this)); | 673 AddMessageHandler((handler)->Attach(this)); |
674 imageburner::UIHTMLSource* html_source = new imageburner::UIHTMLSource(); | 674 imageburner::UIHTMLSource* html_source = new imageburner::UIHTMLSource(); |
675 contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source); | 675 contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source); |
676 } | 676 } |
OLD | NEW |