| 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 19 matching lines...) Expand all Loading... |
| 30 namespace { | 30 namespace { |
| 31 | 31 |
| 32 void OnProfileCreated(bool always_create, | 32 void OnProfileCreated(bool always_create, |
| 33 Profile* profile, | 33 Profile* profile, |
| 34 Profile::CreateStatus status) { | 34 Profile::CreateStatus status) { |
| 35 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 35 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 36 | 36 |
| 37 if (status == Profile::CREATE_STATUS_INITIALIZED) { | 37 if (status == Profile::CREATE_STATUS_INITIALIZED) { |
| 38 ProfileManager::FindOrCreateNewWindowForProfile( | 38 ProfileManager::FindOrCreateNewWindowForProfile( |
| 39 profile, | 39 profile, |
| 40 browser::startup::IS_NOT_PROCESS_STARTUP, | 40 chrome::startup::IS_NOT_PROCESS_STARTUP, |
| 41 browser::startup::IS_NOT_FIRST_RUN, | 41 chrome::startup::IS_NOT_FIRST_RUN, |
| 42 always_create); | 42 always_create); |
| 43 } | 43 } |
| 44 } | 44 } |
| 45 | 45 |
| 46 } // namespace | 46 } // namespace |
| 47 | 47 |
| 48 AvatarMenuModel::AvatarMenuModel(ProfileInfoInterface* profile_cache, | 48 AvatarMenuModel::AvatarMenuModel(ProfileInfoInterface* profile_cache, |
| 49 AvatarMenuModelObserver* observer, | 49 AvatarMenuModelObserver* observer, |
| 50 Browser* browser) | 50 Browser* browser) |
| 51 : profile_info_(profile_cache), | 51 : profile_info_(profile_cache), |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 item->active = browser_->profile()->GetPath() == path; | 172 item->active = browser_->profile()->GetPath() == path; |
| 173 } | 173 } |
| 174 items_.push_back(item); | 174 items_.push_back(item); |
| 175 } | 175 } |
| 176 } | 176 } |
| 177 | 177 |
| 178 void AvatarMenuModel::ClearMenu() { | 178 void AvatarMenuModel::ClearMenu() { |
| 179 STLDeleteContainerPointers(items_.begin(), items_.end()); | 179 STLDeleteContainerPointers(items_.begin(), items_.end()); |
| 180 items_.clear(); | 180 items_.clear(); |
| 181 } | 181 } |
| OLD | NEW |