Chromium Code Reviews| 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/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 191 SetImageLabelSpacing(switches::IsMaterialDesignUserMenu() | 191 SetImageLabelSpacing(switches::IsMaterialDesignUserMenu() |
| 192 ? (kMaterialMenuEdgeMargin - 2) | 192 ? (kMaterialMenuEdgeMargin - 2) |
| 193 : views::kItemLabelSpacing); | 193 : views::kItemLabelSpacing); |
| 194 const int button_margin = switches::IsMaterialDesignUserMenu() | 194 const int button_margin = switches::IsMaterialDesignUserMenu() |
| 195 ? kMaterialMenuEdgeMargin | 195 ? kMaterialMenuEdgeMargin |
| 196 : views::kButtonHEdgeMarginNew; | 196 : views::kButtonHEdgeMarginNew; |
| 197 SetBorder( | 197 SetBorder( |
| 198 views::Border::CreateEmptyBorder(0, button_margin, 0, button_margin)); | 198 views::Border::CreateEmptyBorder(0, button_margin, 0, button_margin)); |
| 199 SetFocusForPlatform(); | 199 SetFocusForPlatform(); |
| 200 set_request_focus_on_press(true); | 200 set_request_focus_on_press(true); |
| 201 | |
| 202 if (switches::IsMaterialDesignUserMenu()) { | |
| 203 label()->SetHandlesTooltips(false); | |
|
sky
2016/08/11 03:25:35
The other option is to not set a tooltip. Not sett
Jane
2016/08/11 14:59:04
I don't need to set the tooltip for the MD case, a
| |
| 204 } | |
| 201 } | 205 } |
| 202 | 206 |
| 203 BackgroundColorHoverButton(views::ButtonListener* listener, | 207 BackgroundColorHoverButton(views::ButtonListener* listener, |
| 204 const base::string16& text, | 208 const base::string16& text, |
| 205 const gfx::ImageSkia& icon) | 209 const gfx::ImageSkia& icon) |
| 206 : BackgroundColorHoverButton(listener, text) { | 210 : BackgroundColorHoverButton(listener, text) { |
| 207 SetMinSize(gfx::Size( | 211 SetMinSize(gfx::Size( |
| 208 icon.width(), kButtonHeight + views::kRelatedControlVerticalSpacing)); | 212 icon.width(), kButtonHeight + views::kRelatedControlVerticalSpacing)); |
| 209 SetImage(STATE_NORMAL, icon); | 213 SetImage(STATE_NORMAL, icon); |
| 210 } | 214 } |
| (...skipping 2083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2294 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 2298 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != |
| 2295 IncognitoModePrefs::DISABLED; | 2299 IncognitoModePrefs::DISABLED; |
| 2296 return incognito_available && !browser_->profile()->IsGuestSession(); | 2300 return incognito_available && !browser_->profile()->IsGuestSession(); |
| 2297 } | 2301 } |
| 2298 | 2302 |
| 2299 void ProfileChooserView::PostActionPerformed( | 2303 void ProfileChooserView::PostActionPerformed( |
| 2300 ProfileMetrics::ProfileDesktopMenu action_performed) { | 2304 ProfileMetrics::ProfileDesktopMenu action_performed) { |
| 2301 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); | 2305 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); |
| 2302 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; | 2306 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; |
| 2303 } | 2307 } |
| OLD | NEW |