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

Side by Side Diff: chrome/browser/extensions/navigation_observer.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/navigation_observer.h" 5 #include "chrome/browser/extensions/navigation_observer.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "chrome/browser/extensions/extension_service.h" 8 #include "chrome/browser/extensions/extension_service.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "content/public/browser/navigation_controller.h" 10 #include "content/public/browser/navigation_controller.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 80
81 extension_install_prompt_.reset( 81 extension_install_prompt_.reset(
82 new ExtensionInstallPrompt(nav_controller->GetWebContents())); 82 new ExtensionInstallPrompt(nav_controller->GetWebContents()));
83 ExtensionInstallPrompt::PromptType type = 83 ExtensionInstallPrompt::PromptType type =
84 ExtensionInstallPrompt::GetReEnablePromptTypeForExtension(profile_, 84 ExtensionInstallPrompt::GetReEnablePromptTypeForExtension(profile_,
85 extension); 85 extension);
86 extension_install_prompt_->ShowDialog( 86 extension_install_prompt_->ShowDialog(
87 base::Bind(&NavigationObserver::OnInstallPromptDone, 87 base::Bind(&NavigationObserver::OnInstallPromptDone,
88 weak_factory_.GetWeakPtr()), 88 weak_factory_.GetWeakPtr()),
89 extension, nullptr, 89 extension, nullptr,
90 base::WrapUnique(new ExtensionInstallPrompt::Prompt(type)), 90 base::MakeUnique<ExtensionInstallPrompt::Prompt>(type),
91 ExtensionInstallPrompt::GetDefaultShowDialogCallback()); 91 ExtensionInstallPrompt::GetDefaultShowDialogCallback());
92 } 92 }
93 } 93 }
94 94
95 void NavigationObserver::OnInstallPromptDone( 95 void NavigationObserver::OnInstallPromptDone(
96 ExtensionInstallPrompt::Result result) { 96 ExtensionInstallPrompt::Result result) {
97 // The extension was already uninstalled. 97 // The extension was already uninstalled.
98 if (in_progress_prompt_extension_id_.empty()) 98 if (in_progress_prompt_extension_id_.empty())
99 return; 99 return;
100 100
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 in_progress_prompt_extension_id_ != extension->id()) { 134 in_progress_prompt_extension_id_ != extension->id()) {
135 return; 135 return;
136 } 136 }
137 137
138 in_progress_prompt_extension_id_ = std::string(); 138 in_progress_prompt_extension_id_ = std::string();
139 in_progress_prompt_navigation_controller_ = nullptr; 139 in_progress_prompt_navigation_controller_ = nullptr;
140 extension_install_prompt_.reset(); 140 extension_install_prompt_.reset();
141 } 141 }
142 142
143 } // namespace extensions 143 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/menu_manager_unittest.cc ('k') | chrome/browser/extensions/permissions_updater_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698