| 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/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/metrics/user_metrics.h" | 8 #include "base/metrics/user_metrics.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/app/vector_icons/vector_icons.h" | 10 #include "chrome/app/vector_icons/vector_icons.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 #include "ui/gfx/image/image.h" | 65 #include "ui/gfx/image/image.h" |
| 66 #include "ui/gfx/image/image_skia.h" | 66 #include "ui/gfx/image/image_skia.h" |
| 67 #include "ui/gfx/paint_vector_icon.h" | 67 #include "ui/gfx/paint_vector_icon.h" |
| 68 #include "ui/gfx/path.h" | 68 #include "ui/gfx/path.h" |
| 69 #include "ui/gfx/skia_util.h" | 69 #include "ui/gfx/skia_util.h" |
| 70 #include "ui/gfx/text_elider.h" | 70 #include "ui/gfx/text_elider.h" |
| 71 #include "ui/native_theme/common_theme.h" | 71 #include "ui/native_theme/common_theme.h" |
| 72 #include "ui/native_theme/native_theme.h" | 72 #include "ui/native_theme/native_theme.h" |
| 73 #include "ui/vector_icons/vector_icons.h" | 73 #include "ui/vector_icons/vector_icons.h" |
| 74 #include "ui/views/controls/button/blue_button.h" | 74 #include "ui/views/controls/button/blue_button.h" |
| 75 #include "ui/views/controls/button/image_button.h" | |
| 76 #include "ui/views/controls/button/label_button.h" | 75 #include "ui/views/controls/button/label_button.h" |
| 77 #include "ui/views/controls/button/label_button_border.h" | 76 #include "ui/views/controls/button/label_button_border.h" |
| 78 #include "ui/views/controls/button/md_text_button.h" | 77 #include "ui/views/controls/button/md_text_button.h" |
| 79 #include "ui/views/controls/button/menu_button.h" | 78 #include "ui/views/controls/button/menu_button.h" |
| 80 #include "ui/views/controls/label.h" | 79 #include "ui/views/controls/label.h" |
| 81 #include "ui/views/controls/link.h" | 80 #include "ui/views/controls/link.h" |
| 82 #include "ui/views/controls/separator.h" | 81 #include "ui/views/controls/separator.h" |
| 83 #include "ui/views/controls/styled_label.h" | 82 #include "ui/views/controls/styled_label.h" |
| 84 #include "ui/views/controls/webview/webview.h" | 83 #include "ui/views/controls/webview/webview.h" |
| 85 #include "ui/views/layout/box_layout.h" | 84 #include "ui/views/layout/box_layout.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 | 148 |
| 150 std::string GetAuthErrorAccountId(Profile* profile) { | 149 std::string GetAuthErrorAccountId(Profile* profile) { |
| 151 const SigninErrorController* error = | 150 const SigninErrorController* error = |
| 152 SigninErrorControllerFactory::GetForProfile(profile); | 151 SigninErrorControllerFactory::GetForProfile(profile); |
| 153 if (!error) | 152 if (!error) |
| 154 return std::string(); | 153 return std::string(); |
| 155 | 154 |
| 156 return error->error_account_id(); | 155 return error->error_account_id(); |
| 157 } | 156 } |
| 158 | 157 |
| 159 views::ImageButton* CreateBackButton(views::ButtonListener* listener) { | 158 views::ImageButton* CreateBackButton(views::ImageButtonDelegate* listener) { |
| 160 views::ImageButton* back_button = new views::ImageButton(listener); | 159 views::ImageButton* back_button = new views::ImageButton(listener); |
| 161 back_button->SetImageAlignment(views::ImageButton::ALIGN_LEFT, | 160 back_button->SetImageAlignment(views::ImageButton::ALIGN_LEFT, |
| 162 views::ImageButton::ALIGN_MIDDLE); | 161 views::ImageButton::ALIGN_MIDDLE); |
| 163 ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); | 162 ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); |
| 164 back_button->SetImage(views::ImageButton::STATE_NORMAL, | 163 back_button->SetImage(views::ImageButton::STATE_NORMAL, |
| 165 rb->GetImageSkiaNamed(IDR_BACK)); | 164 rb->GetImageSkiaNamed(IDR_BACK)); |
| 166 back_button->SetImage(views::ImageButton::STATE_HOVERED, | 165 back_button->SetImage(views::ImageButton::STATE_HOVERED, |
| 167 rb->GetImageSkiaNamed(IDR_BACK_H)); | 166 rb->GetImageSkiaNamed(IDR_BACK_H)); |
| 168 back_button->SetImage(views::ImageButton::STATE_PRESSED, | 167 back_button->SetImage(views::ImageButton::STATE_PRESSED, |
| 169 rb->GetImageSkiaNamed(IDR_BACK_P)); | 168 rb->GetImageSkiaNamed(IDR_BACK_P)); |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 views::ImageView* photo_overlay_; | 440 views::ImageView* photo_overlay_; |
| 442 | 441 |
| 443 Profile* profile_; | 442 Profile* profile_; |
| 444 | 443 |
| 445 DISALLOW_COPY_AND_ASSIGN(EditableProfilePhoto); | 444 DISALLOW_COPY_AND_ASSIGN(EditableProfilePhoto); |
| 446 }; | 445 }; |
| 447 | 446 |
| 448 // A title card with one back button right aligned and one label center aligned. | 447 // A title card with one back button right aligned and one label center aligned. |
| 449 class TitleCard : public views::View { | 448 class TitleCard : public views::View { |
| 450 public: | 449 public: |
| 451 TitleCard(const base::string16& message, views::ButtonListener* listener, | 450 TitleCard(const base::string16& message, |
| 451 views::ImageButtonDelegate* listener, |
| 452 views::ImageButton** back_button) { | 452 views::ImageButton** back_button) { |
| 453 back_button_ = CreateBackButton(listener); | 453 back_button_ = CreateBackButton(listener); |
| 454 *back_button = back_button_; | 454 *back_button = back_button_; |
| 455 | 455 |
| 456 title_label_ = new views::Label(message); | 456 title_label_ = new views::Label(message); |
| 457 title_label_->SetHorizontalAlignment(gfx::ALIGN_CENTER); | 457 title_label_->SetHorizontalAlignment(gfx::ALIGN_CENTER); |
| 458 ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); | 458 ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); |
| 459 const gfx::FontList& medium_font_list = | 459 const gfx::FontList& medium_font_list = |
| 460 rb->GetFontList(ui::ResourceBundle::MediumFont); | 460 rb->GetFontList(ui::ResourceBundle::MediumFont); |
| 461 title_label_->SetFontList(medium_font_list); | 461 title_label_->SetFontList(medium_font_list); |
| (...skipping 1504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1966 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 1966 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != |
| 1967 IncognitoModePrefs::DISABLED; | 1967 IncognitoModePrefs::DISABLED; |
| 1968 return incognito_available && !browser_->profile()->IsGuestSession(); | 1968 return incognito_available && !browser_->profile()->IsGuestSession(); |
| 1969 } | 1969 } |
| 1970 | 1970 |
| 1971 void ProfileChooserView::PostActionPerformed( | 1971 void ProfileChooserView::PostActionPerformed( |
| 1972 ProfileMetrics::ProfileDesktopMenu action_performed) { | 1972 ProfileMetrics::ProfileDesktopMenu action_performed) { |
| 1973 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); | 1973 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); |
| 1974 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; | 1974 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; |
| 1975 } | 1975 } |
| OLD | NEW |