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

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

Issue 2257113002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 3 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 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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/extensions/update_install_gate_unittest.cc ('k') | chrome/browser/extensions/webstore_standalone_installer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698