| 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/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 using feedback_private::FeedbackInfo; | 40 using feedback_private::FeedbackInfo; |
| 41 | 41 |
| 42 char kFeedbackExtensionId[] = "gfdkimpbcpahaombhbimeihdjnejgicl"; | 42 char kFeedbackExtensionId[] = "gfdkimpbcpahaombhbimeihdjnejgicl"; |
| 43 | 43 |
| 44 static base::LazyInstance<ProfileKeyedAPIFactory<FeedbackPrivateAPI> > | 44 static base::LazyInstance<ProfileKeyedAPIFactory<FeedbackPrivateAPI> > |
| 45 g_factory = LAZY_INSTANCE_INITIALIZER; | 45 g_factory = LAZY_INSTANCE_INITIALIZER; |
| 46 | 46 |
| 47 // static | 47 // static |
| 48 ProfileKeyedAPIFactory<FeedbackPrivateAPI>* | 48 ProfileKeyedAPIFactory<FeedbackPrivateAPI>* |
| 49 FeedbackPrivateAPI::GetFactoryInstance() { | 49 FeedbackPrivateAPI::GetFactoryInstance() { |
| 50 return &g_factory.Get(); | 50 return g_factory.Pointer(); |
| 51 } | 51 } |
| 52 | 52 |
| 53 FeedbackPrivateAPI::FeedbackPrivateAPI(Profile* profile) | 53 FeedbackPrivateAPI::FeedbackPrivateAPI(Profile* profile) |
| 54 : profile_(profile), | 54 : profile_(profile), |
| 55 service_(FeedbackService::CreateInstance()) { | 55 service_(FeedbackService::CreateInstance()) { |
| 56 } | 56 } |
| 57 | 57 |
| 58 FeedbackPrivateAPI::~FeedbackPrivateAPI() { | 58 FeedbackPrivateAPI::~FeedbackPrivateAPI() { |
| 59 delete service_; | 59 delete service_; |
| 60 service_ = NULL; | 60 service_ = NULL; |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 | 238 |
| 239 void FeedbackPrivateSendFeedbackFunction::OnCompleted( | 239 void FeedbackPrivateSendFeedbackFunction::OnCompleted( |
| 240 bool success) { | 240 bool success) { |
| 241 results_ = feedback_private::SendFeedback::Results::Create( | 241 results_ = feedback_private::SendFeedback::Results::Create( |
| 242 success ? feedback_private::STATUS_SUCCESS : | 242 success ? feedback_private::STATUS_SUCCESS : |
| 243 feedback_private::STATUS_DELAYED); | 243 feedback_private::STATUS_DELAYED); |
| 244 SendResponse(true); | 244 SendResponse(true); |
| 245 } | 245 } |
| 246 | 246 |
| 247 } // namespace extensions | 247 } // namespace extensions |
| OLD | NEW |