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

Side by Side Diff: ash/shell/app_list.cc

Issue 550883002: Fix SpeechUIModel lifetime issue in Chrome's AppListViewDelegate when switching profiles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clear state for SetProfile(NULL) Created 6 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | athena/home/app_list_view_delegate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <string> 5 #include <string>
6 #include <vector> 6 #include <vector>
7 7
8 #include "ash/session/session_state_delegate.h" 8 #include "ash/session/session_state_delegate.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/shell/example_factory.h" 10 #include "ash/shell/example_factory.h"
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 190
191 private: 191 private:
192 WindowTypeShelfItem::Type type_; 192 WindowTypeShelfItem::Type type_;
193 193
194 DISALLOW_COPY_AND_ASSIGN(ExampleSearchResult); 194 DISALLOW_COPY_AND_ASSIGN(ExampleSearchResult);
195 }; 195 };
196 196
197 class ExampleAppListViewDelegate : public app_list::AppListViewDelegate { 197 class ExampleAppListViewDelegate : public app_list::AppListViewDelegate {
198 public: 198 public:
199 ExampleAppListViewDelegate() 199 ExampleAppListViewDelegate()
200 : model_(new app_list::AppListModel), 200 : model_(new app_list::AppListModel) {
201 speech_ui_(app_list::SPEECH_RECOGNITION_OFF) {
202 PopulateApps(); 201 PopulateApps();
203 DecorateSearchBox(model_->search_box()); 202 DecorateSearchBox(model_->search_box());
204 } 203 }
205 204
206 private: 205 private:
207 void PopulateApps() { 206 void PopulateApps() {
208 for (int i = 0; i < static_cast<int>(WindowTypeShelfItem::LAST_TYPE); ++i) { 207 for (int i = 0; i < static_cast<int>(WindowTypeShelfItem::LAST_TYPE); ++i) {
209 WindowTypeShelfItem::Type type = 208 WindowTypeShelfItem::Type type =
210 static_cast<WindowTypeShelfItem::Type>(i); 209 static_cast<WindowTypeShelfItem::Type>(i);
211 std::string id = base::StringPrintf("%d", i); 210 std::string id = base::StringPrintf("%d", i);
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 }; 369 };
371 370
372 } // namespace 371 } // namespace
373 372
374 app_list::AppListViewDelegate* CreateAppListViewDelegate() { 373 app_list::AppListViewDelegate* CreateAppListViewDelegate() {
375 return new ExampleAppListViewDelegate; 374 return new ExampleAppListViewDelegate;
376 } 375 }
377 376
378 } // namespace shell 377 } // namespace shell
379 } // namespace ash 378 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | athena/home/app_list_view_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698