| OLD | NEW |
| 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/gpu_data_manager.h" | 5 #include "chrome/browser/gpu_data_manager.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 // updated GPU info. | 84 // updated GPU info. |
| 85 gpu_feature_flags_set_ = false; | 85 gpu_feature_flags_set_ = false; |
| 86 RunGpuInfoUpdateCallbacks(); | 86 RunGpuInfoUpdateCallbacks(); |
| 87 } | 87 } |
| 88 | 88 |
| 89 const GPUInfo& GpuDataManager::gpu_info() const { | 89 const GPUInfo& GpuDataManager::gpu_info() const { |
| 90 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 90 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 91 return gpu_info_; | 91 return gpu_info_; |
| 92 } | 92 } |
| 93 | 93 |
| 94 Value* GpuDataManager::GetBlacklistingReasons() const { | 94 Value* GpuDataManager::GetFeatureStatus() { |
| 95 if (gpu_feature_flags_.flags() != 0 && gpu_blacklist_.get()) | 95 if (gpu_blacklist_.get()) |
| 96 return gpu_blacklist_->GetBlacklistingReasons(); | 96 return gpu_blacklist_->GetFeatureStatus(GpuAccessAllowed()); |
| 97 return NULL; | 97 return NULL; |
| 98 } | 98 } |
| 99 | 99 |
| 100 std::string GpuDataManager::GetBlacklistVersion() const { | 100 std::string GpuDataManager::GetBlacklistVersion() const { |
| 101 if (gpu_blacklist_.get() != NULL) { | 101 if (gpu_blacklist_.get() != NULL) { |
| 102 uint16 version_major, version_minor; | 102 uint16 version_major, version_minor; |
| 103 if (gpu_blacklist_->GetVersion(&version_major, | 103 if (gpu_blacklist_->GetVersion(&version_major, |
| 104 &version_minor)) { | 104 &version_minor)) { |
| 105 std::string version_string = | 105 std::string version_string = |
| 106 base::UintToString(static_cast<unsigned>(version_major)) + | 106 base::UintToString(static_cast<unsigned>(version_major)) + |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 if (browser_command_line.HasSwitch(switches::kIgnoreGpuBlacklist) || | 298 if (browser_command_line.HasSwitch(switches::kIgnoreGpuBlacklist) || |
| 299 browser_command_line.GetSwitchValueASCII( | 299 browser_command_line.GetSwitchValueASCII( |
| 300 switches::kUseGL) == gfx::kGLImplementationOSMesaName) | 300 switches::kUseGL) == gfx::kGLImplementationOSMesaName) |
| 301 return NULL; | 301 return NULL; |
| 302 UpdateGpuBlacklist(); | 302 UpdateGpuBlacklist(); |
| 303 // No need to return an empty blacklist. | 303 // No need to return an empty blacklist. |
| 304 if (gpu_blacklist_.get() != NULL && gpu_blacklist_->max_entry_id() == 0) | 304 if (gpu_blacklist_.get() != NULL && gpu_blacklist_->max_entry_id() == 0) |
| 305 return NULL; | 305 return NULL; |
| 306 return gpu_blacklist_.get(); | 306 return gpu_blacklist_.get(); |
| 307 } | 307 } |
| OLD | NEW |