OLD | NEW |
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 "chrome/browser/profiles/avatar_menu_model.h" | 5 #include "chrome/browser/profiles/avatar_menu_model.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 namespace { | 29 namespace { |
30 | 30 |
31 void OnProfileCreated(bool always_create, | 31 void OnProfileCreated(bool always_create, |
32 Profile* profile, | 32 Profile* profile, |
33 Profile::CreateStatus status) { | 33 Profile::CreateStatus status) { |
34 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 34 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
35 | 35 |
36 if (status == Profile::CREATE_STATUS_INITIALIZED) { | 36 if (status == Profile::CREATE_STATUS_INITIALIZED) { |
37 ProfileManager::FindOrCreateNewWindowForProfile( | 37 ProfileManager::FindOrCreateNewWindowForProfile( |
38 profile, | 38 profile, |
39 browser::startup::IS_NOT_PROCESS_STARTUP, | 39 StartupBrowserCreator::IS_NOT_PROCESS_STARTUP, |
40 browser::startup::IS_NOT_FIRST_RUN, | 40 StartupBrowserCreator::IS_NOT_FIRST_RUN, |
41 always_create); | 41 always_create); |
42 } | 42 } |
43 } | 43 } |
44 | 44 |
45 } // namespace | 45 } // namespace |
46 | 46 |
47 AvatarMenuModel::AvatarMenuModel(ProfileInfoInterface* profile_cache, | 47 AvatarMenuModel::AvatarMenuModel(ProfileInfoInterface* profile_cache, |
48 AvatarMenuModelObserver* observer, | 48 AvatarMenuModelObserver* observer, |
49 Browser* browser) | 49 Browser* browser) |
50 : profile_info_(profile_cache), | 50 : profile_info_(profile_cache), |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 item->active = browser_->profile()->GetPath() == path; | 170 item->active = browser_->profile()->GetPath() == path; |
171 } | 171 } |
172 items_.push_back(item); | 172 items_.push_back(item); |
173 } | 173 } |
174 } | 174 } |
175 | 175 |
176 void AvatarMenuModel::ClearMenu() { | 176 void AvatarMenuModel::ClearMenu() { |
177 STLDeleteContainerPointers(items_.begin(), items_.end()); | 177 STLDeleteContainerPointers(items_.begin(), items_.end()); |
178 items_.clear(); | 178 items_.clear(); |
179 } | 179 } |
OLD | NEW |