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 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 } |
OLD | NEW |