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

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

Issue 880313002: webui: add [lang] attribute to <html> element on all webui pages so (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cros Created 5 years, 10 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 "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"
11 #include "base/strings/utf_string_conversions.h" 11 #include "base/strings/utf_string_conversions.h"
12 #include "base/values.h" 12 #include "base/values.h"
13 #include "chrome/browser/browser_process.h"
13 #include "chrome/browser/extensions/api/feedback_private/feedback_service.h" 14 #include "chrome/browser/extensions/api/feedback_private/feedback_service.h"
14 #include "chrome/browser/profiles/profile.h" 15 #include "chrome/browser/profiles/profile.h"
15 #include "chrome/grit/generated_resources.h" 16 #include "chrome/grit/generated_resources.h"
16 #include "components/feedback/tracing_manager.h" 17 #include "components/feedback/tracing_manager.h"
17 #include "extensions/browser/event_router.h" 18 #include "extensions/browser/event_router.h"
18 #include "ui/base/l10n/l10n_util.h" 19 #include "ui/base/l10n/l10n_util.h"
19 #include "ui/base/webui/web_ui_util.h" 20 #include "ui/base/webui/web_ui_util.h"
20 #include "url/url_util.h" 21 #include "url/url_util.h"
21 22
22 using feedback::FeedbackData; 23 using feedback::FeedbackData;
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 SET_STRING("attach-file-to-big", IDS_FEEDBACK_ATTACH_FILE_TO_BIG); 116 SET_STRING("attach-file-to-big", IDS_FEEDBACK_ATTACH_FILE_TO_BIG);
116 SET_STRING("reading-file", IDS_FEEDBACK_READING_FILE); 117 SET_STRING("reading-file", IDS_FEEDBACK_READING_FILE);
117 SET_STRING("send-report", IDS_FEEDBACK_SEND_REPORT); 118 SET_STRING("send-report", IDS_FEEDBACK_SEND_REPORT);
118 SET_STRING("cancel", IDS_CANCEL); 119 SET_STRING("cancel", IDS_CANCEL);
119 SET_STRING("no-description", IDS_FEEDBACK_NO_DESCRIPTION); 120 SET_STRING("no-description", IDS_FEEDBACK_NO_DESCRIPTION);
120 SET_STRING("privacy-note", IDS_FEEDBACK_PRIVACY_NOTE); 121 SET_STRING("privacy-note", IDS_FEEDBACK_PRIVACY_NOTE);
121 SET_STRING("performance-trace", 122 SET_STRING("performance-trace",
122 IDS_FEEDBACK_INCLUDE_PERFORMANCE_TRACE_CHECKBOX); 123 IDS_FEEDBACK_INCLUDE_PERFORMANCE_TRACE_CHECKBOX);
123 #undef SET_STRING 124 #undef SET_STRING
124 125
125 webui::SetFontAndTextDirection(dict); 126 const std::string& app_locale = g_browser_process->GetApplicationLocale();
127 webui::SetLoadTimeDataDefaults(app_locale, dict);
126 128
127 if (test_callback_ && !test_callback_->is_null()) 129 if (test_callback_ && !test_callback_->is_null())
128 test_callback_->Run(); 130 test_callback_->Run();
129 131
130 return true; 132 return true;
131 } 133 }
132 134
133 bool FeedbackPrivateGetUserEmailFunction::RunSync() { 135 bool FeedbackPrivateGetUserEmailFunction::RunSync() {
134 FeedbackService* service = 136 FeedbackService* service =
135 FeedbackPrivateAPI::GetFactoryInstance()->Get(GetProfile())->GetService(); 137 FeedbackPrivateAPI::GetFactoryInstance()->Get(GetProfile())->GetService();
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 230
229 void FeedbackPrivateSendFeedbackFunction::OnCompleted( 231 void FeedbackPrivateSendFeedbackFunction::OnCompleted(
230 bool success) { 232 bool success) {
231 results_ = feedback_private::SendFeedback::Results::Create( 233 results_ = feedback_private::SendFeedback::Results::Create(
232 success ? feedback_private::STATUS_SUCCESS : 234 success ? feedback_private::STATUS_SUCCESS :
233 feedback_private::STATUS_DELAYED); 235 feedback_private::STATUS_DELAYED);
234 SendResponse(true); 236 SendResponse(true);
235 } 237 }
236 238
237 } // namespace extensions 239 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698