OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/api/webstore_widget_private/app_installer.h" | 5 #include "chrome/browser/extensions/api/webstore_widget_private/app_installer.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "chrome/common/extensions/webstore_install_result.h" | 8 #include "chrome/common/extensions/webstore_install_result.h" |
9 #include "content/public/browser/web_contents.h" | 9 #include "content/public/browser/web_contents.h" |
10 #include "content/public/browser/web_contents_observer.h" | 10 #include "content/public/browser/web_contents_observer.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 | 49 |
50 bool AppInstaller::CheckRequestorAlive() const { | 50 bool AppInstaller::CheckRequestorAlive() const { |
51 // The tab may have gone away - cancel installation in that case. | 51 // The tab may have gone away - cancel installation in that case. |
52 return web_contents_ != NULL; | 52 return web_contents_ != NULL; |
53 } | 53 } |
54 | 54 |
55 const GURL& AppInstaller::GetRequestorURL() const { | 55 const GURL& AppInstaller::GetRequestorURL() const { |
56 return GURL::EmptyGURL(); | 56 return GURL::EmptyGURL(); |
57 } | 57 } |
58 | 58 |
59 scoped_ptr<ExtensionInstallPrompt::Prompt> AppInstaller::CreateInstallPrompt() | 59 std::unique_ptr<ExtensionInstallPrompt::Prompt> |
60 const { | 60 AppInstaller::CreateInstallPrompt() const { |
61 if (silent_installation_) | 61 if (silent_installation_) |
62 return nullptr; | 62 return nullptr; |
63 | 63 |
64 scoped_ptr<ExtensionInstallPrompt::Prompt> prompt( | 64 std::unique_ptr<ExtensionInstallPrompt::Prompt> prompt( |
65 new ExtensionInstallPrompt::Prompt( | 65 new ExtensionInstallPrompt::Prompt( |
66 ExtensionInstallPrompt::INLINE_INSTALL_PROMPT)); | 66 ExtensionInstallPrompt::INLINE_INSTALL_PROMPT)); |
67 | 67 |
68 prompt->SetWebstoreData(localized_user_count(), show_user_count(), | 68 prompt->SetWebstoreData(localized_user_count(), show_user_count(), |
69 average_rating(), rating_count()); | 69 average_rating(), rating_count()); |
70 return prompt; | 70 return prompt; |
71 } | 71 } |
72 | 72 |
73 bool AppInstaller::ShouldShowPostInstallUI() const { | 73 bool AppInstaller::ShouldShowPostInstallUI() const { |
74 return false; | 74 return false; |
(...skipping 23 matching lines...) Expand all Loading... |
98 return true; | 98 return true; |
99 } | 99 } |
100 | 100 |
101 void AppInstaller::OnWebContentsDestroyed(content::WebContents* web_contents) { | 101 void AppInstaller::OnWebContentsDestroyed(content::WebContents* web_contents) { |
102 callback_.Run(false, kWebContentsDestroyedError, | 102 callback_.Run(false, kWebContentsDestroyedError, |
103 extensions::webstore_install::OTHER_ERROR); | 103 extensions::webstore_install::OTHER_ERROR); |
104 AbortInstall(); | 104 AbortInstall(); |
105 } | 105 } |
106 | 106 |
107 } // namespace webstore_widget | 107 } // namespace webstore_widget |
OLD | NEW |