1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/ui/webui/app_list/start_page_ui.h"
7 #include "base/files/file_path.h"
8 #include "base/files/file_util.h"
9 #include "base/memory/ref_counted_memory.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "base/sys_info.h"
12 #include "chrome/browser/extensions/extension_service.h"
13 #include "chrome/browser/profiles/profile.h"
14 #include "chrome/browser/ui/webui/app_list/start_page_handler.h"
15 #include "chrome/common/extensions/extension_constants.h"
16 #include "chrome/common/url_constants.h"
17 #include "content/public/browser/browser_thread.h"
18 #include "content/public/browser/web_ui.h"
19 #include "content/public/browser/web_ui_data_source.h"
20 #include "extensions/browser/extension_system.h"
21 #include "extensions/common/extension.h"
22 #include "grit/browser_resources.h"
26 StartPageUI::StartPageUI(content::WebUI
* web_ui
)
27 : content::WebUIController(web_ui
) {
28 web_ui
->AddMessageHandler(new StartPageHandler
);
32 StartPageUI::~StartPageUI() {}
34 void StartPageUI::InitDataSource() {
35 scoped_ptr
<content::WebUIDataSource
> source(
36 content::WebUIDataSource::Create(chrome::kChromeUIAppListStartPageHost
));
38 source
->SetJsonPath("strings.js");
40 source
->AddResourcePath("start_page.css", IDR_APP_LIST_START_PAGE_CSS
);
41 source
->AddResourcePath("start_page.js", IDR_APP_LIST_START_PAGE_JS
);
42 source
->SetDefaultResource(IDR_APP_LIST_START_PAGE_HTML
);
44 content::WebUIDataSource::Add(Profile::FromWebUI(web_ui()), source
.release());
47 } // namespace app_list