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

Side by Side Diff: chrome/browser/extensions/api/launcher_page/launcher_page_api.cc

Issue 981893002: Lazily build the app list model. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix_set_enabled
Patch Set: revert ALSL Created 5 years, 9 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
« no previous file with comments | « no previous file | chrome/browser/sync/test/integration/sync_app_list_helper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 26 matching lines...) Expand all
37 } 37 }
38 38
39 LauncherPagePushSubpageFunction::LauncherPagePushSubpageFunction() { 39 LauncherPagePushSubpageFunction::LauncherPagePushSubpageFunction() {
40 } 40 }
41 41
42 ExtensionFunction::ResponseAction LauncherPagePushSubpageFunction::Run() { 42 ExtensionFunction::ResponseAction LauncherPagePushSubpageFunction::Run() {
43 app_list::AppListSyncableService* service = 43 app_list::AppListSyncableService* service =
44 LauncherPageAPI::GetFactoryInstance() 44 LauncherPageAPI::GetFactoryInstance()
45 ->Get(browser_context()) 45 ->Get(browser_context())
46 ->GetService(); 46 ->GetService();
47 app_list::AppListModel* model = service->model(); 47 app_list::AppListModel* model = service->GetModel();
48 model->PushCustomLauncherPageSubpage(); 48 model->PushCustomLauncherPageSubpage();
49 49
50 return RespondNow(NoArguments()); 50 return RespondNow(NoArguments());
51 } 51 }
52 52
53 LauncherPageShowFunction::LauncherPageShowFunction() { 53 LauncherPageShowFunction::LauncherPageShowFunction() {
54 } 54 }
55 55
56 ExtensionFunction::ResponseAction LauncherPageShowFunction::Run() { 56 ExtensionFunction::ResponseAction LauncherPageShowFunction::Run() {
57 chrome::HostDesktopType host_desktop = 57 chrome::HostDesktopType host_desktop =
(...skipping 12 matching lines...) Expand all
70 70
71 ExtensionFunction::ResponseAction LauncherPageSetEnabledFunction::Run() { 71 ExtensionFunction::ResponseAction LauncherPageSetEnabledFunction::Run() {
72 scoped_ptr<api::launcher_page::SetEnabled::Params> params( 72 scoped_ptr<api::launcher_page::SetEnabled::Params> params(
73 api::launcher_page::SetEnabled::Params::Create(*args_)); 73 api::launcher_page::SetEnabled::Params::Create(*args_));
74 EXTENSION_FUNCTION_VALIDATE(params.get()); 74 EXTENSION_FUNCTION_VALIDATE(params.get());
75 75
76 app_list::AppListSyncableService* service = 76 app_list::AppListSyncableService* service =
77 LauncherPageAPI::GetFactoryInstance() 77 LauncherPageAPI::GetFactoryInstance()
78 ->Get(browser_context()) 78 ->Get(browser_context())
79 ->GetService(); 79 ->GetService();
80 app_list::AppListModel* model = service->model(); 80 app_list::AppListModel* model = service->GetModel();
81 model->SetCustomLauncherPageEnabled(params->enabled); 81 model->SetCustomLauncherPageEnabled(params->enabled);
82 82
83 return RespondNow(NoArguments()); 83 return RespondNow(NoArguments());
84 } 84 }
85 85
86 } // namespace extensions 86 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync/test/integration/sync_app_list_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698