OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chrome_to_mobile_service.h" | 5 #include "chrome/browser/chrome_to_mobile_service.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/guid.h" | 10 #include "base/guid.h" |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 base::Bind(callback, base::Passed(&data)))) { | 198 base::Bind(callback, base::Passed(&data)))) { |
199 LogMetric(SNAPSHOT_ERROR); | 199 LogMetric(SNAPSHOT_ERROR); |
200 NOTREACHED(); | 200 NOTREACHED(); |
201 } | 201 } |
202 } | 202 } |
203 | 203 |
204 // Delete the snapshot file; DCHECK, but really ignore the result of the delete. | 204 // Delete the snapshot file; DCHECK, but really ignore the result of the delete. |
205 // Call this as a BlockingPoolSequencedTask [after posting SubmitSnapshotFile]. | 205 // Call this as a BlockingPoolSequencedTask [after posting SubmitSnapshotFile]. |
206 void DeleteSnapshotFile(const base::FilePath& snapshot) { | 206 void DeleteSnapshotFile(const base::FilePath& snapshot) { |
207 DCHECK(!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 207 DCHECK(!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
208 bool success = file_util::Delete(snapshot, false); | 208 bool success = base::Delete(snapshot, false); |
209 DCHECK(success); | 209 DCHECK(success); |
210 } | 210 } |
211 | 211 |
212 // Returns true if the url can be sent via Chrome To Mobile. | 212 // Returns true if the url can be sent via Chrome To Mobile. |
213 bool CanSendURL(const GURL& url) { | 213 bool CanSendURL(const GURL& url) { |
214 return url.SchemeIs(chrome::kHttpScheme) || | 214 return url.SchemeIs(chrome::kHttpScheme) || |
215 url.SchemeIs(chrome::kHttpsScheme) || | 215 url.SchemeIs(chrome::kHttpsScheme) || |
216 url.SchemeIs(chrome::kFtpScheme); | 216 url.SchemeIs(chrome::kFtpScheme); |
217 } | 217 } |
218 | 218 |
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
755 | 755 |
756 // Report failure below and ignore the second response. | 756 // Report failure below and ignore the second response. |
757 request_observer_map_.erase(other); | 757 request_observer_map_.erase(other); |
758 break; | 758 break; |
759 } | 759 } |
760 } | 760 } |
761 | 761 |
762 if (observer.get()) | 762 if (observer.get()) |
763 observer->OnSendComplete(success); | 763 observer->OnSendComplete(success); |
764 } | 764 } |
OLD | NEW |