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

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

Issue 313203004: Make ExtensionInstallPrompt::Prompt ref-counted (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Latest master for CQ Created 6 years, 6 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/webstore_install_with_prompt.h" 5 #include "chrome/browser/extensions/webstore_install_with_prompt.h"
6 6
7 #include "chrome/browser/extensions/webstore_installer.h" 7 #include "chrome/browser/extensions/webstore_installer.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/ui/browser.h" 9 #include "chrome/browser/ui/browser.h"
10 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" 10 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 bool WebstoreInstallWithPrompt::CheckRequestorAlive() const { 44 bool WebstoreInstallWithPrompt::CheckRequestorAlive() const {
45 // Assume the requestor is always alive. 45 // Assume the requestor is always alive.
46 return true; 46 return true;
47 } 47 }
48 48
49 const GURL& WebstoreInstallWithPrompt::GetRequestorURL() const { 49 const GURL& WebstoreInstallWithPrompt::GetRequestorURL() const {
50 return dummy_requestor_url_; 50 return dummy_requestor_url_;
51 } 51 }
52 52
53 scoped_ptr<ExtensionInstallPrompt::Prompt> 53 scoped_refptr<ExtensionInstallPrompt::Prompt>
54 WebstoreInstallWithPrompt::CreateInstallPrompt() const { 54 WebstoreInstallWithPrompt::CreateInstallPrompt() const {
55 scoped_ptr<ExtensionInstallPrompt::Prompt> prompt( 55 return new ExtensionInstallPrompt::Prompt(
56 new ExtensionInstallPrompt::Prompt( 56 ExtensionInstallPrompt::INSTALL_PROMPT);
57 ExtensionInstallPrompt::INSTALL_PROMPT));
58 return prompt.Pass();
59 } 57 }
60 58
61 scoped_ptr<ExtensionInstallPrompt> 59 scoped_ptr<ExtensionInstallPrompt>
62 WebstoreInstallWithPrompt::CreateInstallUI() { 60 WebstoreInstallWithPrompt::CreateInstallUI() {
63 // Create an ExtensionInstallPrompt. If the parent window is NULL, the dialog 61 // Create an ExtensionInstallPrompt. If the parent window is NULL, the dialog
64 // will be placed in the middle of the screen. 62 // will be placed in the middle of the screen.
65 return make_scoped_ptr( 63 return make_scoped_ptr(
66 new ExtensionInstallPrompt(profile(), parent_window_, this)); 64 new ExtensionInstallPrompt(profile(), parent_window_, this));
67 } 65 }
68 66
(...skipping 26 matching lines...) Expand all
95 } 93 }
96 94
97 content::WebContents* WebstoreInstallWithPrompt::OpenURL( 95 content::WebContents* WebstoreInstallWithPrompt::OpenURL(
98 const content::OpenURLParams& params) { 96 const content::OpenURLParams& params) {
99 chrome::ScopedTabbedBrowserDisplayer displayer(profile(), 97 chrome::ScopedTabbedBrowserDisplayer displayer(profile(),
100 chrome::GetActiveDesktop()); 98 chrome::GetActiveDesktop());
101 return displayer.browser()->OpenURL(params); 99 return displayer.browser()->OpenURL(params);
102 } 100 }
103 101
104 } // namespace extensions 102 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/webstore_install_with_prompt.h ('k') | chrome/browser/extensions/webstore_standalone_installer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698