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

Side by Side Diff: trunk/src/chrome/browser/feedback/feedback_util.cc

Issue 192283002: Revert 255858 "Simplify the user agent code some more since afte..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/feedback/feedback_util.h" 5 #include "chrome/browser/feedback/feedback_util.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 13 matching lines...) Expand all
24 #include "chrome/browser/feedback/feedback_uploader.h" 24 #include "chrome/browser/feedback/feedback_uploader.h"
25 #include "chrome/browser/feedback/feedback_uploader_factory.h" 25 #include "chrome/browser/feedback/feedback_uploader_factory.h"
26 #include "chrome/browser/metrics/variations/variations_http_header_provider.h" 26 #include "chrome/browser/metrics/variations/variations_http_header_provider.h"
27 #include "chrome/browser/profiles/profile.h" 27 #include "chrome/browser/profiles/profile.h"
28 #include "chrome/browser/profiles/profile_manager.h" 28 #include "chrome/browser/profiles/profile_manager.h"
29 #include "chrome/browser/safe_browsing/safe_browsing_util.h" 29 #include "chrome/browser/safe_browsing/safe_browsing_util.h"
30 #include "chrome/browser/ui/browser_finder.h" 30 #include "chrome/browser/ui/browser_finder.h"
31 #include "chrome/browser/ui/browser_list.h" 31 #include "chrome/browser/ui/browser_list.h"
32 #include "chrome/browser/ui/browser_window.h" 32 #include "chrome/browser/ui/browser_window.h"
33 #include "chrome/browser/ui/tabs/tab_strip_model.h" 33 #include "chrome/browser/ui/tabs/tab_strip_model.h"
34 #include "chrome/common/chrome_content_client.h"
35 #include "chrome/common/chrome_switches.h" 34 #include "chrome/common/chrome_switches.h"
36 #include "chrome/common/chrome_version_info.h" 35 #include "chrome/common/chrome_version_info.h"
37 #include "chrome/common/metrics/metrics_log_manager.h" 36 #include "chrome/common/metrics/metrics_log_manager.h"
38 #include "content/public/browser/navigation_controller.h" 37 #include "content/public/browser/navigation_controller.h"
39 #include "content/public/browser/web_contents.h" 38 #include "content/public/browser/web_contents.h"
40 #include "content/public/common/content_client.h" 39 #include "content/public/common/content_client.h"
41 #include "grit/generated_resources.h" 40 #include "grit/generated_resources.h"
42 #include "grit/locale_settings.h" 41 #include "grit/locale_settings.h"
43 #include "grit/theme_resources.h" 42 #include "grit/theme_resources.h"
44 #include "net/base/load_flags.h" 43 #include "net/base/load_flags.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 // We're not using gaia ids, we're using the e-mail field instead. 158 // We're not using gaia ids, we're using the e-mail field instead.
160 common_data->set_gaia_id(0); 159 common_data->set_gaia_id(0);
161 common_data->set_user_email(data->user_email()); 160 common_data->set_user_email(data->user_email());
162 common_data->set_description(data->description()); 161 common_data->set_description(data->description());
163 162
164 std::string chrome_locale = g_browser_process->GetApplicationLocale(); 163 std::string chrome_locale = g_browser_process->GetApplicationLocale();
165 common_data->set_source_description_language(chrome_locale); 164 common_data->set_source_description_language(chrome_locale);
166 165
167 userfeedback::WebData* web_data = feedback_data.mutable_web_data(); 166 userfeedback::WebData* web_data = feedback_data.mutable_web_data();
168 web_data->set_url(data->page_url()); 167 web_data->set_url(data->page_url());
169 web_data->mutable_navigator()->set_user_agent(GetUserAgent()); 168 web_data->mutable_navigator()->set_user_agent(content::GetUserAgent(GURL()));
170 169
171 gfx::Rect screen_size; 170 gfx::Rect screen_size;
172 if (data->sys_info()) { 171 if (data->sys_info()) {
173 for (FeedbackData::SystemLogsMap::const_iterator i = 172 for (FeedbackData::SystemLogsMap::const_iterator i =
174 data->sys_info()->begin(); i != data->sys_info()->end(); ++i) { 173 data->sys_info()->begin(); i != data->sys_info()->end(); ++i) {
175 if (FeedbackData::BelowCompressionThreshold(i->second)) 174 if (FeedbackData::BelowCompressionThreshold(i->second))
176 AddFeedbackData(&feedback_data, i->first, i->second); 175 AddFeedbackData(&feedback_data, i->first, i->second);
177 } 176 }
178 177
179 AddAttachment(&feedback_data, kLogsAttachmentName, data->compressed_logs()); 178 AddAttachment(&feedback_data, kLogsAttachmentName, data->compressed_logs());
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 zip::Zip(temp_path, zip_file, false) && 262 zip::Zip(temp_path, zip_file, false) &&
264 base::ReadFileToString(zip_file, compressed_logs); 263 base::ReadFileToString(zip_file, compressed_logs);
265 264
266 base::DeleteFile(temp_path, true); 265 base::DeleteFile(temp_path, true);
267 base::DeleteFile(zip_file, false); 266 base::DeleteFile(zip_file, false);
268 267
269 return succeed; 268 return succeed;
270 } 269 }
271 270
272 } // namespace feedback_util 271 } // namespace feedback_util
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698