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

Side by Side Diff: chrome/browser/gpu/gpu_mode_manager.cc

Issue 2299993004: Migrate chrome/browser files to histogram_macros.h includes. (Closed)
Patch Set: Created 4 years, 3 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/browser/google/google_update_win.cc ('k') | chrome/browser/gpu/three_d_api_observer.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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/gpu/gpu_mode_manager.h" 5 #include "chrome/browser/gpu/gpu_mode_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram_macros.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/common/pref_names.h" 10 #include "chrome/common/pref_names.h"
11 #include "components/prefs/pref_registry_simple.h" 11 #include "components/prefs/pref_registry_simple.h"
12 #include "components/prefs/pref_service.h" 12 #include "components/prefs/pref_service.h"
13 #include "content/public/browser/gpu_data_manager.h" 13 #include "content/public/browser/gpu_data_manager.h"
14 #include "content/public/browser/user_metrics.h" 14 #include "content/public/browser/user_metrics.h"
15 15
16 using base::UserMetricsAction; 16 using base::UserMetricsAction;
17 17
18 namespace { 18 namespace {
19 19
20 bool GetPreviousGpuModePref() { 20 bool GetPreviousGpuModePref() {
21 PrefService* service = g_browser_process->local_state(); 21 PrefService* service = g_browser_process->local_state();
22 DCHECK(service); 22 DCHECK(service);
23 return service->GetBoolean(prefs::kHardwareAccelerationModePrevious); 23 return service->GetBoolean(prefs::kHardwareAccelerationModePrevious);
24 } 24 }
25 25
26 void SetPreviousGpuModePref(bool enabled) { 26 void SetPreviousGpuModePref(bool enabled) {
27 PrefService* service = g_browser_process->local_state(); 27 PrefService* service = g_browser_process->local_state();
28 DCHECK(service); 28 DCHECK(service);
29 service->SetBoolean(prefs::kHardwareAccelerationModePrevious, enabled); 29 service->SetBoolean(prefs::kHardwareAccelerationModePrevious, enabled);
30 } 30 }
31 31
32 } // namespace anonymous 32 } // namespace
33 33
34 // static 34 // static
35 void GpuModeManager::RegisterPrefs(PrefRegistrySimple* registry) { 35 void GpuModeManager::RegisterPrefs(PrefRegistrySimple* registry) {
36 registry->RegisterBooleanPref( 36 registry->RegisterBooleanPref(
37 prefs::kHardwareAccelerationModeEnabled, true); 37 prefs::kHardwareAccelerationModeEnabled, true);
38 registry->RegisterBooleanPref( 38 registry->RegisterBooleanPref(
39 prefs::kHardwareAccelerationModePrevious, true); 39 prefs::kHardwareAccelerationModePrevious, true);
40 } 40 }
41 41
42 GpuModeManager::GpuModeManager() 42 GpuModeManager::GpuModeManager()
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 } 77 }
78 78
79 // static 79 // static
80 bool GpuModeManager::IsGpuModePrefEnabled() { 80 bool GpuModeManager::IsGpuModePrefEnabled() {
81 PrefService* service = g_browser_process->local_state(); 81 PrefService* service = g_browser_process->local_state();
82 DCHECK(service); 82 DCHECK(service);
83 return service->GetBoolean( 83 return service->GetBoolean(
84 prefs::kHardwareAccelerationModeEnabled); 84 prefs::kHardwareAccelerationModeEnabled);
85 } 85 }
86 86
OLDNEW
« no previous file with comments | « chrome/browser/google/google_update_win.cc ('k') | chrome/browser/gpu/three_d_api_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698