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

Side by Side Diff: chrome/browser/metrics/metrics_log.cc

Issue 10825485: Record device scale factor in the metrics log (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: mpearson Created 8 years, 4 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/metrics/metrics_log.h" 5 #include "chrome/browser/metrics/metrics_log.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 } 336 }
337 337
338 PrefService* MetricsLog::GetPrefService() { 338 PrefService* MetricsLog::GetPrefService() {
339 return g_browser_process->local_state(); 339 return g_browser_process->local_state();
340 } 340 }
341 341
342 gfx::Size MetricsLog::GetScreenSize() const { 342 gfx::Size MetricsLog::GetScreenSize() const {
343 return gfx::Screen::GetPrimaryDisplay().GetSizeInPixel(); 343 return gfx::Screen::GetPrimaryDisplay().GetSizeInPixel();
344 } 344 }
345 345
346 float MetricsLog::GetScreenDeviceScaleFactor() const {
347 return gfx::Screen::GetPrimaryDisplay().device_scale_factor();
348 }
349
346 int MetricsLog::GetScreenCount() const { 350 int MetricsLog::GetScreenCount() const {
347 return gfx::Screen::GetNumDisplays(); 351 return gfx::Screen::GetNumDisplays();
348 } 352 }
349 353
350 void MetricsLog::GetFieldTrialIds( 354 void MetricsLog::GetFieldTrialIds(
351 std::vector<SelectedGroupId>* field_trial_ids) const { 355 std::vector<SelectedGroupId>* field_trial_ids) const {
352 chrome_variations::GetFieldTrialSelectedGroupIds(field_trial_ids); 356 chrome_variations::GetFieldTrialSelectedGroupIds(field_trial_ids);
353 } 357 }
354 358
355 void MetricsLog::WriteStabilityElement( 359 void MetricsLog::WriteStabilityElement(
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
780 gpu->set_driver_date(gpu_info.driver_date); 784 gpu->set_driver_date(gpu_info.driver_date);
781 SystemProfileProto::Hardware::Graphics::PerformanceStatistics* 785 SystemProfileProto::Hardware::Graphics::PerformanceStatistics*
782 gpu_performance = gpu->mutable_performance_statistics(); 786 gpu_performance = gpu->mutable_performance_statistics();
783 gpu_performance->set_graphics_score(gpu_info.performance_stats.graphics); 787 gpu_performance->set_graphics_score(gpu_info.performance_stats.graphics);
784 gpu_performance->set_gaming_score(gpu_info.performance_stats.gaming); 788 gpu_performance->set_gaming_score(gpu_info.performance_stats.gaming);
785 gpu_performance->set_overall_score(gpu_info.performance_stats.overall); 789 gpu_performance->set_overall_score(gpu_info.performance_stats.overall);
786 790
787 const gfx::Size display_size = GetScreenSize(); 791 const gfx::Size display_size = GetScreenSize();
788 hardware->set_primary_screen_width(display_size.width()); 792 hardware->set_primary_screen_width(display_size.width());
789 hardware->set_primary_screen_height(display_size.height()); 793 hardware->set_primary_screen_height(display_size.height());
794 hardware->set_primary_screen_scale_factor(GetScreenDeviceScaleFactor());
790 hardware->set_screen_count(GetScreenCount()); 795 hardware->set_screen_count(GetScreenCount());
791 796
792 WriteGoogleUpdateProto(google_update_metrics); 797 WriteGoogleUpdateProto(google_update_metrics);
793 798
794 bool write_as_xml = false; 799 bool write_as_xml = false;
795 WritePluginList(plugin_list, write_as_xml); 800 WritePluginList(plugin_list, write_as_xml);
796 801
797 std::vector<SelectedGroupId> field_trial_ids; 802 std::vector<SelectedGroupId> field_trial_ids;
798 GetFieldTrialIds(&field_trial_ids); 803 GetFieldTrialIds(&field_trial_ids);
799 WriteFieldTrials(field_trial_ids, system_profile); 804 WriteFieldTrials(field_trial_ids, system_profile);
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
1000 ProductDataToProto(google_update_metrics.google_update_data, 1005 ProductDataToProto(google_update_metrics.google_update_data,
1001 google_update->mutable_google_update_status()); 1006 google_update->mutable_google_update_status());
1002 } 1007 }
1003 1008
1004 if (!google_update_metrics.product_data.version.empty()) { 1009 if (!google_update_metrics.product_data.version.empty()) {
1005 ProductDataToProto(google_update_metrics.product_data, 1010 ProductDataToProto(google_update_metrics.product_data,
1006 google_update->mutable_client_status()); 1011 google_update->mutable_client_status());
1007 } 1012 }
1008 #endif // defined(GOOGLE_CHROME_BUILD) && defined(OS_WIN) 1013 #endif // defined(GOOGLE_CHROME_BUILD) && defined(OS_WIN)
1009 } 1014 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698