| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/extensions/api/feedback_private/feedback_private_api.h" | 5 #include "chrome/browser/extensions/api/feedback_private/feedback_private_api.h" |
| 6 | 6 |
| 7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/metrics/statistics_recorder.h" | 9 #include "base/metrics/statistics_recorder.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 #include "url/url_util.h" | 24 #include "url/url_util.h" |
| 25 | 25 |
| 26 using feedback::FeedbackData; | 26 using feedback::FeedbackData; |
| 27 | 27 |
| 28 namespace { | 28 namespace { |
| 29 | 29 |
| 30 // Getting the filename of a blob prepends a "C:\fakepath" to the filename. | 30 // Getting the filename of a blob prepends a "C:\fakepath" to the filename. |
| 31 // This is undesirable, strip it if it exists. | 31 // This is undesirable, strip it if it exists. |
| 32 std::string StripFakepath(const std::string& path) { | 32 std::string StripFakepath(const std::string& path) { |
| 33 const char kFakePathStr[] = "C:\\fakepath\\"; | 33 const char kFakePathStr[] = "C:\\fakepath\\"; |
| 34 if (base::StartsWithASCII(path, kFakePathStr, false)) | 34 if (base::StartsWith(path, kFakePathStr, |
| 35 base::CompareCase::INSENSITIVE_ASCII)) |
| 35 return path.substr(arraysize(kFakePathStr) - 1); | 36 return path.substr(arraysize(kFakePathStr) - 1); |
| 36 return path; | 37 return path; |
| 37 } | 38 } |
| 38 | 39 |
| 39 } // namespace | 40 } // namespace |
| 40 | 41 |
| 41 namespace extensions { | 42 namespace extensions { |
| 42 | 43 |
| 43 namespace feedback_private = api::feedback_private; | 44 namespace feedback_private = api::feedback_private; |
| 44 | 45 |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 | 237 |
| 237 void FeedbackPrivateSendFeedbackFunction::OnCompleted( | 238 void FeedbackPrivateSendFeedbackFunction::OnCompleted( |
| 238 bool success) { | 239 bool success) { |
| 239 results_ = feedback_private::SendFeedback::Results::Create( | 240 results_ = feedback_private::SendFeedback::Results::Create( |
| 240 success ? feedback_private::STATUS_SUCCESS : | 241 success ? feedback_private::STATUS_SUCCESS : |
| 241 feedback_private::STATUS_DELAYED); | 242 feedback_private::STATUS_DELAYED); |
| 242 SendResponse(true); | 243 SendResponse(true); |
| 243 } | 244 } |
| 244 | 245 |
| 245 } // namespace extensions | 246 } // namespace extensions |
| OLD | NEW |