| 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/app_list/start_page_service.h" | 5 #include "chrome/browser/ui/app_list/start_page_service.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 void StartPageService::LoadContentsIfNeeded() { | 345 void StartPageService::LoadContentsIfNeeded() { |
| 346 if (!contents_) | 346 if (!contents_) |
| 347 LoadContents(); | 347 LoadContents(); |
| 348 } | 348 } |
| 349 | 349 |
| 350 void StartPageService::AppListShown() { | 350 void StartPageService::AppListShown() { |
| 351 if (!contents_) { | 351 if (!contents_) { |
| 352 LoadContents(); | 352 LoadContents(); |
| 353 } else if (contents_->IsCrashed()) { | 353 } else if (contents_->IsCrashed()) { |
| 354 LoadStartPageURL(); | 354 LoadStartPageURL(); |
| 355 } else if (contents_->GetWebUI() && | 355 } else if (contents_->GetWebUI()) { |
| 356 !HotwordService::IsExperimentalHotwordingEnabled()) { | 356 // If experimental hotwording is enabled, don't initialize the web speech |
| 357 // If experimental hotwording is enabled, don't call onAppListShown. | 357 // API, which is not used with |
| 358 // onAppListShown() initializes the web speech API, which is not used with | |
| 359 // experimental hotwording. | 358 // experimental hotwording. |
| 360 contents_->GetWebUI()->CallJavascriptFunction( | 359 contents_->GetWebUI()->CallJavascriptFunction( |
| 361 "appList.startPage.onAppListShown", | 360 "appList.startPage.onAppListShown", |
| 362 base::FundamentalValue(HotwordEnabled())); | 361 base::FundamentalValue(HotwordEnabled()), |
| 362 base::FundamentalValue( |
| 363 !HotwordService::IsExperimentalHotwordingEnabled())); |
| 363 } | 364 } |
| 364 | 365 |
| 365 #if defined(OS_CHROMEOS) | 366 #if defined(OS_CHROMEOS) |
| 366 audio_status_.reset(new AudioStatus(this)); | 367 audio_status_.reset(new AudioStatus(this)); |
| 367 #endif | 368 #endif |
| 368 } | 369 } |
| 369 | 370 |
| 370 void StartPageService::AppListHidden() { | 371 void StartPageService::AppListHidden() { |
| 371 if (contents_->GetWebUI()) { | 372 if (contents_->GetWebUI()) { |
| 372 contents_->GetWebUI()->CallJavascriptFunction( | 373 contents_->GetWebUI()->CallJavascriptFunction( |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 663 | 664 |
| 664 // Check for a new doodle. | 665 // Check for a new doodle. |
| 665 content::BrowserThread::PostDelayedTask( | 666 content::BrowserThread::PostDelayedTask( |
| 666 content::BrowserThread::UI, FROM_HERE, | 667 content::BrowserThread::UI, FROM_HERE, |
| 667 base::Bind(&StartPageService::FetchDoodleJson, | 668 base::Bind(&StartPageService::FetchDoodleJson, |
| 668 weak_factory_.GetWeakPtr()), | 669 weak_factory_.GetWeakPtr()), |
| 669 recheck_delay); | 670 recheck_delay); |
| 670 } | 671 } |
| 671 | 672 |
| 672 } // namespace app_list | 673 } // namespace app_list |
| OLD | NEW |