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

Side by Side Diff: chrome/browser/extensions/api/launcher_page/launcher_page_api.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/api/launcher_page/launcher_page_api.h" 5 #include "chrome/browser/extensions/api/launcher_page/launcher_page_api.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/ui/app_list/app_list_service.h" 9 #include "chrome/browser/ui/app_list/app_list_service.h"
10 #include "chrome/browser/ui/app_list/app_list_syncable_service.h" 10 #include "chrome/browser/ui/app_list/app_list_syncable_service.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 ExtensionFunction::ResponseAction LauncherPageHideFunction::Run() { 66 ExtensionFunction::ResponseAction LauncherPageHideFunction::Run() {
67 AppListService::Get()->HideCustomLauncherPage(); 67 AppListService::Get()->HideCustomLauncherPage();
68 68
69 return RespondNow(NoArguments()); 69 return RespondNow(NoArguments());
70 } 70 }
71 71
72 LauncherPageSetEnabledFunction::LauncherPageSetEnabledFunction() { 72 LauncherPageSetEnabledFunction::LauncherPageSetEnabledFunction() {
73 } 73 }
74 74
75 ExtensionFunction::ResponseAction LauncherPageSetEnabledFunction::Run() { 75 ExtensionFunction::ResponseAction LauncherPageSetEnabledFunction::Run() {
76 scoped_ptr<api::launcher_page::SetEnabled::Params> params( 76 std::unique_ptr<api::launcher_page::SetEnabled::Params> params(
77 api::launcher_page::SetEnabled::Params::Create(*args_)); 77 api::launcher_page::SetEnabled::Params::Create(*args_));
78 EXTENSION_FUNCTION_VALIDATE(params.get()); 78 EXTENSION_FUNCTION_VALIDATE(params.get());
79 79
80 app_list::AppListSyncableService* service = 80 app_list::AppListSyncableService* service =
81 LauncherPageAPI::GetFactoryInstance() 81 LauncherPageAPI::GetFactoryInstance()
82 ->Get(browser_context()) 82 ->Get(browser_context())
83 ->GetService(); 83 ->GetService();
84 app_list::AppListModel* model = service->GetModel(); 84 app_list::AppListModel* model = service->GetModel();
85 model->SetCustomLauncherPageEnabled(params->enabled); 85 model->SetCustomLauncherPageEnabled(params->enabled);
86 86
87 return RespondNow(NoArguments()); 87 return RespondNow(NoArguments());
88 } 88 }
89 89
90 } // namespace extensions 90 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698