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 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBSTORE_PRIVATE_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBSTORE_PRIVATE_API_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBSTORE_PRIVATE_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBSTORE_PRIVATE_API_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "chrome/browser/extensions/extension_function.h" | 11 #include "chrome/browser/extensions/extension_function.h" |
12 #include "chrome/browser/extensions/extension_install_ui.h" | 12 #include "chrome/browser/extensions/extension_install_ui.h" |
13 #include "chrome/browser/extensions/webstore_install_helper.h" | 13 #include "chrome/browser/extensions/webstore_install_helper.h" |
14 #include "chrome/browser/extensions/webstore_installer.h" | 14 #include "chrome/browser/extensions/webstore_installer.h" |
15 #include "chrome/common/net/gaia/google_service_auth_error.h" | 15 #include "chrome/common/net/gaia/google_service_auth_error.h" |
| 16 #include "content/browser/gpu/gpu_data_manager.h" |
16 #include "content/public/browser/notification_observer.h" | 17 #include "content/public/browser/notification_observer.h" |
17 #include "content/public/browser/notification_registrar.h" | 18 #include "content/public/browser/notification_registrar.h" |
18 | 19 |
19 class ProfileSyncService; | 20 class ProfileSyncService; |
20 | 21 |
21 class WebstorePrivateApi { | 22 class WebstorePrivateApi { |
22 public: | 23 public: |
23 // Allows you to set the ProfileSyncService the function will use for | 24 // Allows you to set the ProfileSyncService the function will use for |
24 // testing purposes. | 25 // testing purposes. |
25 static void SetTestingProfileSyncService(ProfileSyncService* service); | 26 static void SetTestingProfileSyncService(ProfileSyncService* service); |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 class GetStoreLoginFunction : public SyncExtensionFunction { | 153 class GetStoreLoginFunction : public SyncExtensionFunction { |
153 virtual bool RunImpl() OVERRIDE; | 154 virtual bool RunImpl() OVERRIDE; |
154 DECLARE_EXTENSION_FUNCTION_NAME("webstorePrivate.getStoreLogin"); | 155 DECLARE_EXTENSION_FUNCTION_NAME("webstorePrivate.getStoreLogin"); |
155 }; | 156 }; |
156 | 157 |
157 class SetStoreLoginFunction : public SyncExtensionFunction { | 158 class SetStoreLoginFunction : public SyncExtensionFunction { |
158 virtual bool RunImpl() OVERRIDE; | 159 virtual bool RunImpl() OVERRIDE; |
159 DECLARE_EXTENSION_FUNCTION_NAME("webstorePrivate.setStoreLogin"); | 160 DECLARE_EXTENSION_FUNCTION_NAME("webstorePrivate.setStoreLogin"); |
160 }; | 161 }; |
161 | 162 |
| 163 class GetWebGLStatusFunction : public AsyncExtensionFunction, |
| 164 public GpuDataManager::Observer { |
| 165 public: |
| 166 GetWebGLStatusFunction(); |
| 167 |
| 168 // Implementing GpuDataManager::Observer interface. |
| 169 virtual void OnGpuInfoUpdate() OVERRIDE; |
| 170 |
| 171 protected: |
| 172 virtual ~GetWebGLStatusFunction(); |
| 173 virtual bool RunImpl() OVERRIDE; |
| 174 |
| 175 private: |
| 176 void CreateResult(bool webgl_allowed); |
| 177 |
| 178 // A false return value is always valid, but a true one is only valid if full |
| 179 // GPU info has been collected in a GPU process. |
| 180 static bool IsWebGLAllowed(GpuDataManager* manager); |
| 181 |
| 182 DECLARE_EXTENSION_FUNCTION_NAME("webstorePrivate.getWebGLStatus"); |
| 183 }; |
| 184 |
162 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBSTORE_PRIVATE_API_H_ | 185 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBSTORE_PRIVATE_API_H_ |
OLD | NEW |