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 "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "chrome/browser/extensions/webstore_installer.h" | 8 #include "chrome/browser/extensions/webstore_installer.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "content/public/browser/web_contents.h" | 10 #include "content/public/browser/web_contents.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 } | 50 } |
51 return !parent_window_tracker_->WasNativeWindowClosed(); | 51 return !parent_window_tracker_->WasNativeWindowClosed(); |
52 } | 52 } |
53 | 53 |
54 const GURL& WebstoreInstallWithPrompt::GetRequestorURL() const { | 54 const GURL& WebstoreInstallWithPrompt::GetRequestorURL() const { |
55 return dummy_requestor_url_; | 55 return dummy_requestor_url_; |
56 } | 56 } |
57 | 57 |
58 std::unique_ptr<ExtensionInstallPrompt::Prompt> | 58 std::unique_ptr<ExtensionInstallPrompt::Prompt> |
59 WebstoreInstallWithPrompt::CreateInstallPrompt() const { | 59 WebstoreInstallWithPrompt::CreateInstallPrompt() const { |
60 return base::WrapUnique(new ExtensionInstallPrompt::Prompt( | 60 return base::MakeUnique<ExtensionInstallPrompt::Prompt>( |
61 ExtensionInstallPrompt::INSTALL_PROMPT)); | 61 ExtensionInstallPrompt::INSTALL_PROMPT); |
62 } | 62 } |
63 | 63 |
64 std::unique_ptr<ExtensionInstallPrompt> | 64 std::unique_ptr<ExtensionInstallPrompt> |
65 WebstoreInstallWithPrompt::CreateInstallUI() { | 65 WebstoreInstallWithPrompt::CreateInstallUI() { |
66 // Create an ExtensionInstallPrompt. If the parent window is NULL, the dialog | 66 // Create an ExtensionInstallPrompt. If the parent window is NULL, the dialog |
67 // will be placed in the middle of the screen. | 67 // will be placed in the middle of the screen. |
68 return base::WrapUnique( | 68 return base::MakeUnique<ExtensionInstallPrompt>(profile(), parent_window_); |
69 new ExtensionInstallPrompt(profile(), parent_window_)); | |
70 } | 69 } |
71 | 70 |
72 bool WebstoreInstallWithPrompt::ShouldShowPostInstallUI() const { | 71 bool WebstoreInstallWithPrompt::ShouldShowPostInstallUI() const { |
73 return show_post_install_ui_; | 72 return show_post_install_ui_; |
74 } | 73 } |
75 | 74 |
76 bool WebstoreInstallWithPrompt::ShouldShowAppInstalledBubble() const { | 75 bool WebstoreInstallWithPrompt::ShouldShowAppInstalledBubble() const { |
77 return false; | 76 return false; |
78 } | 77 } |
79 | 78 |
(...skipping 11 matching lines...) Expand all Loading... |
91 | 90 |
92 bool WebstoreInstallWithPrompt::CheckRequestorPermitted( | 91 bool WebstoreInstallWithPrompt::CheckRequestorPermitted( |
93 const base::DictionaryValue& webstore_data, | 92 const base::DictionaryValue& webstore_data, |
94 std::string* error) const { | 93 std::string* error) const { |
95 // Assume the requestor is trusted. | 94 // Assume the requestor is trusted. |
96 *error = std::string(); | 95 *error = std::string(); |
97 return true; | 96 return true; |
98 } | 97 } |
99 | 98 |
100 } // namespace extensions | 99 } // namespace extensions |
OLD | NEW |