OLD | NEW |
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/chrome_requirements_checker.h" | 5 #include "chrome/browser/extensions/chrome_requirements_checker.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "chrome/grit/generated_resources.h" | 9 #include "chrome/grit/generated_resources.h" |
10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 if (requirements.window_shape) { | 43 if (requirements.window_shape) { |
44 #if !defined(USE_AURA) | 44 #if !defined(USE_AURA) |
45 errors_.push_back( | 45 errors_.push_back( |
46 l10n_util::GetStringUTF8(IDS_EXTENSION_WINDOW_SHAPE_NOT_SUPPORTED)); | 46 l10n_util::GetStringUTF8(IDS_EXTENSION_WINDOW_SHAPE_NOT_SUPPORTED)); |
47 #endif | 47 #endif |
48 } | 48 } |
49 | 49 |
50 if (requirements.webgl) { | 50 if (requirements.webgl) { |
51 ++pending_requirement_checks_; | 51 ++pending_requirement_checks_; |
52 webgl_checker_ = content::GpuFeatureChecker::Create( | 52 webgl_checker_ = content::GpuFeatureChecker::Create( |
53 gpu::GPU_FEATURE_TYPE_WEBGL, | 53 gpu::GPU_FEATURE_TYPE_ACCELERATED_WEBGL, |
54 base::Bind(&ChromeRequirementsChecker::SetWebGLAvailability, | 54 base::Bind(&ChromeRequirementsChecker::SetWebGLAvailability, |
55 weak_ptr_factory_.GetWeakPtr())); | 55 weak_ptr_factory_.GetWeakPtr())); |
56 } | 56 } |
57 | 57 |
58 if (pending_requirement_checks_ == 0) { | 58 if (pending_requirement_checks_ == 0) { |
59 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, | 59 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, |
60 base::Bind(callback_, errors_)); | 60 base::Bind(callback_, errors_)); |
61 // Reset the callback so any ref-counted bound parameters will get released. | 61 // Reset the callback so any ref-counted bound parameters will get released. |
62 callback_.Reset(); | 62 callback_.Reset(); |
63 return; | 63 return; |
(...skipping 16 matching lines...) Expand all Loading... |
80 if (--pending_requirement_checks_ == 0) { | 80 if (--pending_requirement_checks_ == 0) { |
81 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, | 81 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, |
82 base::Bind(callback_, errors_)); | 82 base::Bind(callback_, errors_)); |
83 // Reset the callback so any ref-counted bound parameters will get released. | 83 // Reset the callback so any ref-counted bound parameters will get released. |
84 callback_.Reset(); | 84 callback_.Reset(); |
85 errors_.clear(); | 85 errors_.clear(); |
86 } | 86 } |
87 } | 87 } |
88 | 88 |
89 } // namespace extensions | 89 } // namespace extensions |
OLD | NEW |