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

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

Issue 2900643004: More descriptive feedback description in feedbacks filed from the SadTab page (Closed)
Patch Set: Fix test Created 3 years, 7 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
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/feedback/show_feedback_page.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 EventRouter::Get(browser_context_) 155 EventRouter::Get(browser_context_)
156 ->DispatchEventToExtension(extension_misc::kFeedbackExtensionId, 156 ->DispatchEventToExtension(extension_misc::kFeedbackExtensionId,
157 std::move(event)); 157 std::move(event));
158 } 158 }
159 } 159 }
160 160
161 // static 161 // static
162 base::Closure* FeedbackPrivateGetStringsFunction::test_callback_ = NULL; 162 base::Closure* FeedbackPrivateGetStringsFunction::test_callback_ = NULL;
163 163
164 ExtensionFunction::ResponseAction FeedbackPrivateGetStringsFunction::Run() { 164 ExtensionFunction::ResponseAction FeedbackPrivateGetStringsFunction::Run() {
165 auto params = feedback_private::GetStrings::Params::Create(*args_);
166 EXTENSION_FUNCTION_VALIDATE(params.get());
167
165 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); 168 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
166 169
167 #define SET_STRING(id, idr) \ 170 #define SET_STRING(id, idr) \
168 dict->SetString(id, l10n_util::GetStringUTF16(idr)) 171 dict->SetString(id, l10n_util::GetStringUTF16(idr))
169 SET_STRING("page-title", IDS_FEEDBACK_REPORT_PAGE_TITLE); 172 SET_STRING("page-title",
173 params->flow == FeedbackFlow::FEEDBACK_FLOW_SADTABCRASH
174 ? IDS_FEEDBACK_REPORT_PAGE_TITLE_SAD_TAB_FLOW
175 : IDS_FEEDBACK_REPORT_PAGE_TITLE);
170 SET_STRING("additionalInfo", IDS_FEEDBACK_ADDITIONAL_INFO_LABEL); 176 SET_STRING("additionalInfo", IDS_FEEDBACK_ADDITIONAL_INFO_LABEL);
171 SET_STRING("minimize-btn-label", IDS_FEEDBACK_MINIMIZE_BUTTON_LABEL); 177 SET_STRING("minimize-btn-label", IDS_FEEDBACK_MINIMIZE_BUTTON_LABEL);
172 SET_STRING("close-btn-label", IDS_FEEDBACK_CLOSE_BUTTON_LABEL); 178 SET_STRING("close-btn-label", IDS_FEEDBACK_CLOSE_BUTTON_LABEL);
173 SET_STRING("page-url", IDS_FEEDBACK_REPORT_URL_LABEL); 179 SET_STRING("page-url", IDS_FEEDBACK_REPORT_URL_LABEL);
174 SET_STRING("screenshot", IDS_FEEDBACK_SCREENSHOT_LABEL); 180 SET_STRING("screenshot", IDS_FEEDBACK_SCREENSHOT_LABEL);
175 SET_STRING("user-email", IDS_FEEDBACK_USER_EMAIL_LABEL); 181 SET_STRING("user-email", IDS_FEEDBACK_USER_EMAIL_LABEL);
176 SET_STRING("anonymous-user", IDS_FEEDBACK_ANONYMOUS_EMAIL_OPTION); 182 SET_STRING("anonymous-user", IDS_FEEDBACK_ANONYMOUS_EMAIL_OPTION);
177 #if defined(OS_CHROMEOS) 183 #if defined(OS_CHROMEOS)
178 if (arc::IsArcPlayStoreEnabledForProfile( 184 if (arc::IsArcPlayStoreEnabledForProfile(
179 Profile::FromBrowserContext(browser_context()))) { 185 Profile::FromBrowserContext(browser_context()))) {
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 case feedback_private::SRT_PROMPT_RESULT_CLOSED: 364 case feedback_private::SRT_PROMPT_RESULT_CLOSED:
359 base::RecordAction(base::UserMetricsAction("Feedback.SrtPromptClosed")); 365 base::RecordAction(base::UserMetricsAction("Feedback.SrtPromptClosed"));
360 break; 366 break;
361 default: 367 default:
362 return RespondNow(Error("Invalid arugment.")); 368 return RespondNow(Error("Invalid arugment."));
363 } 369 }
364 return RespondNow(NoArguments()); 370 return RespondNow(NoArguments());
365 } 371 }
366 372
367 } // namespace extensions 373 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/feedback/show_feedback_page.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698