| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |