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

Unified Diff: chrome/browser/ui/webui/app_list/start_page_ui.cc

Issue 992173002: Delete the old hotwording integration. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@hotword-remove-disable-option
Patch Set: Rebase. 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/app_list/start_page_ui.cc
diff --git a/chrome/browser/ui/webui/app_list/start_page_ui.cc b/chrome/browser/ui/webui/app_list/start_page_ui.cc
index 40f1e1e9949ba2b85071210d2ee1a29399dd5320..2695981f97aede1026d50d99821cdbdd84a9d96f 100644
--- a/chrome/browser/ui/webui/app_list/start_page_ui.cc
+++ b/chrome/browser/ui/webui/app_list/start_page_ui.cc
@@ -22,48 +22,6 @@
#include "grit/browser_resources.h"
namespace app_list {
-namespace {
-#if defined(OS_CHROMEOS)
-const char* kHotwordFilePrefixes[] = {
- "hotword_",
- "_platform_specific/",
-};
-
-void LoadModelData(const base::FilePath& base_dir,
- const std::string& path,
- const content::WebUIDataSource::GotDataCallback& callback) {
- DCHECK_CURRENTLY_ON(content::BrowserThread::FILE);
- // Will be owned by |callback|.
- scoped_refptr<base::RefCountedString> data(new base::RefCountedString());
- base::ReadFileToString(base_dir.AppendASCII(path), &(data->data()));
- callback.Run(data.get());
-}
-
-bool HandleHotwordFilesResourceFilter(
- Profile* profile,
- const std::string& path,
- const content::WebUIDataSource::GotDataCallback& callback) {
- ExtensionService* service =
- extensions::ExtensionSystem::Get(profile)->extension_service();
- const extensions::Extension* extension =
- service->GetExtensionById(extension_misc::kHotwordExtensionId, false);
- if (!extension)
- return false;
-
- for (size_t i = 0; i < arraysize(kHotwordFilePrefixes); ++i) {
- if (path.find(kHotwordFilePrefixes[i]) == 0) {
- content::BrowserThread::PostTask(
- content::BrowserThread::FILE,
- FROM_HERE,
- base::Bind(&LoadModelData, extension->path(), path, callback));
- return true;
- }
- }
-
- return false;
-}
-#endif // OS_CHROMEOS
-} // namespace
StartPageUI::StartPageUI(content::WebUI* web_ui)
: content::WebUIController(web_ui) {
@@ -81,16 +39,8 @@ void StartPageUI::InitDataSource() {
source->AddResourcePath("start_page.css", IDR_APP_LIST_START_PAGE_CSS);
source->AddResourcePath("start_page.js", IDR_APP_LIST_START_PAGE_JS);
- source->AddResourcePath("hotword_nacl.nmf", IDR_APP_LIST_HOTWORD_NACL_NMF);
source->SetDefaultResource(IDR_APP_LIST_START_PAGE_HTML);
-#if defined(OS_CHROMEOS)
- source->OverrideContentSecurityPolicyObjectSrc("object-src 'self' data:;");
- if (base::SysInfo::IsRunningOnChromeOS())
- source->SetRequestFilter(base::Bind(&HandleHotwordFilesResourceFilter,
- Profile::FromWebUI(web_ui())));
-#endif
-
content::WebUIDataSource::Add(Profile::FromWebUI(web_ui()), source.release());
}
« no previous file with comments | « chrome/browser/ui/webui/app_list/start_page_handler.cc ('k') | chrome/browser/ui/webui/options/browser_options_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698