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 #ifndef CHROME_BROWSER_UI_VIEWS_PROFILES_PROFILE_CHOOSER_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_PROFILES_PROFILE_CHOOSER_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_PROFILES_PROFILE_CHOOSER_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_PROFILES_PROFILE_CHOOSER_VIEW_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 51 public: | 51 public: |
| 52 // Shows the bubble if one is not already showing. This allows us to easily | 52 // Shows the bubble if one is not already showing. This allows us to easily |
| 53 // make a button toggle the bubble on and off when clicked: we unconditionally | 53 // make a button toggle the bubble on and off when clicked: we unconditionally |
| 54 // call this function when the button is clicked and if the bubble isn't | 54 // call this function when the button is clicked and if the bubble isn't |
| 55 // showing it will appear while if it is showing, nothing will happen here and | 55 // showing it will appear while if it is showing, nothing will happen here and |
| 56 // the existing bubble will auto-close due to focus loss. | 56 // the existing bubble will auto-close due to focus loss. |
| 57 static void ShowBubble( | 57 static void ShowBubble( |
| 58 profiles::BubbleViewMode view_mode, | 58 profiles::BubbleViewMode view_mode, |
| 59 profiles::TutorialMode tutorial_mode, | 59 profiles::TutorialMode tutorial_mode, |
| 60 const signin::ManageAccountsParams& manage_accounts_params, | 60 const signin::ManageAccountsParams& manage_accounts_params, |
| 61 signin_metrics::AccessPoint access_point, | |
| 61 views::View* anchor_view, | 62 views::View* anchor_view, |
| 62 views::BubbleBorder::Arrow arrow, | 63 views::BubbleBorder::Arrow arrow, |
| 63 views::BubbleBorder::BubbleAlignment border_alignment, | 64 views::BubbleBorder::BubbleAlignment border_alignment, |
| 64 Browser* browser); | 65 Browser* browser); |
| 65 static bool IsShowing(); | 66 static bool IsShowing(); |
| 66 static void Hide(); | 67 static void Hide(); |
| 67 | 68 |
| 68 private: | 69 private: |
| 69 friend class ProfileChooserViewExtensionsTest; | 70 friend class ProfileChooserViewExtensionsTest; |
| 70 | 71 |
| 71 typedef std::vector<size_t> Indexes; | 72 typedef std::vector<size_t> Indexes; |
| 72 typedef std::map<views::Button*, int> ButtonIndexes; | 73 typedef std::map<views::Button*, int> ButtonIndexes; |
| 73 typedef std::map<views::Button*, std::string> AccountButtonIndexes; | 74 typedef std::map<views::Button*, std::string> AccountButtonIndexes; |
| 74 | 75 |
| 75 ProfileChooserView(views::View* anchor_view, | 76 ProfileChooserView(views::View* anchor_view, |
| 76 views::BubbleBorder::Arrow arrow, | 77 views::BubbleBorder::Arrow arrow, |
| 77 Browser* browser, | 78 Browser* browser, |
| 78 profiles::BubbleViewMode view_mode, | 79 profiles::BubbleViewMode view_mode, |
| 79 profiles::TutorialMode tutorial_mode, | 80 profiles::TutorialMode tutorial_mode, |
| 80 signin::GAIAServiceType service_type); | 81 signin::GAIAServiceType service_type, |
| 82 signin_metrics::AccessPoint access_point); | |
| 81 ~ProfileChooserView() override; | 83 ~ProfileChooserView() override; |
| 82 | 84 |
| 83 // views::BubbleDelegateView: | 85 // views::BubbleDelegateView: |
| 84 void Init() override; | 86 void Init() override; |
| 85 void OnNativeThemeChanged(const ui::NativeTheme* native_theme) override; | 87 void OnNativeThemeChanged(const ui::NativeTheme* native_theme) override; |
| 86 void WindowClosing() override; | 88 void WindowClosing() override; |
| 87 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; | 89 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; |
| 88 views::View* GetInitiallyFocusedView() override; | 90 views::View* GetInitiallyFocusedView() override; |
| 89 | 91 |
| 90 // content::WebContentsDelegate: | 92 // content::WebContentsDelegate: |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 265 | 267 |
| 266 // Active view mode. | 268 // Active view mode. |
| 267 profiles::BubbleViewMode view_mode_; | 269 profiles::BubbleViewMode view_mode_; |
| 268 | 270 |
| 269 // The current tutorial mode. | 271 // The current tutorial mode. |
| 270 profiles::TutorialMode tutorial_mode_; | 272 profiles::TutorialMode tutorial_mode_; |
| 271 | 273 |
| 272 // The GAIA service type provided in the response header. | 274 // The GAIA service type provided in the response header. |
| 273 signin::GAIAServiceType gaia_service_type_; | 275 signin::GAIAServiceType gaia_service_type_; |
| 274 | 276 |
| 277 // The current access point of sign in. | |
| 278 signin_metrics::AccessPoint access_point_; | |
|
sky
2015/12/03 22:45:28
const
gogerald1
2015/12/04 20:49:09
Done.
| |
| 279 | |
| 275 DISALLOW_COPY_AND_ASSIGN(ProfileChooserView); | 280 DISALLOW_COPY_AND_ASSIGN(ProfileChooserView); |
| 276 }; | 281 }; |
| 277 | 282 |
| 278 #endif // CHROME_BROWSER_UI_VIEWS_PROFILES_PROFILE_CHOOSER_VIEW_H_ | 283 #endif // CHROME_BROWSER_UI_VIEWS_PROFILES_PROFILE_CHOOSER_VIEW_H_ |
| OLD | NEW |