| 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 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 | 112 |
| 113 WebUIHandlerTaskProxy::WebUIHandlerTaskProxy(Delegate* delegate) { | 113 WebUIHandlerTaskProxy::WebUIHandlerTaskProxy(Delegate* delegate) { |
| 114 delegate_ = delegate->AsWeakPtr(); | 114 delegate_ = delegate->AsWeakPtr(); |
| 115 delegate_->DetachFromThread(); | 115 delegate_->DetachFromThread(); |
| 116 } | 116 } |
| 117 | 117 |
| 118 WebUIHandlerTaskProxy::~WebUIHandlerTaskProxy() { | 118 WebUIHandlerTaskProxy::~WebUIHandlerTaskProxy() { |
| 119 } | 119 } |
| 120 | 120 |
| 121 void WebUIHandlerTaskProxy::DeleteOnUIThread() { | 121 void WebUIHandlerTaskProxy::DeleteOnUIThread() { |
| 122 BrowserThread::PostTask( | 122 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, |
| 123 BrowserThread::UI, FROM_HERE, | 123 base::Bind(&base::DoNothing)); |
| 124 base::Bind(&WebUIHandlerTaskProxy::DoNothing, this)); | |
| 125 } | 124 } |
| 126 | 125 |
| 127 //////////////////////////////////////////////////////////////////////////////// | 126 //////////////////////////////////////////////////////////////////////////////// |
| 128 // | 127 // |
| 129 // WebUIHandler | 128 // WebUIHandler |
| 130 // | 129 // |
| 131 //////////////////////////////////////////////////////////////////////////////// | 130 //////////////////////////////////////////////////////////////////////////////// |
| 132 | 131 |
| 133 WebUIHandler::WebUIHandler(WebContents* contents) | 132 WebUIHandler::WebUIHandler(WebContents* contents) |
| 134 : web_contents_(contents), | 133 : web_contents_(contents), |
| (...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 647 //////////////////////////////////////////////////////////////////////////////// | 646 //////////////////////////////////////////////////////////////////////////////// |
| 648 | 647 |
| 649 ImageBurnUI::ImageBurnUI(WebContents* contents) : ChromeWebUI(contents) { | 648 ImageBurnUI::ImageBurnUI(WebContents* contents) : ChromeWebUI(contents) { |
| 650 imageburner::WebUIHandler* handler = new imageburner::WebUIHandler(contents); | 649 imageburner::WebUIHandler* handler = new imageburner::WebUIHandler(contents); |
| 651 AddMessageHandler(handler); | 650 AddMessageHandler(handler); |
| 652 | 651 |
| 653 Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext()); | 652 Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext()); |
| 654 profile->GetChromeURLDataManager()->AddDataSource( | 653 profile->GetChromeURLDataManager()->AddDataSource( |
| 655 CreateImageburnerUIHTMLSource()); | 654 CreateImageburnerUIHTMLSource()); |
| 656 } | 655 } |
| OLD | NEW |