OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
7 #include "chrome/browser/browser_process.h" | 7 #include "chrome/browser/browser_process.h" |
8 #include "chrome/browser/extensions/api/image_writer_private/image_writer_utilit
y_client.h" | 8 #include "chrome/browser/extensions/api/image_writer_private/image_writer_utilit
y_client.h" |
9 #include "chrome/common/chrome_utility_messages.h" | 9 #include "chrome/common/extensions/chrome_utility_extensions_messages.h" |
10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
11 | 11 |
12 using content::BrowserThread; | 12 using content::BrowserThread; |
13 | 13 |
14 ImageWriterUtilityClient::ImageWriterUtilityClient() | 14 ImageWriterUtilityClient::ImageWriterUtilityClient() |
15 : message_loop_proxy_(base::MessageLoopProxy::current()) {} | 15 : message_loop_proxy_(base::MessageLoopProxy::current()) {} |
16 ImageWriterUtilityClient::~ImageWriterUtilityClient() {} | 16 ImageWriterUtilityClient::~ImageWriterUtilityClient() {} |
17 | 17 |
18 void ImageWriterUtilityClient::Write(const ProgressCallback& progress_callback, | 18 void ImageWriterUtilityClient::Write(const ProgressCallback& progress_callback, |
19 const SuccessCallback& success_callback, | 19 const SuccessCallback& success_callback, |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 base::Bind(error_callback_, message)); | 149 base::Bind(error_callback_, message)); |
150 } | 150 } |
151 } | 151 } |
152 | 152 |
153 void ImageWriterUtilityClient::OnWriteImageProgress(int64 progress) { | 153 void ImageWriterUtilityClient::OnWriteImageProgress(int64 progress) { |
154 if (!progress_callback_.is_null()) { | 154 if (!progress_callback_.is_null()) { |
155 message_loop_proxy_->PostTask(FROM_HERE, | 155 message_loop_proxy_->PostTask(FROM_HERE, |
156 base::Bind(progress_callback_, progress)); | 156 base::Bind(progress_callback_, progress)); |
157 } | 157 } |
158 } | 158 } |
OLD | NEW |