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

Side by Side Diff: chrome/browser/extensions/api/developer_private/show_permissions_dialog_helper.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/developer_private/show_permissions_dialo g_helper.h" 5 #include "chrome/browser/extensions/api/developer_private/show_permissions_dialo g_helper.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "apps/app_load_service.h" 9 #include "apps/app_load_service.h"
10 #include "apps/saved_files_service.h" 10 #include "apps/saved_files_service.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 ->GetAllFileEntries(extension_id_); 71 ->GetAllFileEntries(extension_id_);
72 for (const apps::SavedFileEntry& entry : retained_file_entries) 72 for (const apps::SavedFileEntry& entry : retained_file_entries)
73 retained_file_paths.push_back(entry.path); 73 retained_file_paths.push_back(entry.path);
74 } 74 }
75 std::vector<base::string16> retained_device_messages; 75 std::vector<base::string16> retained_device_messages;
76 if (extension->permissions_data()->HasAPIPermission(APIPermission::kUsb)) { 76 if (extension->permissions_data()->HasAPIPermission(APIPermission::kUsb)) {
77 retained_device_messages = 77 retained_device_messages =
78 DevicePermissionsManager::Get(profile_) 78 DevicePermissionsManager::Get(profile_)
79 ->GetPermissionMessageStrings(extension_id_); 79 ->GetPermissionMessageStrings(extension_id_);
80 } 80 }
81 scoped_ptr<ExtensionInstallPrompt::Prompt> prompt( 81 std::unique_ptr<ExtensionInstallPrompt::Prompt> prompt(
82 new ExtensionInstallPrompt::Prompt( 82 new ExtensionInstallPrompt::Prompt(
83 ExtensionInstallPrompt::POST_INSTALL_PERMISSIONS_PROMPT)); 83 ExtensionInstallPrompt::POST_INSTALL_PERMISSIONS_PROMPT));
84 prompt->set_retained_files(retained_file_paths); 84 prompt->set_retained_files(retained_file_paths);
85 prompt->set_retained_device_messages(retained_device_messages); 85 prompt->set_retained_device_messages(retained_device_messages);
86 // Unretained() is safe because this class manages its own lifetime and 86 // Unretained() is safe because this class manages its own lifetime and
87 // deletes itself in OnInstallPromptDone(). 87 // deletes itself in OnInstallPromptDone().
88 prompt_->ShowDialog( 88 prompt_->ShowDialog(
89 base::Bind(&ShowPermissionsDialogHelper::OnInstallPromptDone, 89 base::Bind(&ShowPermissionsDialogHelper::OnInstallPromptDone,
90 base::Unretained(this)), 90 base::Unretained(this)),
91 extension, nullptr, std::move(prompt), 91 extension, nullptr, std::move(prompt),
(...skipping 12 matching lines...) Expand all
104 apps::SavedFilesService::Get(profile_)->ClearQueue(extension); 104 apps::SavedFilesService::Get(profile_)->ClearQueue(extension);
105 apps::AppLoadService::Get(profile_) 105 apps::AppLoadService::Get(profile_)
106 ->RestartApplicationIfRunning(extension_id_); 106 ->RestartApplicationIfRunning(extension_id_);
107 } 107 }
108 108
109 on_complete_.Run(); 109 on_complete_.Run();
110 delete this; 110 delete this;
111 } 111 }
112 112
113 } // namespace extensions 113 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698