OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/ui/views/profiles/profile_chooser_view.h" | 5 #include "chrome/browser/ui/views/profiles/profile_chooser_view.h" |
6 | 6 |
7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/lifetime/application_lifetime.h" | 10 #include "chrome/browser/lifetime/application_lifetime.h" |
(...skipping 1109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1120 gfx::Rect(x_offset, 0, kLargeImageSide, kLargeImageSide)); | 1120 gfx::Rect(x_offset, 0, kLargeImageSide, kLargeImageSide)); |
1121 SizedContainer* profile_icon_container = | 1121 SizedContainer* profile_icon_container = |
1122 new SizedContainer(gfx::Size(column_width, kLargeImageSide)); | 1122 new SizedContainer(gfx::Size(column_width, kLargeImageSide)); |
1123 profile_icon_container->AddChildView(current_profile_photo_); | 1123 profile_icon_container->AddChildView(current_profile_photo_); |
1124 | 1124 |
1125 ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); | 1125 ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); |
1126 if (browser_->profile()->IsSupervised()) { | 1126 if (browser_->profile()->IsSupervised()) { |
1127 views::ImageView* supervised_icon = new views::ImageView(); | 1127 views::ImageView* supervised_icon = new views::ImageView(); |
1128 int image_id = browser_->profile()->IsChild() | 1128 int image_id = browser_->profile()->IsChild() |
1129 ? IDR_ICON_PROFILES_MENU_CHILD | 1129 ? IDR_ICON_PROFILES_MENU_CHILD |
1130 : IDR_ICON_PROFILES_MENU_SUPERVISED; | 1130 : IDR_ICON_PROFILES_MENU_LEGACY_SUPERVISED; |
1131 supervised_icon->SetImage(rb->GetImageSkiaNamed(image_id)); | 1131 supervised_icon->SetImage(rb->GetImageSkiaNamed(image_id)); |
1132 gfx::Size preferred_size = supervised_icon->GetPreferredSize(); | 1132 gfx::Size preferred_size = supervised_icon->GetPreferredSize(); |
1133 gfx::Rect parent_bounds = current_profile_photo_->bounds(); | 1133 gfx::Rect parent_bounds = current_profile_photo_->bounds(); |
1134 supervised_icon->SetBounds( | 1134 supervised_icon->SetBounds( |
1135 parent_bounds.right() - preferred_size.width(), | 1135 parent_bounds.right() - preferred_size.width(), |
1136 parent_bounds.bottom() - preferred_size.height(), | 1136 parent_bounds.bottom() - preferred_size.height(), |
1137 preferred_size.width(), | 1137 preferred_size.width(), |
1138 preferred_size.height()); | 1138 preferred_size.height()); |
1139 profile_icon_container->AddChildView(supervised_icon); | 1139 profile_icon_container->AddChildView(supervised_icon); |
1140 } | 1140 } |
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1667 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 1667 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != |
1668 IncognitoModePrefs::DISABLED; | 1668 IncognitoModePrefs::DISABLED; |
1669 return incognito_available && !browser_->profile()->IsGuestSession(); | 1669 return incognito_available && !browser_->profile()->IsGuestSession(); |
1670 } | 1670 } |
1671 | 1671 |
1672 void ProfileChooserView::PostActionPerformed( | 1672 void ProfileChooserView::PostActionPerformed( |
1673 ProfileMetrics::ProfileDesktopMenu action_performed) { | 1673 ProfileMetrics::ProfileDesktopMenu action_performed) { |
1674 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); | 1674 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); |
1675 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; | 1675 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; |
1676 } | 1676 } |
OLD | NEW |