Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(269)

Side by Side Diff: chrome/browser/extensions/api/feedback_private/feedback_private_api.cc

Issue 2065243002: Placing SRT Prompt on Feedback form behind Finch feature. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 } // namespace 53 } // namespace
54 54
55 namespace extensions { 55 namespace extensions {
56 56
57 namespace feedback_private = api::feedback_private; 57 namespace feedback_private = api::feedback_private;
58 58
59 using feedback_private::SystemInformation; 59 using feedback_private::SystemInformation;
60 using feedback_private::FeedbackInfo; 60 using feedback_private::FeedbackInfo;
61 using feedback_private::FeedbackFlow; 61 using feedback_private::FeedbackFlow;
62 62
63 const base::Feature kSrtPromptOnFeedbackForm {
64 "SrtPromptOnFeedbackForm", base::FEATURE_DISABLED_BY_DEFAULT
65 };
66
63 static base::LazyInstance<BrowserContextKeyedAPIFactory<FeedbackPrivateAPI> > 67 static base::LazyInstance<BrowserContextKeyedAPIFactory<FeedbackPrivateAPI> >
64 g_factory = LAZY_INSTANCE_INITIALIZER; 68 g_factory = LAZY_INSTANCE_INITIALIZER;
65 69
66 // static 70 // static
67 BrowserContextKeyedAPIFactory<FeedbackPrivateAPI>* 71 BrowserContextKeyedAPIFactory<FeedbackPrivateAPI>*
68 FeedbackPrivateAPI::GetFactoryInstance() { 72 FeedbackPrivateAPI::GetFactoryInstance() {
69 return g_factory.Pointer(); 73 return g_factory.Pointer();
70 } 74 }
71 75
72 FeedbackPrivateAPI::FeedbackPrivateAPI(content::BrowserContext* context) 76 FeedbackPrivateAPI::FeedbackPrivateAPI(content::BrowserContext* context)
73 : browser_context_(context), service_(new FeedbackService()) { 77 : browser_context_(context), service_(new FeedbackService()) {
74 } 78 }
75 79
76 FeedbackPrivateAPI::~FeedbackPrivateAPI() { 80 FeedbackPrivateAPI::~FeedbackPrivateAPI() {
77 delete service_; 81 delete service_;
78 service_ = NULL; 82 service_ = NULL;
79 } 83 }
80 84
81 FeedbackService* FeedbackPrivateAPI::GetService() const { 85 FeedbackService* FeedbackPrivateAPI::GetService() const {
82 return service_; 86 return service_;
83 } 87 }
84 88
85 void FeedbackPrivateAPI::RequestFeedback( 89 void FeedbackPrivateAPI::RequestFeedback(
86 const std::string& description_template, 90 const std::string& description_template,
87 const std::string& category_tag, 91 const std::string& category_tag,
88 const GURL& page_url) { 92 const GURL& page_url) {
89 #if defined(OS_WIN) 93 #if defined(OS_WIN)
90 // Show prompt for Software Removal Tool if the Reporter component has found 94 // Show prompt for Software Removal Tool if the Reporter component has found
91 // unwanted software, and the user has never run the cleaner before. 95 // unwanted software, and the user has never run the cleaner before.
92 if (safe_browsing::ReporterFoundUws() && 96 if (base::FeatureList::IsEnabled(kSrtPromptOnFeedbackForm) &&
97 safe_browsing::ReporterFoundUws() &&
93 !safe_browsing::UserHasRunCleaner()) { 98 !safe_browsing::UserHasRunCleaner()) {
94 RequestFeedbackForFlow(description_template, category_tag, page_url, 99 RequestFeedbackForFlow(description_template, category_tag, page_url,
95 FeedbackFlow::FEEDBACK_FLOW_SHOWSRTPROMPT); 100 FeedbackFlow::FEEDBACK_FLOW_SHOWSRTPROMPT);
96 return; 101 return;
97 } 102 }
98 #endif 103 #endif
99 104
100 RequestFeedbackForFlow(description_template, category_tag, page_url, 105 RequestFeedbackForFlow(description_template, category_tag, page_url,
101 FeedbackFlow::FEEDBACK_FLOW_REGULAR); 106 FeedbackFlow::FEEDBACK_FLOW_REGULAR);
102 } 107 }
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 content::RecordAction( 317 content::RecordAction(
313 base::UserMetricsAction("Feedback.SrtPromptClosed")); 318 base::UserMetricsAction("Feedback.SrtPromptClosed"));
314 break; 319 break;
315 default: 320 default:
316 return RespondNow(Error("Invalid arugment.")); 321 return RespondNow(Error("Invalid arugment."));
317 } 322 }
318 return RespondNow(NoArguments()); 323 return RespondNow(NoArguments());
319 } 324 }
320 325
321 } // namespace extensions 326 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698