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

Side by Side Diff: chrome/browser/extensions/bundle_installer.h

Issue 138803012: Fix use-after-free in WebstoreInstaller (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 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
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 #ifndef CHROME_BROWSER_EXTENSIONS_BUNDLE_INSTALLER_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_BUNDLE_INSTALLER_H_
6 #define CHROME_BROWSER_EXTENSIONS_BUNDLE_INSTALLER_H_ 6 #define CHROME_BROWSER_EXTENSIONS_BUNDLE_INSTALLER_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/memory/linked_ptr.h" 11 #include "base/memory/linked_ptr.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/strings/string16.h" 13 #include "base/strings/string16.h"
14 #include "chrome/browser/extensions/extension_install_prompt.h" 14 #include "chrome/browser/extensions/extension_install_prompt.h"
15 #include "chrome/browser/extensions/webstore_install_helper.h" 15 #include "chrome/browser/extensions/webstore_install_helper.h"
16 #include "chrome/browser/extensions/webstore_installer.h" 16 #include "chrome/browser/extensions/webstore_installer.h"
17 #include "chrome/browser/ui/browser_list_observer.h" 17 #include "chrome/browser/ui/browser_list_observer.h"
18 #include "chrome/browser/ui/host_desktop.h" 18 #include "chrome/browser/ui/host_desktop.h"
19 #include "extensions/common/extension.h" 19 #include "extensions/common/extension.h"
20 20
21 namespace base { 21 namespace base {
22 class DictionaryValue; 22 class DictionaryValue;
23 } // namespace base 23 } // namespace base
24 24
25 namespace content { 25 namespace content {
26 class NavigationController; 26 class WebContents;
27 } // namespace content 27 } // namespace content
28 28
29 class Browser; 29 class Browser;
30 class Profile; 30 class Profile;
31 31
32 namespace extensions { 32 namespace extensions {
33 33
34 // Manages the installation life cycle for extension bundles. 34 // Manages the installation life cycle for extension bundles.
35 // 35 //
36 // We install bundles in two steps: 36 // We install bundles in two steps:
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 89
90 // Parses the extension manifests and then prompts the user to approve their 90 // Parses the extension manifests and then prompts the user to approve their
91 // permissions. One of OnBundleInstallApproved or OnBundleInstallCanceled 91 // permissions. One of OnBundleInstallApproved or OnBundleInstallCanceled
92 // will be called when complete if |delegate| is not NULL. 92 // will be called when complete if |delegate| is not NULL.
93 // Note: the |delegate| must stay alive until receiving the callback. 93 // Note: the |delegate| must stay alive until receiving the callback.
94 void PromptForApproval(Delegate* delegate); 94 void PromptForApproval(Delegate* delegate);
95 95
96 // If the bundle has been approved, this downloads and installs the member 96 // If the bundle has been approved, this downloads and installs the member
97 // extensions. OnBundleInstallComplete will be called when the process is 97 // extensions. OnBundleInstallComplete will be called when the process is
98 // complete and |delegate| is not NULL. The download process uses the 98 // complete and |delegate| is not NULL. The download process uses the
99 // specified |controller|. When complete, we show a confirmation bubble in 99 // NavigationController of the specified |web_contents|. When complete, we
100 // the specified |browser|. 100 // show a confirmation bubble in the specified |browser|.
101 // Note: the |delegate| must stay alive until receiving the callback. 101 // Note: the |delegate| must stay alive until receiving the callback.
102 void CompleteInstall(content::NavigationController* controller, 102 void CompleteInstall(content::WebContents* web_contents, Delegate* delegate);
103 Delegate* delegate);
104 103
105 // We change the headings in the install prompt and installed bubble depending 104 // We change the headings in the install prompt and installed bubble depending
106 // on whether the bundle contains apps, extensions or both. This method gets 105 // on whether the bundle contains apps, extensions or both. This method gets
107 // the correct heading for the items in the specified |state|, or an empty 106 // the correct heading for the items in the specified |state|, or an empty
108 // string if no items are in the |state|. 107 // string if no items are in the |state|.
109 // STATE_PENDING - install prompt 108 // STATE_PENDING - install prompt
110 // STATE_INSTALLED - installed bubble successful installs list 109 // STATE_INSTALLED - installed bubble successful installs list
111 // STATE_FAILED - installed bubble failed installs list 110 // STATE_FAILED - installed bubble failed installs list
112 base::string16 GetHeadingTextFor(Item::State state) const; 111 base::string16 GetHeadingTextFor(Item::State state) const;
113 112
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 scoped_ptr<ExtensionInstallPrompt> install_ui_; 196 scoped_ptr<ExtensionInstallPrompt> install_ui_;
198 197
199 Delegate* delegate_; 198 Delegate* delegate_;
200 199
201 DISALLOW_COPY_AND_ASSIGN(BundleInstaller); 200 DISALLOW_COPY_AND_ASSIGN(BundleInstaller);
202 }; 201 };
203 202
204 } // namespace extensions 203 } // namespace extensions
205 204
206 #endif // CHROME_BROWSER_EXTENSIONS_BUNDLE_INSTALLER_H_ 205 #endif // CHROME_BROWSER_EXTENSIONS_BUNDLE_INSTALLER_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/webstore_private/webstore_private_api.cc ('k') | chrome/browser/extensions/bundle_installer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698