OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |