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.h" | 5 #include "chrome/browser/profiles/avatar_menu.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/i18n/case_conversion.h" | 8 #include "base/i18n/case_conversion.h" |
9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
10 #include "base/profiler/scoped_tracker.h" | 10 #include "base/profiler/scoped_tracker.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 size_t profile_index, | 80 size_t profile_index, |
81 const gfx::Image& icon) | 81 const gfx::Image& icon) |
82 : icon(icon), | 82 : icon(icon), |
83 active(false), | 83 active(false), |
84 signed_in(false), | 84 signed_in(false), |
85 signin_required(false), | 85 signin_required(false), |
86 menu_index(menu_index), | 86 menu_index(menu_index), |
87 profile_index(profile_index) { | 87 profile_index(profile_index) { |
88 } | 88 } |
89 | 89 |
| 90 AvatarMenu::Item::Item(const Item& other) = default; |
| 91 |
90 AvatarMenu::Item::~Item() { | 92 AvatarMenu::Item::~Item() { |
91 } | 93 } |
92 | 94 |
93 // static | 95 // static |
94 bool AvatarMenu::ShouldShowAvatarMenu() { | 96 bool AvatarMenu::ShouldShowAvatarMenu() { |
95 // TODO: Eliminate this ifdef. Add a delegate interface for the menu which | 97 // TODO: Eliminate this ifdef. Add a delegate interface for the menu which |
96 // would also help remove the Browser dependency in AvatarMenuActions | 98 // would also help remove the Browser dependency in AvatarMenuActions |
97 // implementations. | 99 // implementations. |
98 #if defined(OS_CHROMEOS) | 100 #if defined(OS_CHROMEOS) |
99 // On ChromeOS the menu will not be shown. | 101 // On ChromeOS the menu will not be shown. |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 if (observer_) | 272 if (observer_) |
271 observer_->OnAvatarMenuChanged(this); | 273 observer_->OnAvatarMenuChanged(this); |
272 } | 274 } |
273 #endif | 275 #endif |
274 | 276 |
275 void AvatarMenu::Update() { | 277 void AvatarMenu::Update() { |
276 RebuildMenu(); | 278 RebuildMenu(); |
277 if (observer_) | 279 if (observer_) |
278 observer_->OnAvatarMenuChanged(this); | 280 observer_->OnAvatarMenuChanged(this); |
279 } | 281 } |
OLD | NEW |