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

Side by Side Diff: chrome/browser/ui/app_list/launcher_page_event_dispatcher.cc

Issue 2251263003: 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/ui/app_list/launcher_page_event_dispatcher.h" 5 #include "chrome/browser/ui/app_list/launcher_page_event_dispatcher.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 10 matching lines...) Expand all
21 LauncherPageEventDispatcher::LauncherPageEventDispatcher( 21 LauncherPageEventDispatcher::LauncherPageEventDispatcher(
22 Profile* profile, 22 Profile* profile,
23 const std::string& extension_id) 23 const std::string& extension_id)
24 : profile_(profile), extension_id_(extension_id) { 24 : profile_(profile), extension_id_(extension_id) {
25 } 25 }
26 26
27 LauncherPageEventDispatcher::~LauncherPageEventDispatcher() { 27 LauncherPageEventDispatcher::~LauncherPageEventDispatcher() {
28 } 28 }
29 29
30 void LauncherPageEventDispatcher::ProgressChanged(double progress) { 30 void LauncherPageEventDispatcher::ProgressChanged(double progress) {
31 DispatchEvent(base::WrapUnique(new extensions::Event( 31 DispatchEvent(base::MakeUnique<extensions::Event>(
32 extensions::events::LAUNCHER_PAGE_ON_TRANSITION_CHANGED, 32 extensions::events::LAUNCHER_PAGE_ON_TRANSITION_CHANGED,
33 OnTransitionChanged::kEventName, OnTransitionChanged::Create(progress)))); 33 OnTransitionChanged::kEventName, OnTransitionChanged::Create(progress)));
34 } 34 }
35 35
36 void LauncherPageEventDispatcher::PopSubpage() { 36 void LauncherPageEventDispatcher::PopSubpage() {
37 DispatchEvent(base::WrapUnique( 37 DispatchEvent(base::MakeUnique<extensions::Event>(
38 new extensions::Event(extensions::events::LAUNCHER_PAGE_ON_POP_SUBPAGE, 38 extensions::events::LAUNCHER_PAGE_ON_POP_SUBPAGE,
39 OnPopSubpage::kEventName, OnPopSubpage::Create()))); 39 OnPopSubpage::kEventName, OnPopSubpage::Create()));
40 } 40 }
41 41
42 void LauncherPageEventDispatcher::DispatchEvent( 42 void LauncherPageEventDispatcher::DispatchEvent(
43 std::unique_ptr<extensions::Event> event) { 43 std::unique_ptr<extensions::Event> event) {
44 extensions::EventRouter::Get(profile_) 44 extensions::EventRouter::Get(profile_)
45 ->DispatchEventToExtension(extension_id_, std::move(event)); 45 ->DispatchEventToExtension(extension_id_, std::move(event));
46 } 46 }
47 47
48 } // namespace app_list 48 } // namespace app_list
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698