summaryrefslogtreecommitdiffstats
path: root/ash/shell
diff options
context:
space:
mode:
authortapted <tapted@chromium.org>2014-09-08 23:49:40 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-09 06:59:37 +0000
commit966607ad9fc89b31dfc991ab65ba941132e2d2bf (patch)
tree386dd74098b9cd781fd2330088f8ed03c92c5299 /ash/shell
parentb7eac8ac9889cced43322b75c969dd5c49869569 (diff)
downloadchromium_src-966607ad9fc89b31dfc991ab65ba941132e2d2bf.zip
chromium_src-966607ad9fc89b31dfc991ab65ba941132e2d2bf.tar.gz
chromium_src-966607ad9fc89b31dfc991ab65ba941132e2d2bf.tar.bz2
Fix SpeechUIModel lifetime issue in Chrome's AppListViewDelegate when switching profiles
The AppListView observes the SpeechUIModel directly, so SpeechUIModel must outlive profile changes within Chrome's AppListViewDelegate. Profile changes only recreate the app_list::ContentView and subviews, which updates app_list::AppListModel observers, but not app_list::SpeechUIModel observers. This comes up when switching profiles in the desktop app list. To fix, this change gives SpeechUIModel a default constructor to simplify setting the initial speech recognition state, which needs the profile. Then, decouples the lifetime of the SpeechUIModel from the Profile in Chrome's AppListViewDelegate. BUG=405827 TBR=jamescook@chromium.org Review URL: https://codereview.chromium.org/550883002 Cr-Commit-Position: refs/heads/master@{#293878}
Diffstat (limited to 'ash/shell')
-rw-r--r--ash/shell/app_list.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/ash/shell/app_list.cc b/ash/shell/app_list.cc
index bf5a44b..1c00f2b 100644
--- a/ash/shell/app_list.cc
+++ b/ash/shell/app_list.cc
@@ -197,8 +197,7 @@ class ExampleSearchResult : public app_list::SearchResult {
class ExampleAppListViewDelegate : public app_list::AppListViewDelegate {
public:
ExampleAppListViewDelegate()
- : model_(new app_list::AppListModel),
- speech_ui_(app_list::SPEECH_RECOGNITION_OFF) {
+ : model_(new app_list::AppListModel) {
PopulateApps();
DecorateSearchBox(model_->search_box());
}