| 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 (StartsWithASCII(path, kFakePathStr, false)) | 34 if (base::StartsWithASCII(path, kFakePathStr, false)) |
| 35 return path.substr(arraysize(kFakePathStr) - 1); | 35 return path.substr(arraysize(kFakePathStr) - 1); |
| 36 return path; | 36 return path; |
| 37 } | 37 } |
| 38 | 38 |
| 39 } // namespace | 39 } // namespace |
| 40 | 40 |
| 41 namespace extensions { | 41 namespace extensions { |
| 42 | 42 |
| 43 namespace feedback_private = api::feedback_private; | 43 namespace feedback_private = api::feedback_private; |
| 44 | 44 |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 | 235 |
| 236 void FeedbackPrivateSendFeedbackFunction::OnCompleted( | 236 void FeedbackPrivateSendFeedbackFunction::OnCompleted( |
| 237 bool success) { | 237 bool success) { |
| 238 results_ = feedback_private::SendFeedback::Results::Create( | 238 results_ = feedback_private::SendFeedback::Results::Create( |
| 239 success ? feedback_private::STATUS_SUCCESS : | 239 success ? feedback_private::STATUS_SUCCESS : |
| 240 feedback_private::STATUS_DELAYED); | 240 feedback_private::STATUS_DELAYED); |
| 241 SendResponse(true); | 241 SendResponse(true); |
| 242 } | 242 } |
| 243 | 243 |
| 244 } // namespace extensions | 244 } // namespace extensions |
| OLD | NEW |