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

Side by Side Diff: chrome/browser/extensions/requirements_checker.cc

Issue 15745014: Move GPU device/driver info related code from content to gpu. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: rebase Created 7 years, 7 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/extensions/requirements_checker.h" 5 #include "chrome/browser/extensions/requirements_checker.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/browser/gpu/gpu_feature_checker.h" 9 #include "chrome/browser/gpu/gpu_feature_checker.h"
10 #include "chrome/common/extensions/extension_manifest_constants.h" 10 #include "chrome/common/extensions/extension_manifest_constants.h"
11 #include "chrome/common/extensions/extension.h" 11 #include "chrome/common/extensions/extension.h"
12 #include "chrome/common/extensions/manifest.h" 12 #include "chrome/common/extensions/manifest.h"
13 #include "chrome/common/extensions/manifest_handlers/requirements_handler.h" 13 #include "chrome/common/extensions/manifest_handlers/requirements_handler.h"
14 #include "content/public/browser/browser_thread.h" 14 #include "content/public/browser/browser_thread.h"
15 #include "content/public/common/gpu_feature_type.h" 15 #include "gpu/config/gpu_feature_type.h"
16 #include "grit/generated_resources.h" 16 #include "grit/generated_resources.h"
17 #include "ui/base/l10n/l10n_util.h" 17 #include "ui/base/l10n/l10n_util.h"
18 18
19 #if defined(OS_WIN) 19 #if defined(OS_WIN)
20 #include "base/win/metro.h" 20 #include "base/win/metro.h"
21 #endif // defined(OS_WIN) 21 #endif // defined(OS_WIN)
22 22
23 namespace extensions { 23 namespace extensions {
24 24
25 RequirementsChecker::RequirementsChecker() 25 RequirementsChecker::RequirementsChecker()
(...skipping 20 matching lines...) Expand all
46 if (base::win::IsMetroProcess()) { 46 if (base::win::IsMetroProcess()) {
47 errors_.push_back( 47 errors_.push_back(
48 l10n_util::GetStringUTF8(IDS_EXTENSION_NPAPI_NOT_SUPPORTED)); 48 l10n_util::GetStringUTF8(IDS_EXTENSION_NPAPI_NOT_SUPPORTED));
49 } 49 }
50 #endif // defined(OS_WIN) 50 #endif // defined(OS_WIN)
51 } 51 }
52 52
53 if (requirements.webgl) { 53 if (requirements.webgl) {
54 ++pending_requirement_checks_; 54 ++pending_requirement_checks_;
55 webgl_checker_ = new GPUFeatureChecker( 55 webgl_checker_ = new GPUFeatureChecker(
56 content::GPU_FEATURE_TYPE_WEBGL, 56 gpu::GPU_FEATURE_TYPE_WEBGL,
57 base::Bind(&RequirementsChecker::SetWebGLAvailability, 57 base::Bind(&RequirementsChecker::SetWebGLAvailability,
58 AsWeakPtr())); 58 AsWeakPtr()));
59 } 59 }
60 60
61 if (requirements.css3d) { 61 if (requirements.css3d) {
62 ++pending_requirement_checks_; 62 ++pending_requirement_checks_;
63 css3d_checker_ = new GPUFeatureChecker( 63 css3d_checker_ = new GPUFeatureChecker(
64 content::GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING, 64 gpu::GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING,
65 base::Bind(&RequirementsChecker::SetCSS3DAvailability, 65 base::Bind(&RequirementsChecker::SetCSS3DAvailability,
66 AsWeakPtr())); 66 AsWeakPtr()));
67 } 67 }
68 68
69 if (pending_requirement_checks_ == 0) { 69 if (pending_requirement_checks_ == 0) {
70 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, 70 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE,
71 base::Bind(callback_, errors_)); 71 base::Bind(callback_, errors_));
72 // Reset the callback so any ref-counted bound parameters will get released. 72 // Reset the callback so any ref-counted bound parameters will get released.
73 callback_.Reset(); 73 callback_.Reset();
74 return; 74 return;
(...skipping 26 matching lines...) Expand all
101 if (--pending_requirement_checks_ == 0) { 101 if (--pending_requirement_checks_ == 0) {
102 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, 102 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE,
103 base::Bind(callback_, errors_)); 103 base::Bind(callback_, errors_));
104 // Reset the callback so any ref-counted bound parameters will get released. 104 // Reset the callback so any ref-counted bound parameters will get released.
105 callback_.Reset(); 105 callback_.Reset();
106 errors_.clear(); 106 errors_.clear();
107 } 107 }
108 } 108 }
109 109
110 } // namespace extensions 110 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_service_unittest.cc ('k') | chrome/browser/extensions/requirements_checker_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698