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

Side by Side Diff: ui/app_list/test/app_list_test_view_delegate.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 | « ui/app_list/speech_ui_model.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "ui/app_list/test/app_list_test_view_delegate.h" 5 #include "ui/app_list/test/app_list_test_view_delegate.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/files/file_path.h" 11 #include "base/files/file_path.h"
12 #include "ui/app_list/app_list_model.h" 12 #include "ui/app_list/app_list_model.h"
13 #include "ui/app_list/app_list_switches.h" 13 #include "ui/app_list/app_list_switches.h"
14 #include "ui/app_list/app_list_view_delegate_observer.h" 14 #include "ui/app_list/app_list_view_delegate_observer.h"
15 #include "ui/app_list/test/app_list_test_model.h" 15 #include "ui/app_list/test/app_list_test_model.h"
16 #include "ui/gfx/image/image_skia.h" 16 #include "ui/gfx/image/image_skia.h"
17 17
18 namespace app_list { 18 namespace app_list {
19 namespace test { 19 namespace test {
20 20
21 AppListTestViewDelegate::AppListTestViewDelegate() 21 AppListTestViewDelegate::AppListTestViewDelegate()
22 : dismiss_count_(0), 22 : dismiss_count_(0),
23 toggle_speech_recognition_count_(0), 23 toggle_speech_recognition_count_(0),
24 open_search_result_count_(0), 24 open_search_result_count_(0),
25 next_profile_app_count_(0), 25 next_profile_app_count_(0),
26 model_(new AppListTestModel), 26 model_(new AppListTestModel) {
27 speech_ui_(SPEECH_RECOGNITION_OFF) {
28 model_->SetFoldersEnabled(true); 27 model_->SetFoldersEnabled(true);
29 } 28 }
30 29
31 AppListTestViewDelegate::~AppListTestViewDelegate() {} 30 AppListTestViewDelegate::~AppListTestViewDelegate() {}
32 31
33 int AppListTestViewDelegate::GetToggleSpeechRecognitionCountAndReset() { 32 int AppListTestViewDelegate::GetToggleSpeechRecognitionCountAndReset() {
34 int count = toggle_speech_recognition_count_; 33 int count = toggle_speech_recognition_count_;
35 toggle_speech_recognition_count_ = 0; 34 toggle_speech_recognition_count_ = 0;
36 return count; 35 return count;
37 } 36 }
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 observers_.AddObserver(observer); 124 observers_.AddObserver(observer);
126 } 125 }
127 126
128 void AppListTestViewDelegate::RemoveObserver( 127 void AppListTestViewDelegate::RemoveObserver(
129 AppListViewDelegateObserver* observer) { 128 AppListViewDelegateObserver* observer) {
130 observers_.RemoveObserver(observer); 129 observers_.RemoveObserver(observer);
131 } 130 }
132 131
133 } // namespace test 132 } // namespace test
134 } // namespace app_list 133 } // namespace app_list
OLDNEW
« no previous file with comments | « ui/app_list/speech_ui_model.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698