| 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 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_PROMPT_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_PROMPT_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_PROMPT_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_PROMPT_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/callback.h" | 14 #include "base/callback.h" |
| 15 #include "base/files/file_path.h" | 15 #include "base/files/file_path.h" |
| 16 #include "base/macros.h" | 16 #include "base/macros.h" |
| 17 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
| 18 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
| 19 #include "base/strings/string16.h" | 19 #include "base/strings/string16.h" |
| 20 #include "base/threading/thread_checker.h" |
| 20 #include "extensions/common/permissions/permission_message.h" | 21 #include "extensions/common/permissions/permission_message.h" |
| 21 #include "third_party/skia/include/core/SkBitmap.h" | 22 #include "third_party/skia/include/core/SkBitmap.h" |
| 22 #include "ui/gfx/image/image.h" | 23 #include "ui/gfx/image/image.h" |
| 23 #include "ui/gfx/native_widget_types.h" | 24 #include "ui/gfx/native_widget_types.h" |
| 24 | 25 |
| 25 class ExtensionInstallPromptShowParams; | 26 class ExtensionInstallPromptShowParams; |
| 26 class Profile; | 27 class Profile; |
| 27 | 28 |
| 28 namespace base { | 29 namespace base { |
| 29 class DictionaryValue; | 30 class DictionaryValue; |
| 30 class MessageLoop; | |
| 31 } // namespace base | 31 } // namespace base |
| 32 | 32 |
| 33 namespace content { | 33 namespace content { |
| 34 class BrowserContext; | 34 class BrowserContext; |
| 35 class WebContents; | 35 class WebContents; |
| 36 } | 36 } |
| 37 | 37 |
| 38 namespace extensions { | 38 namespace extensions { |
| 39 class CrxInstallError; | 39 class CrxInstallError; |
| 40 class Extension; | 40 class Extension; |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 // Starts the process of showing a confirmation UI, which is split into two. | 347 // Starts the process of showing a confirmation UI, which is split into two. |
| 348 // 1) Set off a 'load icon' task. | 348 // 1) Set off a 'load icon' task. |
| 349 // 2) Handle the load icon response and show the UI (OnImageLoaded). | 349 // 2) Handle the load icon response and show the UI (OnImageLoaded). |
| 350 void LoadImageIfNeeded(); | 350 void LoadImageIfNeeded(); |
| 351 | 351 |
| 352 // Shows the actual UI (the icon should already be loaded). | 352 // Shows the actual UI (the icon should already be loaded). |
| 353 void ShowConfirmation(); | 353 void ShowConfirmation(); |
| 354 | 354 |
| 355 Profile* profile_; | 355 Profile* profile_; |
| 356 | 356 |
| 357 base::MessageLoop* ui_loop_; | 357 base::ThreadChecker ui_thread_checker_; |
| 358 | 358 |
| 359 // The extensions installation icon. | 359 // The extensions installation icon. |
| 360 SkBitmap icon_; | 360 SkBitmap icon_; |
| 361 | 361 |
| 362 // The extension we are showing the UI for. | 362 // The extension we are showing the UI for. |
| 363 const extensions::Extension* extension_; | 363 const extensions::Extension* extension_; |
| 364 | 364 |
| 365 // A custom set of permissions to show in the install prompt instead of the | 365 // A custom set of permissions to show in the install prompt instead of the |
| 366 // extension's active permissions. | 366 // extension's active permissions. |
| 367 std::unique_ptr<const extensions::PermissionSet> custom_permissions_; | 367 std::unique_ptr<const extensions::PermissionSet> custom_permissions_; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 383 | 383 |
| 384 // Whether or not the |show_dialog_callback_| was called. | 384 // Whether or not the |show_dialog_callback_| was called. |
| 385 bool did_call_show_dialog_; | 385 bool did_call_show_dialog_; |
| 386 | 386 |
| 387 base::WeakPtrFactory<ExtensionInstallPrompt> weak_factory_; | 387 base::WeakPtrFactory<ExtensionInstallPrompt> weak_factory_; |
| 388 | 388 |
| 389 DISALLOW_COPY_AND_ASSIGN(ExtensionInstallPrompt); | 389 DISALLOW_COPY_AND_ASSIGN(ExtensionInstallPrompt); |
| 390 }; | 390 }; |
| 391 | 391 |
| 392 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_PROMPT_H_ | 392 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_PROMPT_H_ |
| OLD | NEW |