| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 void StartPageUI::InitDataSource() { | 76 void StartPageUI::InitDataSource() { |
| 77 scoped_ptr<content::WebUIDataSource> source( | 77 scoped_ptr<content::WebUIDataSource> source( |
| 78 content::WebUIDataSource::Create(chrome::kChromeUIAppListStartPageHost)); | 78 content::WebUIDataSource::Create(chrome::kChromeUIAppListStartPageHost)); |
| 79 | 79 |
| 80 source->SetUseJsonJSFormatV2(); | 80 source->SetUseJsonJSFormatV2(); |
| 81 source->SetJsonPath("strings.js"); | 81 source->SetJsonPath("strings.js"); |
| 82 | 82 |
| 83 source->AddResourcePath("start_page.css", IDR_APP_LIST_START_PAGE_CSS); | 83 source->AddResourcePath("start_page.css", IDR_APP_LIST_START_PAGE_CSS); |
| 84 source->AddResourcePath("start_page.js", IDR_APP_LIST_START_PAGE_JS); | 84 source->AddResourcePath("start_page.js", IDR_APP_LIST_START_PAGE_JS); |
| 85 source->AddResourcePath("hotword_nacl.nmf", IDR_APP_LIST_HOTWORD_NACL_NMF); | 85 source->AddResourcePath("hotword_nacl.nmf", IDR_APP_LIST_HOTWORD_NACL_NMF); |
| 86 source->AddResourcePath("images/2x/google_logo.png", |
| 87 IDR_LOCAL_NTP_IMAGES_2X_LOGO_PNG); |
| 86 source->SetDefaultResource(IDR_APP_LIST_START_PAGE_HTML); | 88 source->SetDefaultResource(IDR_APP_LIST_START_PAGE_HTML); |
| 87 | 89 |
| 88 #if defined(OS_CHROMEOS) | 90 #if defined(OS_CHROMEOS) |
| 89 source->OverrideContentSecurityPolicyObjectSrc("object-src 'self' data:;"); | 91 source->OverrideContentSecurityPolicyObjectSrc("object-src 'self' data:;"); |
| 90 if (base::SysInfo::IsRunningOnChromeOS()) | 92 if (base::SysInfo::IsRunningOnChromeOS()) |
| 91 source->SetRequestFilter(base::Bind(&HandleHotwordFilesResourceFilter)); | 93 source->SetRequestFilter(base::Bind(&HandleHotwordFilesResourceFilter)); |
| 92 #endif | 94 #endif |
| 93 | 95 |
| 94 content::WebUIDataSource::Add(Profile::FromWebUI(web_ui()), source.release()); | 96 content::WebUIDataSource::Add(Profile::FromWebUI(web_ui()), source.release()); |
| 95 } | 97 } |
| 96 | 98 |
| 97 } // namespace app_list | 99 } // namespace app_list |
| OLD | NEW |