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 10 matching lines...) Expand all Loading... |
21 #include "chrome/browser/signin/signin_manager_factory.h" | 21 #include "chrome/browser/signin/signin_manager_factory.h" |
22 #include "chrome/browser/signin/signin_promo.h" | 22 #include "chrome/browser/signin/signin_promo.h" |
23 #include "chrome/browser/signin/signin_ui_util.h" | 23 #include "chrome/browser/signin/signin_ui_util.h" |
24 #include "chrome/browser/sync/profile_sync_service_factory.h" | 24 #include "chrome/browser/sync/profile_sync_service_factory.h" |
25 #include "chrome/browser/sync/sync_ui_util.h" | 25 #include "chrome/browser/sync/sync_ui_util.h" |
26 #include "chrome/browser/ui/browser.h" | 26 #include "chrome/browser/ui/browser.h" |
27 #include "chrome/browser/ui/browser_commands.h" | 27 #include "chrome/browser/ui/browser_commands.h" |
28 #include "chrome/browser/ui/browser_dialogs.h" | 28 #include "chrome/browser/ui/browser_dialogs.h" |
29 #include "chrome/browser/ui/browser_list.h" | 29 #include "chrome/browser/ui/browser_list.h" |
30 #include "chrome/browser/ui/chrome_pages.h" | 30 #include "chrome/browser/ui/chrome_pages.h" |
| 31 #include "chrome/browser/ui/profile_chooser_constants.h" |
31 #include "chrome/browser/ui/singleton_tabs.h" | 32 #include "chrome/browser/ui/singleton_tabs.h" |
32 #include "chrome/browser/ui/user_manager.h" | 33 #include "chrome/browser/ui/user_manager.h" |
33 #include "chrome/browser/ui/views/profiles/signin_view_controller_delegate_views
.h" | 34 #include "chrome/browser/ui/views/profiles/signin_view_controller_delegate_views
.h" |
34 #include "chrome/browser/ui/views/profiles/user_manager_view.h" | 35 #include "chrome/browser/ui/views/profiles/user_manager_view.h" |
35 #include "chrome/browser/ui/webui/signin/login_ui_service.h" | 36 #include "chrome/browser/ui/webui/signin/login_ui_service.h" |
36 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" | 37 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" |
37 #include "chrome/common/pref_names.h" | 38 #include "chrome/common/pref_names.h" |
38 #include "chrome/common/url_constants.h" | 39 #include "chrome/common/url_constants.h" |
39 #include "chrome/grit/chromium_strings.h" | 40 #include "chrome/grit/chromium_strings.h" |
40 #include "chrome/grit/generated_resources.h" | 41 #include "chrome/grit/generated_resources.h" |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 SetImage(STATE_NORMAL, icon); | 214 SetImage(STATE_NORMAL, icon); |
214 } | 215 } |
215 | 216 |
216 ~BackgroundColorHoverButton() override {} | 217 ~BackgroundColorHoverButton() override {} |
217 | 218 |
218 private: | 219 private: |
219 // views::LabelButton: | 220 // views::LabelButton: |
220 void OnPaint(gfx::Canvas* canvas) override { | 221 void OnPaint(gfx::Canvas* canvas) override { |
221 if ((state() == STATE_PRESSED) || | 222 if ((state() == STATE_PRESSED) || |
222 (state() == STATE_HOVERED)) { | 223 (state() == STATE_HOVERED)) { |
223 canvas->DrawColor(GetNativeTheme()->GetSystemColor( | 224 canvas->DrawColor(profiles::kHoverColor); |
224 ui::NativeTheme::kColorId_ButtonHoverBackgroundColor)); | |
225 } | 225 } |
226 LabelButton::OnPaint(canvas); | 226 LabelButton::OnPaint(canvas); |
227 } | 227 } |
228 | 228 |
229 DISALLOW_COPY_AND_ASSIGN(BackgroundColorHoverButton); | 229 DISALLOW_COPY_AND_ASSIGN(BackgroundColorHoverButton); |
230 }; | 230 }; |
231 | 231 |
232 // SizedContainer ------------------------------------------------- | 232 // SizedContainer ------------------------------------------------- |
233 | 233 |
234 // A simple container view that takes an explicit preferred size. | 234 // A simple container view that takes an explicit preferred size. |
(...skipping 2070 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2305 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 2305 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != |
2306 IncognitoModePrefs::DISABLED; | 2306 IncognitoModePrefs::DISABLED; |
2307 return incognito_available && !browser_->profile()->IsGuestSession(); | 2307 return incognito_available && !browser_->profile()->IsGuestSession(); |
2308 } | 2308 } |
2309 | 2309 |
2310 void ProfileChooserView::PostActionPerformed( | 2310 void ProfileChooserView::PostActionPerformed( |
2311 ProfileMetrics::ProfileDesktopMenu action_performed) { | 2311 ProfileMetrics::ProfileDesktopMenu action_performed) { |
2312 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); | 2312 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); |
2313 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; | 2313 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; |
2314 } | 2314 } |
OLD | NEW |