OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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/webui/app_list/start_page_ui.h" | 5 #include "chrome/browser/ui/webui/app_list/start_page_ui.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/memory/ref_counted_memory.h" | 9 #include "base/memory/ref_counted_memory.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 void StartPageUI::InitDataSource() { | 79 void StartPageUI::InitDataSource() { |
80 scoped_ptr<content::WebUIDataSource> source( | 80 scoped_ptr<content::WebUIDataSource> source( |
81 content::WebUIDataSource::Create(chrome::kChromeUIAppListStartPageHost)); | 81 content::WebUIDataSource::Create(chrome::kChromeUIAppListStartPageHost)); |
82 | 82 |
83 source->SetUseJsonJSFormatV2(); | 83 source->SetUseJsonJSFormatV2(); |
84 source->SetJsonPath("strings.js"); | 84 source->SetJsonPath("strings.js"); |
85 | 85 |
86 source->AddResourcePath("start_page.css", IDR_APP_LIST_START_PAGE_CSS); | 86 source->AddResourcePath("start_page.css", IDR_APP_LIST_START_PAGE_CSS); |
87 source->AddResourcePath("start_page.js", IDR_APP_LIST_START_PAGE_JS); | 87 source->AddResourcePath("start_page.js", IDR_APP_LIST_START_PAGE_JS); |
88 source->AddResourcePath("hotword_nacl.nmf", IDR_APP_LIST_HOTWORD_NACL_NMF); | 88 source->AddResourcePath("hotword_nacl.nmf", IDR_APP_LIST_HOTWORD_NACL_NMF); |
| 89 source->AddResourcePath("images/2x/google_logo.png", |
| 90 IDR_LOCAL_NTP_IMAGES_2X_LOGO_PNG); |
89 source->SetDefaultResource(IDR_APP_LIST_START_PAGE_HTML); | 91 source->SetDefaultResource(IDR_APP_LIST_START_PAGE_HTML); |
90 | 92 |
91 #if defined(OS_CHROMEOS) | 93 #if defined(OS_CHROMEOS) |
92 source->OverrideContentSecurityPolicyObjectSrc("object-src 'self' data:;"); | 94 source->OverrideContentSecurityPolicyObjectSrc("object-src 'self' data:;"); |
93 if (base::SysInfo::IsRunningOnChromeOS()) | 95 if (base::SysInfo::IsRunningOnChromeOS()) |
94 source->SetRequestFilter(base::Bind(&HandleHotwordFilesResourceFilter, | 96 source->SetRequestFilter(base::Bind(&HandleHotwordFilesResourceFilter, |
95 Profile::FromWebUI(web_ui()))); | 97 Profile::FromWebUI(web_ui()))); |
96 #endif | 98 #endif |
97 | 99 |
98 content::WebUIDataSource::Add(Profile::FromWebUI(web_ui()), source.release()); | 100 content::WebUIDataSource::Add(Profile::FromWebUI(web_ui()), source.release()); |
99 } | 101 } |
100 | 102 |
101 } // namespace app_list | 103 } // namespace app_list |
OLD | NEW |