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

Side by Side Diff: chrome/browser/shell_integration_win.cc

Issue 2334613003: Re-write many calls to WrapUnique() with MakeUnique() (Closed)
Patch Set: Changes from review by sky 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/shell_integration_win.h" 5 #include "chrome/browser/shell_integration_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <shlwapi.h> 8 #include <shlwapi.h>
9 #include <shobjidl.h> 9 #include <shobjidl.h>
10 #include <propkey.h> // Needs to come after shobjidl.h. 10 #include <propkey.h> // Needs to come after shobjidl.h.
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 "DefaultBrowser.SettingsInteraction.ConcludeReason", conclude_reason, 373 "DefaultBrowser.SettingsInteraction.ConcludeReason", conclude_reason,
374 NUM_CONCLUDE_REASON_TYPES); 374 NUM_CONCLUDE_REASON_TYPES);
375 on_finished_callback_.Run(); 375 on_finished_callback_.Run();
376 delete instance_; 376 delete instance_;
377 instance_ = nullptr; 377 instance_ = nullptr;
378 } 378 }
379 379
380 // Helper function to create a registry watcher for a given |key_path|. Do 380 // Helper function to create a registry watcher for a given |key_path|. Do
381 // nothing on initialization failure. 381 // nothing on initialization failure.
382 void AddRegistryKeyWatcher(const wchar_t* key_path) { 382 void AddRegistryKeyWatcher(const wchar_t* key_path) {
383 auto reg_key = base::WrapUnique( 383 auto reg_key = base::MakeUnique<base::win::RegKey>(HKEY_CURRENT_USER,
384 new base::win::RegKey(HKEY_CURRENT_USER, key_path, KEY_NOTIFY)); 384 key_path, KEY_NOTIFY);
385 385
386 if (reg_key->Valid() && 386 if (reg_key->Valid() &&
387 reg_key->StartWatching( 387 reg_key->StartWatching(
388 base::Bind(&OpenSystemSettingsHelper::OnRegistryKeyChanged, 388 base::Bind(&OpenSystemSettingsHelper::OnRegistryKeyChanged,
389 weak_ptr_factory_.GetWeakPtr()))) { 389 weak_ptr_factory_.GetWeakPtr()))) {
390 registry_key_watchers_.push_back(std::move(reg_key)); 390 registry_key_watchers_.push_back(std::move(reg_key));
391 } 391 }
392 } 392 }
393 393
394 // Used to make sure only one instance is alive at the same time. 394 // Used to make sure only one instance is alive at the same time.
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
853 if (base::PathExists(shortcut)) 853 if (base::PathExists(shortcut))
854 return shortcut; 854 return shortcut;
855 } 855 }
856 856
857 return base::FilePath(); 857 return base::FilePath();
858 } 858 }
859 859
860 } // namespace win 860 } // namespace win
861 861
862 } // namespace shell_integration 862 } // namespace shell_integration
OLDNEW
« no previous file with comments | « chrome/browser/sessions/tab_loader.cc ('k') | chrome/browser/signin/chrome_proximity_auth_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698