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

Unified Diff: chrome/browser/ui/app_list/start_page_service.cc

Issue 657173002: Guard against the app launcher having a custom start page URL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/app_list/start_page_service.cc
diff --git a/chrome/browser/ui/app_list/start_page_service.cc b/chrome/browser/ui/app_list/start_page_service.cc
index 43d2a2f9566000ac0775912f41c66432a4a98209..22f806f7dcbc93fcbef1cfade111b7a2650078e0 100644
--- a/chrome/browser/ui/app_list/start_page_service.cc
+++ b/chrome/browser/ui/app_list/start_page_service.cc
@@ -137,7 +137,7 @@ void StartPageService::RemoveObserver(StartPageObserver* observer) {
void StartPageService::AppListShown() {
if (!contents_) {
LoadContents();
- } else {
+ } else if (contents_->GetWebUI()) {
// If experimental hotwording is enabled, don't enable hotwording in the
// start page, since the hotword extension is taking care of this.
bool hotword_enabled = HotwordEnabled() &&
@@ -149,8 +149,10 @@ void StartPageService::AppListShown() {
}
void StartPageService::AppListHidden() {
- contents_->GetWebUI()->CallJavascriptFunction(
- "appList.startPage.onAppListHidden");
+ if (contents_->GetWebUI()) {
+ contents_->GetWebUI()->CallJavascriptFunction(
+ "appList.startPage.onAppListHidden");
+ }
if (!app_list::switches::IsExperimentalAppListEnabled())
UnloadContents();
}
@@ -158,6 +160,9 @@ void StartPageService::AppListHidden() {
void StartPageService::ToggleSpeechRecognition() {
DCHECK(contents_);
speech_button_toggled_manually_ = true;
+ if (!contents_->GetWebUI())
+ return;
+
if (webui_finished_loading_) {
contents_->GetWebUI()->CallJavascriptFunction(
"appList.startPage.toggleSpeechRecognition");
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698