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

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

Issue 8382019: Move DisplayUtils methods into gfx::Screen. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove DCHECKS Created 9 years, 2 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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"
11 #include "base/file_util.h" 11 #include "base/file_util.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/perftimer.h" 13 #include "base/perftimer.h"
14 #include "base/string_util.h" 14 #include "base/string_util.h"
15 #include "base/sys_info.h" 15 #include "base/sys_info.h"
16 #include "base/third_party/nspr/prtime.h" 16 #include "base/third_party/nspr/prtime.h"
17 #include "base/time.h" 17 #include "base/time.h"
18 #include "base/utf_string_conversions.h" 18 #include "base/utf_string_conversions.h"
19 #include "chrome/browser/autocomplete/autocomplete.h" 19 #include "chrome/browser/autocomplete/autocomplete.h"
20 #include "chrome/browser/autocomplete/autocomplete_match.h" 20 #include "chrome/browser/autocomplete/autocomplete_match.h"
21 #include "chrome/browser/browser_process.h" 21 #include "chrome/browser/browser_process.h"
22 #include "chrome/browser/metrics/display_utils.h"
23 #include "chrome/browser/plugin_prefs.h" 22 #include "chrome/browser/plugin_prefs.h"
24 #include "chrome/browser/prefs/pref_service.h" 23 #include "chrome/browser/prefs/pref_service.h"
25 #include "chrome/browser/profiles/profile_manager.h" 24 #include "chrome/browser/profiles/profile_manager.h"
26 #include "chrome/common/chrome_version_info.h" 25 #include "chrome/common/chrome_version_info.h"
27 #include "chrome/common/logging_chrome.h" 26 #include "chrome/common/logging_chrome.h"
28 #include "chrome/common/pref_names.h" 27 #include "chrome/common/pref_names.h"
29 #include "content/browser/gpu/gpu_data_manager.h" 28 #include "content/browser/gpu/gpu_data_manager.h"
30 #include "googleurl/src/gurl.h" 29 #include "googleurl/src/gurl.h"
30 #include "ui/gfx/screen.h"
31 #include "webkit/plugins/webplugininfo.h" 31 #include "webkit/plugins/webplugininfo.h"
32 32
33 #define OPEN_ELEMENT_FOR_SCOPE(name) ScopedElement scoped_element(this, name) 33 #define OPEN_ELEMENT_FOR_SCOPE(name) ScopedElement scoped_element(this, name)
34 34
35 // http://blogs.msdn.com/oldnewthing/archive/2004/10/25/247180.aspx 35 // http://blogs.msdn.com/oldnewthing/archive/2004/10/25/247180.aspx
36 #if defined(OS_WIN) 36 #if defined(OS_WIN)
37 extern "C" IMAGE_DOS_HEADER __ImageBase; 37 extern "C" IMAGE_DOS_HEADER __ImageBase;
38 #endif 38 #endif
39 39
40 MetricsLog::MetricsLog(const std::string& client_id, int session_id) 40 MetricsLog::MetricsLog(const std::string& client_id, int session_id)
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 OPEN_ELEMENT_FOR_SCOPE("gpu"); 351 OPEN_ELEMENT_FOR_SCOPE("gpu");
352 GpuDataManager* gpu_data_manager = GpuDataManager::GetInstance(); 352 GpuDataManager* gpu_data_manager = GpuDataManager::GetInstance();
353 if (gpu_data_manager) { 353 if (gpu_data_manager) {
354 WriteIntAttribute("vendorid", gpu_data_manager->gpu_info().vendor_id); 354 WriteIntAttribute("vendorid", gpu_data_manager->gpu_info().vendor_id);
355 WriteIntAttribute("deviceid", gpu_data_manager->gpu_info().device_id); 355 WriteIntAttribute("deviceid", gpu_data_manager->gpu_info().device_id);
356 } 356 }
357 } 357 }
358 358
359 { 359 {
360 OPEN_ELEMENT_FOR_SCOPE("display"); 360 OPEN_ELEMENT_FOR_SCOPE("display");
361 int width = 0; 361 const gfx::Size display_size = gfx::Screen::GetPrimaryMonitorSize();
362 int height = 0; 362 WriteIntAttribute("xsize", display_size.width());
363 DisplayUtils::GetPrimaryDisplayDimensions(&width, &height); 363 WriteIntAttribute("ysize", display_size.height());
364 WriteIntAttribute("xsize", width); 364 WriteIntAttribute("screens", gfx::Screen::GetNumMonitors());
365 WriteIntAttribute("ysize", height);
366 WriteIntAttribute("screens", DisplayUtils::GetDisplayCount());
367 } 365 }
368 366
369 { 367 {
370 OPEN_ELEMENT_FOR_SCOPE("bookmarks"); 368 OPEN_ELEMENT_FOR_SCOPE("bookmarks");
371 int num_bookmarks_on_bookmark_bar = 369 int num_bookmarks_on_bookmark_bar =
372 pref->GetInteger(prefs::kNumBookmarksOnBookmarkBar); 370 pref->GetInteger(prefs::kNumBookmarksOnBookmarkBar);
373 int num_folders_on_bookmark_bar = 371 int num_folders_on_bookmark_bar =
374 pref->GetInteger(prefs::kNumFoldersOnBookmarkBar); 372 pref->GetInteger(prefs::kNumFoldersOnBookmarkBar);
375 int num_bookmarks_in_other_bookmarks_folder = 373 int num_bookmarks_in_other_bookmarks_folder =
376 pref->GetInteger(prefs::kNumBookmarksInOtherBookmarkFolder); 374 pref->GetInteger(prefs::kNumBookmarksInOtherBookmarkFolder);
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 const std::string result_type(AutocompleteMatch::TypeToString(i->type)); 493 const std::string result_type(AutocompleteMatch::TypeToString(i->type));
496 if (!result_type.empty()) 494 if (!result_type.empty())
497 WriteAttribute("resulttype", result_type); 495 WriteAttribute("resulttype", result_type);
498 WriteIntAttribute("relevance", i->relevance); 496 WriteIntAttribute("relevance", i->relevance);
499 WriteIntAttribute("isstarred", i->starred ? 1 : 0); 497 WriteIntAttribute("isstarred", i->starred ? 1 : 0);
500 } 498 }
501 } 499 }
502 500
503 ++num_events_; 501 ++num_events_;
504 } 502 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698