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

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

Issue 1871713002: Convert //chrome/browser/extensions from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and fix header Created 4 years, 8 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 "chrome/browser/extensions/webstore_installer.h" 8 #include "chrome/browser/extensions/webstore_installer.h"
8 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
9 #include "content/public/browser/web_contents.h" 10 #include "content/public/browser/web_contents.h"
10 11
11 using content::WebContents; 12 using content::WebContents;
12 13
13 namespace extensions { 14 namespace extensions {
14 15
15 WebstoreInstallWithPrompt::WebstoreInstallWithPrompt( 16 WebstoreInstallWithPrompt::WebstoreInstallWithPrompt(
16 const std::string& webstore_item_id, 17 const std::string& webstore_item_id,
(...skipping 30 matching lines...) Expand all
47 // Assume the requestor is always alive if |parent_window_| is null. 48 // Assume the requestor is always alive if |parent_window_| is null.
48 return true; 49 return true;
49 } 50 }
50 return !parent_window_tracker_->WasNativeWindowClosed(); 51 return !parent_window_tracker_->WasNativeWindowClosed();
51 } 52 }
52 53
53 const GURL& WebstoreInstallWithPrompt::GetRequestorURL() const { 54 const GURL& WebstoreInstallWithPrompt::GetRequestorURL() const {
54 return dummy_requestor_url_; 55 return dummy_requestor_url_;
55 } 56 }
56 57
57 scoped_ptr<ExtensionInstallPrompt::Prompt> 58 std::unique_ptr<ExtensionInstallPrompt::Prompt>
58 WebstoreInstallWithPrompt::CreateInstallPrompt() const { 59 WebstoreInstallWithPrompt::CreateInstallPrompt() const {
59 return make_scoped_ptr(new ExtensionInstallPrompt::Prompt( 60 return base::WrapUnique(new ExtensionInstallPrompt::Prompt(
60 ExtensionInstallPrompt::INSTALL_PROMPT)); 61 ExtensionInstallPrompt::INSTALL_PROMPT));
61 } 62 }
62 63
63 scoped_ptr<ExtensionInstallPrompt> 64 std::unique_ptr<ExtensionInstallPrompt>
64 WebstoreInstallWithPrompt::CreateInstallUI() { 65 WebstoreInstallWithPrompt::CreateInstallUI() {
65 // Create an ExtensionInstallPrompt. If the parent window is NULL, the dialog 66 // Create an ExtensionInstallPrompt. If the parent window is NULL, the dialog
66 // will be placed in the middle of the screen. 67 // will be placed in the middle of the screen.
67 return make_scoped_ptr(new ExtensionInstallPrompt(profile(), parent_window_)); 68 return base::WrapUnique(
69 new ExtensionInstallPrompt(profile(), parent_window_));
68 } 70 }
69 71
70 bool WebstoreInstallWithPrompt::ShouldShowPostInstallUI() const { 72 bool WebstoreInstallWithPrompt::ShouldShowPostInstallUI() const {
71 return show_post_install_ui_; 73 return show_post_install_ui_;
72 } 74 }
73 75
74 bool WebstoreInstallWithPrompt::ShouldShowAppInstalledBubble() const { 76 bool WebstoreInstallWithPrompt::ShouldShowAppInstalledBubble() const {
75 return false; 77 return false;
76 } 78 }
77 79
(...skipping 11 matching lines...) Expand all
89 91
90 bool WebstoreInstallWithPrompt::CheckRequestorPermitted( 92 bool WebstoreInstallWithPrompt::CheckRequestorPermitted(
91 const base::DictionaryValue& webstore_data, 93 const base::DictionaryValue& webstore_data,
92 std::string* error) const { 94 std::string* error) const {
93 // Assume the requestor is trusted. 95 // Assume the requestor is trusted.
94 *error = std::string(); 96 *error = std::string();
95 return true; 97 return true;
96 } 98 }
97 99
98 } // namespace extensions 100 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/webstore_install_with_prompt.h ('k') | chrome/browser/extensions/webstore_installer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698