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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 BackgroundColorHoverButton(views::ButtonListener* listener, | 134 BackgroundColorHoverButton(views::ButtonListener* listener, |
135 const base::string16& text, | 135 const base::string16& text, |
136 const gfx::ImageSkia& icon) | 136 const gfx::ImageSkia& icon) |
137 : views::LabelButton(listener, text) { | 137 : views::LabelButton(listener, text) { |
138 SetImageLabelSpacing(views::kItemLabelSpacing); | 138 SetImageLabelSpacing(views::kItemLabelSpacing); |
139 SetBorder(views::Border::CreateEmptyBorder( | 139 SetBorder(views::Border::CreateEmptyBorder( |
140 0, views::kButtonHEdgeMarginNew, 0, views::kButtonHEdgeMarginNew)); | 140 0, views::kButtonHEdgeMarginNew, 0, views::kButtonHEdgeMarginNew)); |
141 SetMinSize(gfx::Size(0, | 141 SetMinSize(gfx::Size(0, |
142 kButtonHeight + views::kRelatedControlVerticalSpacing)); | 142 kButtonHeight + views::kRelatedControlVerticalSpacing)); |
143 SetImage(STATE_NORMAL, icon); | 143 SetImage(STATE_NORMAL, icon); |
| 144 SetFocusable(true); |
144 } | 145 } |
145 | 146 |
146 virtual ~BackgroundColorHoverButton() {} | 147 virtual ~BackgroundColorHoverButton() {} |
147 | 148 |
148 private: | 149 private: |
149 // views::LabelButton: | 150 // views::LabelButton: |
150 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE { | 151 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE { |
151 if ((state() == STATE_PRESSED) || | 152 if ((state() == STATE_PRESSED) || |
152 (state() == STATE_HOVERED) || | 153 (state() == STATE_HOVERED) || |
153 HasFocus()) { | 154 HasFocus()) { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 views::LabelButton::Layout(); | 196 views::LabelButton::Layout(); |
196 label()->SetHorizontalAlignment(gfx::ALIGN_CENTER); | 197 label()->SetHorizontalAlignment(gfx::ALIGN_CENTER); |
197 } | 198 } |
198 | 199 |
199 DISALLOW_COPY_AND_ASSIGN(RightAlignedIconLabelButton); | 200 DISALLOW_COPY_AND_ASSIGN(RightAlignedIconLabelButton); |
200 }; | 201 }; |
201 | 202 |
202 // EditableProfilePhoto ------------------------------------------------- | 203 // EditableProfilePhoto ------------------------------------------------- |
203 | 204 |
204 // A custom Image control that shows a "change" button when moused over. | 205 // A custom Image control that shows a "change" button when moused over. |
205 class EditableProfilePhoto : public views::ImageView { | 206 class EditableProfilePhoto : public views::LabelButton { |
206 public: | 207 public: |
207 EditableProfilePhoto(views::ButtonListener* listener, | 208 EditableProfilePhoto(views::ButtonListener* listener, |
208 const gfx::Image& icon, | 209 const gfx::Image& icon, |
209 bool is_editing_allowed, | 210 bool is_editing_allowed, |
210 const gfx::Rect& bounds) | 211 const gfx::Rect& bounds) |
211 : views::ImageView(), | 212 : views::LabelButton(listener, base::string16()), |
212 change_photo_button_(NULL) { | 213 photo_overlay_(NULL) { |
213 gfx::Image image = profiles::GetSizedAvatarIcon( | 214 gfx::Image image = profiles::GetSizedAvatarIcon( |
214 icon, true, kLargeImageSide, kLargeImageSide); | 215 icon, true, kLargeImageSide, kLargeImageSide); |
215 SetImage(image.ToImageSkia()); | 216 SetImage(views::LabelButton::STATE_NORMAL, *image.ToImageSkia()); |
| 217 SetBorder(views::Border::NullBorder()); |
216 SetBoundsRect(bounds); | 218 SetBoundsRect(bounds); |
217 | 219 |
218 // Calculate the circular mask that will be used to display the photo. | 220 // Calculate the circular mask that will be used to display the photo. |
219 circular_mask_.addCircle(SkIntToScalar(bounds.width() / 2), | 221 circular_mask_.addCircle(SkIntToScalar(bounds.width() / 2), |
220 SkIntToScalar(bounds.height() / 2), | 222 SkIntToScalar(bounds.height() / 2), |
221 SkIntToScalar(bounds.width() / 2)); | 223 SkIntToScalar(bounds.width() / 2)); |
222 | 224 |
223 if (!is_editing_allowed) | 225 if (!is_editing_allowed) { |
| 226 SetEnabled(false); |
224 return; | 227 return; |
| 228 } |
225 | 229 |
| 230 SetFocusable(true); |
226 set_notify_enter_exit_on_child(true); | 231 set_notify_enter_exit_on_child(true); |
227 | 232 |
228 // Button overlay that appears when hovering over the image. | 233 // Photo overlay that appears when hovering over the button. |
229 change_photo_button_ = new views::LabelButton(listener, base::string16()); | 234 photo_overlay_ = new views::ImageView(); |
230 change_photo_button_->SetHorizontalAlignment(gfx::ALIGN_CENTER); | |
231 change_photo_button_->SetBorder(views::Border::NullBorder()); | |
232 | 235 |
233 const SkColor kBackgroundColor = SkColorSetARGB(65, 255, 255, 255); | 236 const SkColor kBackgroundColor = SkColorSetARGB(65, 255, 255, 255); |
234 change_photo_button_->set_background( | 237 photo_overlay_->set_background( |
235 views::Background::CreateSolidBackground(kBackgroundColor)); | 238 views::Background::CreateSolidBackground(kBackgroundColor)); |
236 change_photo_button_->SetImage(views::LabelButton::STATE_NORMAL, | 239 photo_overlay_->SetImage(*ui::ResourceBundle::GetSharedInstance(). |
237 *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( | 240 GetImageSkiaNamed(IDR_ICON_PROFILES_EDIT_CAMERA)); |
238 IDR_ICON_PROFILES_EDIT_CAMERA)); | |
239 | 241 |
240 change_photo_button_->SetSize(bounds.size()); | 242 photo_overlay_->SetSize(bounds.size()); |
241 change_photo_button_->SetVisible(false); | 243 photo_overlay_->SetVisible(false); |
242 AddChildView(change_photo_button_); | 244 AddChildView(photo_overlay_); |
243 } | 245 } |
244 | 246 |
245 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE { | 247 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE { |
246 // Display the profile picture as a circle. | 248 // Display the profile picture as a circle. |
247 canvas->ClipPath(circular_mask_, true); | 249 canvas->ClipPath(circular_mask_, true); |
248 views::ImageView::OnPaint(canvas); | 250 views::LabelButton::OnPaint(canvas); |
249 } | 251 } |
250 | 252 |
251 virtual void PaintChildren(gfx::Canvas* canvas, | 253 virtual void PaintChildren(gfx::Canvas* canvas, |
252 const views::CullSet& cull_set) OVERRIDE { | 254 const views::CullSet& cull_set) OVERRIDE { |
253 // Display any children (the "change photo" overlay) as a circle. | 255 // Display any children (the "change photo" overlay) as a circle. |
254 canvas->ClipPath(circular_mask_, true); | 256 canvas->ClipPath(circular_mask_, true); |
255 View::PaintChildren(canvas, cull_set); | 257 View::PaintChildren(canvas, cull_set); |
256 } | 258 } |
257 | 259 |
258 views::LabelButton* change_photo_button() { return change_photo_button_; } | |
259 | |
260 private: | 260 private: |
261 // views::View: | 261 // views::CustomButton: |
262 virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE { | 262 virtual void StateChanged() OVERRIDE { |
263 if (change_photo_button_) | 263 bool show_overlay = |
264 change_photo_button_->SetVisible(true); | 264 (state() == STATE_PRESSED || state() == STATE_HOVERED || HasFocus()); |
| 265 if (photo_overlay_) |
| 266 photo_overlay_->SetVisible(show_overlay); |
265 } | 267 } |
266 | 268 |
267 virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE { | 269 virtual void OnFocus() OVERRIDE { |
268 if (change_photo_button_) | 270 views::LabelButton::OnFocus(); |
269 change_photo_button_->SetVisible(false); | 271 if (photo_overlay_) |
| 272 photo_overlay_->SetVisible(true); |
| 273 } |
| 274 |
| 275 virtual void OnBlur() OVERRIDE { |
| 276 views::LabelButton::OnBlur(); |
| 277 // Don't hide the overlay if it's being shown as a result of a mouseover. |
| 278 if (photo_overlay_ && state() != STATE_HOVERED) |
| 279 photo_overlay_->SetVisible(false); |
270 } | 280 } |
271 | 281 |
272 gfx::Path circular_mask_; | 282 gfx::Path circular_mask_; |
273 | 283 |
274 // Button that is shown when hovering over the image view. Can be NULL if | 284 // Image that is shown when hovering over the image button. Can be NULL if |
275 // the photo isn't allowed to be edited (e.g. for guest profiles). | 285 // the photo isn't allowed to be edited (e.g. for guest profiles). |
276 views::LabelButton* change_photo_button_; | 286 views::ImageView* photo_overlay_; |
277 | 287 |
278 DISALLOW_COPY_AND_ASSIGN(EditableProfilePhoto); | 288 DISALLOW_COPY_AND_ASSIGN(EditableProfilePhoto); |
279 }; | 289 }; |
280 | 290 |
281 // EditableProfileName ------------------------------------------------- | 291 // EditableProfileName ------------------------------------------------- |
282 | 292 |
283 // A custom text control that turns into a textfield for editing when clicked. | 293 // A custom text control that turns into a textfield for editing when clicked. |
284 class EditableProfileName : public RightAlignedIconLabelButton, | 294 class EditableProfileName : public RightAlignedIconLabelButton, |
285 public views::ButtonListener { | 295 public views::ButtonListener { |
286 public: | 296 public: |
287 EditableProfileName(views::TextfieldController* controller, | 297 EditableProfileName(views::TextfieldController* controller, |
288 const base::string16& text, | 298 const base::string16& text, |
289 bool is_editing_allowed) | 299 bool is_editing_allowed) |
290 : RightAlignedIconLabelButton(this, text), | 300 : RightAlignedIconLabelButton(this, text), |
291 profile_name_textfield_(NULL) { | 301 profile_name_textfield_(NULL) { |
292 ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); | 302 ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); |
293 const gfx::FontList& medium_font_list = | 303 const gfx::FontList& medium_font_list = |
294 rb->GetFontList(ui::ResourceBundle::MediumFont); | 304 rb->GetFontList(ui::ResourceBundle::MediumFont); |
295 SetFontList(medium_font_list); | 305 SetFontList(medium_font_list); |
296 SetHorizontalAlignment(gfx::ALIGN_CENTER); | 306 SetHorizontalAlignment(gfx::ALIGN_CENTER); |
297 | 307 |
298 if (!is_editing_allowed) { | 308 if (!is_editing_allowed) { |
299 SetBorder(views::Border::CreateEmptyBorder(2, 0, 2, 0)); | 309 SetBorder(views::Border::CreateEmptyBorder(2, 0, 2, 0)); |
300 return; | 310 return; |
301 } | 311 } |
302 | 312 |
| 313 SetFocusable(true); |
303 // Show an "edit" pencil icon when hovering over. In the default state, | 314 // Show an "edit" pencil icon when hovering over. In the default state, |
304 // we need to create an empty placeholder of the correct size, so that | 315 // we need to create an empty placeholder of the correct size, so that |
305 // the text doesn't jump around when the hovered icon appears. | 316 // the text doesn't jump around when the hovered icon appears. |
306 gfx::ImageSkia hover_image = | 317 gfx::ImageSkia hover_image = |
307 *rb->GetImageSkiaNamed(IDR_ICON_PROFILES_EDIT_HOVER); | 318 *rb->GetImageSkiaNamed(IDR_ICON_PROFILES_EDIT_HOVER); |
308 SetImage(STATE_NORMAL, CreateSquarePlaceholderImage(hover_image.width())); | 319 SetImage(STATE_NORMAL, CreateSquarePlaceholderImage(hover_image.width())); |
309 SetImage(STATE_HOVERED, hover_image); | 320 SetImage(STATE_HOVERED, hover_image); |
310 SetImage(STATE_PRESSED, | 321 SetImage(STATE_PRESSED, |
311 *rb->GetImageSkiaNamed(IDR_ICON_PROFILES_EDIT_PRESSED)); | 322 *rb->GetImageSkiaNamed(IDR_ICON_PROFILES_EDIT_PRESSED)); |
312 // To center the text, we need to offest it by the width of the icon we | 323 // To center the text, we need to offest it by the width of the icon we |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 // part of the new profile name typed in the textfield. | 366 // part of the new profile name typed in the textfield. |
356 return false; | 367 return false; |
357 } | 368 } |
358 | 369 |
359 virtual void Layout() OVERRIDE { | 370 virtual void Layout() OVERRIDE { |
360 if (profile_name_textfield_) | 371 if (profile_name_textfield_) |
361 profile_name_textfield_->SetBounds(0, 0, width(), height()); | 372 profile_name_textfield_->SetBounds(0, 0, width(), height()); |
362 RightAlignedIconLabelButton::Layout(); | 373 RightAlignedIconLabelButton::Layout(); |
363 } | 374 } |
364 | 375 |
| 376 virtual void OnFocus() OVERRIDE { |
| 377 RightAlignedIconLabelButton::OnFocus(); |
| 378 SetState(STATE_HOVERED); |
| 379 } |
| 380 |
| 381 virtual void OnBlur() OVERRIDE { |
| 382 RightAlignedIconLabelButton::OnBlur(); |
| 383 SetState(STATE_NORMAL); |
| 384 } |
| 385 |
365 // Textfield that is shown when editing the profile name. Can be NULL if | 386 // Textfield that is shown when editing the profile name. Can be NULL if |
366 // the profile name isn't allowed to be edited (e.g. for guest profiles). | 387 // the profile name isn't allowed to be edited (e.g. for guest profiles). |
367 views::Textfield* profile_name_textfield_; | 388 views::Textfield* profile_name_textfield_; |
368 | 389 |
369 DISALLOW_COPY_AND_ASSIGN(EditableProfileName); | 390 DISALLOW_COPY_AND_ASSIGN(EditableProfileName); |
370 }; | 391 }; |
371 | 392 |
372 // A title card with one back button right aligned and one label center aligned. | 393 // A title card with one back button right aligned and one label center aligned. |
373 class TitleCard : public views::View { | 394 class TitleCard : public views::View { |
374 public: | 395 public: |
375 TitleCard(const base::string16& message, views::ButtonListener* listener, | 396 TitleCard(const base::string16& message, views::ButtonListener* listener, |
376 views::ImageButton** back_button) { | 397 views::ImageButton** back_button) { |
377 back_button_ = new views::ImageButton(listener); | 398 back_button_ = new views::ImageButton(listener); |
378 back_button_->SetImageAlignment(views::ImageButton::ALIGN_LEFT, | 399 back_button_->SetImageAlignment(views::ImageButton::ALIGN_LEFT, |
379 views::ImageButton::ALIGN_MIDDLE); | 400 views::ImageButton::ALIGN_MIDDLE); |
380 ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); | 401 ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); |
381 back_button_->SetImage(views::ImageButton::STATE_NORMAL, | 402 back_button_->SetImage(views::ImageButton::STATE_NORMAL, |
382 rb->GetImageSkiaNamed(IDR_BACK)); | 403 rb->GetImageSkiaNamed(IDR_BACK)); |
383 back_button_->SetImage(views::ImageButton::STATE_HOVERED, | 404 back_button_->SetImage(views::ImageButton::STATE_HOVERED, |
384 rb->GetImageSkiaNamed(IDR_BACK_H)); | 405 rb->GetImageSkiaNamed(IDR_BACK_H)); |
385 back_button_->SetImage(views::ImageButton::STATE_PRESSED, | 406 back_button_->SetImage(views::ImageButton::STATE_PRESSED, |
386 rb->GetImageSkiaNamed(IDR_BACK_P)); | 407 rb->GetImageSkiaNamed(IDR_BACK_P)); |
387 back_button_->SetImage(views::ImageButton::STATE_DISABLED, | 408 back_button_->SetImage(views::ImageButton::STATE_DISABLED, |
388 rb->GetImageSkiaNamed(IDR_BACK_D)); | 409 rb->GetImageSkiaNamed(IDR_BACK_D)); |
| 410 back_button_->SetFocusable(true); |
389 *back_button = back_button_; | 411 *back_button = back_button_; |
390 | 412 |
391 title_label_ = new views::Label(message); | 413 title_label_ = new views::Label(message); |
392 title_label_->SetHorizontalAlignment(gfx::ALIGN_CENTER); | 414 title_label_->SetHorizontalAlignment(gfx::ALIGN_CENTER); |
393 const gfx::FontList& medium_font_list = | 415 const gfx::FontList& medium_font_list = |
394 rb->GetFontList(ui::ResourceBundle::MediumFont); | 416 rb->GetFontList(ui::ResourceBundle::MediumFont); |
395 title_label_->SetFontList(medium_font_list); | 417 title_label_->SetFontList(medium_font_list); |
396 | 418 |
397 AddChildView(back_button_); | 419 AddChildView(back_button_); |
398 AddChildView(title_label_); | 420 AddChildView(title_label_); |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
722 std::string primary_account = | 744 std::string primary_account = |
723 SigninManagerFactory::GetForProfile(browser_->profile())-> | 745 SigninManagerFactory::GetForProfile(browser_->profile())-> |
724 GetAuthenticatedUsername(); | 746 GetAuthenticatedUsername(); |
725 // The account management view is only available with the | 747 // The account management view is only available with the |
726 // --enable-account-consistency flag. | 748 // --enable-account-consistency flag. |
727 bool account_management_available = !primary_account.empty() && | 749 bool account_management_available = !primary_account.empty() && |
728 switches::IsEnableAccountConsistency(); | 750 switches::IsEnableAccountConsistency(); |
729 ShowView(account_management_available ? | 751 ShowView(account_management_available ? |
730 profiles::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT : | 752 profiles::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT : |
731 profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER, avatar_menu_.get()); | 753 profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER, avatar_menu_.get()); |
732 } else if (current_profile_photo_ && | 754 } else if (sender == current_profile_photo_) { |
733 sender == current_profile_photo_->change_photo_button()) { | |
734 avatar_menu_->EditProfile(avatar_menu_->GetActiveProfileIndex()); | 755 avatar_menu_->EditProfile(avatar_menu_->GetActiveProfileIndex()); |
735 PostActionPerformed(ProfileMetrics::PROFILE_DESKTOP_MENU_EDIT_IMAGE); | 756 PostActionPerformed(ProfileMetrics::PROFILE_DESKTOP_MENU_EDIT_IMAGE); |
736 } else if (sender == signin_current_profile_link_) { | 757 } else if (sender == signin_current_profile_link_) { |
737 ShowView(profiles::BUBBLE_VIEW_MODE_GAIA_SIGNIN, avatar_menu_.get()); | 758 ShowView(profiles::BUBBLE_VIEW_MODE_GAIA_SIGNIN, avatar_menu_.get()); |
738 } else if (sender == add_person_button_) { | 759 } else if (sender == add_person_button_) { |
739 ProfileMetrics::LogProfileNewAvatarMenuNotYou( | 760 ProfileMetrics::LogProfileNewAvatarMenuNotYou( |
740 ProfileMetrics::PROFILE_AVATAR_MENU_NOT_YOU_ADD_PERSON); | 761 ProfileMetrics::PROFILE_AVATAR_MENU_NOT_YOU_ADD_PERSON); |
741 chrome::ShowUserManager(browser_->profile()->GetPath()); | 762 chrome::ShowUserManager(browser_->profile()->GetPath()); |
742 } else if (sender == disconnect_button_) { | 763 } else if (sender == disconnect_button_) { |
743 ProfileMetrics::LogProfileNewAvatarMenuNotYou( | 764 ProfileMetrics::LogProfileNewAvatarMenuNotYou( |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1126 IDR_ICON_PROFILES_ACCOUNT_BUTTON_ERROR).ToImageSkia(); | 1147 IDR_ICON_PROFILES_ACCOUNT_BUTTON_ERROR).ToImageSkia(); |
1127 auth_error_email_button_ = | 1148 auth_error_email_button_ = |
1128 new RightAlignedIconLabelButton(this, avatar_item.sync_state); | 1149 new RightAlignedIconLabelButton(this, avatar_item.sync_state); |
1129 auth_error_email_button_->SetElideBehavior(gfx::ELIDE_EMAIL); | 1150 auth_error_email_button_->SetElideBehavior(gfx::ELIDE_EMAIL); |
1130 auth_error_email_button_->SetBorder(views::Border::NullBorder()); | 1151 auth_error_email_button_->SetBorder(views::Border::NullBorder()); |
1131 auth_error_email_button_->SetImage( | 1152 auth_error_email_button_->SetImage( |
1132 views::LabelButton::STATE_NORMAL, warning_image); | 1153 views::LabelButton::STATE_NORMAL, warning_image); |
1133 auth_error_email_button_->SetTextColor( | 1154 auth_error_email_button_->SetTextColor( |
1134 views::LabelButton::STATE_NORMAL, | 1155 views::LabelButton::STATE_NORMAL, |
1135 views::Link::GetDefaultEnabledColor()); | 1156 views::Link::GetDefaultEnabledColor()); |
| 1157 auth_error_email_button_->SetFocusable(true); |
1136 layout->AddView(auth_error_email_button_); | 1158 layout->AddView(auth_error_email_button_); |
1137 } else { | 1159 } else { |
1138 views::Label* email_label = new views::Label(avatar_item.sync_state); | 1160 views::Label* email_label = new views::Label(avatar_item.sync_state); |
1139 email_label->SetElideBehavior(gfx::ELIDE_EMAIL); | 1161 email_label->SetElideBehavior(gfx::ELIDE_EMAIL); |
1140 email_label->SetEnabled(false); | 1162 email_label->SetEnabled(false); |
1141 layout->AddView(email_label); | 1163 layout->AddView(email_label); |
1142 } | 1164 } |
1143 } | 1165 } |
1144 } else { | 1166 } else { |
1145 SigninManagerBase* signin_manager = SigninManagerFactory::GetForProfile( | 1167 SigninManagerBase* signin_manager = SigninManagerFactory::GetForProfile( |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1586 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 1608 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != |
1587 IncognitoModePrefs::DISABLED; | 1609 IncognitoModePrefs::DISABLED; |
1588 return incognito_available && !browser_->profile()->IsGuestSession(); | 1610 return incognito_available && !browser_->profile()->IsGuestSession(); |
1589 } | 1611 } |
1590 | 1612 |
1591 void ProfileChooserView::PostActionPerformed( | 1613 void ProfileChooserView::PostActionPerformed( |
1592 ProfileMetrics::ProfileDesktopMenu action_performed) { | 1614 ProfileMetrics::ProfileDesktopMenu action_performed) { |
1593 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); | 1615 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); |
1594 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; | 1616 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; |
1595 } | 1617 } |
OLD | NEW |