| 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 | 5 |
| 6 #ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_IMAGEBURNER_WEBUI_HANDLER_H_ | 6 #ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_IMAGEBURNER_WEBUI_HANDLER_H_ |
| 7 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_IMAGEBURNER_WEBUI_HANDLER_H_ | 7 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_IMAGEBURNER_WEBUI_HANDLER_H_ |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/bind.h" | |
| 12 #include "base/file_path.h" | 11 #include "base/file_path.h" |
| 13 #include "base/string16.h" | 12 #include "base/string16.h" |
| 14 #include "base/values.h" | 13 #include "base/values.h" |
| 15 #include "chrome/browser/chromeos/cros/burn_library.h" | 14 #include "chrome/browser/chromeos/cros/burn_library.h" |
| 16 #include "chrome/browser/chromeos/cros/cros_library.h" | 15 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 17 #include "chrome/browser/chromeos/cros/network_library.h" | 16 #include "chrome/browser/chromeos/cros/network_library.h" |
| 18 #include "chrome/browser/chromeos/disks/disk_mount_manager.h" | 17 #include "chrome/browser/chromeos/disks/disk_mount_manager.h" |
| 19 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" | 18 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" |
| 20 #include "chrome/browser/ui/webui/chromeos/imageburner/imageburner_utils.h" | 19 #include "chrome/browser/ui/webui/chromeos/imageburner/imageburner_utils.h" |
| 21 #include "content/browser/download/download_item.h" | 20 #include "content/browser/download/download_item.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 49 delegate_->CreateImageDirOnFileThread(); | 48 delegate_->CreateImageDirOnFileThread(); |
| 50 } | 49 } |
| 51 | 50 |
| 52 void OnImageDirCreated(bool success) { | 51 void OnImageDirCreated(bool success) { |
| 53 if (delegate_) | 52 if (delegate_) |
| 54 delegate_->ImageDirCreatedOnUIThread(success); | 53 delegate_->ImageDirCreatedOnUIThread(success); |
| 55 } | 54 } |
| 56 | 55 |
| 57 // WebUIHandlerTaskProxy is created on the UI thread, so in some cases, | 56 // WebUIHandlerTaskProxy is created on the UI thread, so in some cases, |
| 58 // we need to post back to the UI thread for destruction. | 57 // we need to post back to the UI thread for destruction. |
| 59 void DeleteOnUIThread() { | 58 void DeleteOnUIThread(); |
| 60 BrowserThread::PostTask( | |
| 61 BrowserThread::UI, FROM_HERE, | |
| 62 base::Bind(&WebUIHandlerTaskProxy::DoNothing, this)); | |
| 63 } | |
| 64 | 59 |
| 65 void DoNothing() {} | 60 void DoNothing() {} |
| 66 | 61 |
| 67 private: | 62 private: |
| 68 base::WeakPtr<Delegate> delegate_; | 63 base::WeakPtr<Delegate> delegate_; |
| 69 | 64 |
| 70 friend class base::RefCountedThreadSafe<WebUIHandlerTaskProxy>; | 65 friend class base::RefCountedThreadSafe<WebUIHandlerTaskProxy>; |
| 71 ~WebUIHandlerTaskProxy(); | 66 ~WebUIHandlerTaskProxy(); |
| 72 | 67 |
| 73 DISALLOW_COPY_AND_ASSIGN(WebUIHandlerTaskProxy); | 68 DISALLOW_COPY_AND_ASSIGN(WebUIHandlerTaskProxy); |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 BurnManager* burn_manager_; | 203 BurnManager* burn_manager_; |
| 209 StateMachine* state_machine_; | 204 StateMachine* state_machine_; |
| 210 bool observing_burn_lib_; | 205 bool observing_burn_lib_; |
| 211 bool working_; | 206 bool working_; |
| 212 | 207 |
| 213 DISALLOW_COPY_AND_ASSIGN(WebUIHandler); | 208 DISALLOW_COPY_AND_ASSIGN(WebUIHandler); |
| 214 }; | 209 }; |
| 215 | 210 |
| 216 } // namespace imageburner. | 211 } // namespace imageburner. |
| 217 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_IMAGEBURNER_WEBUI_HANDLER_H_ | 212 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_IMAGEBURNER_WEBUI_HANDLER_H_ |
| OLD | NEW |