| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_SYNC_ONE_CLICK_SIGNIN_INFOBAR_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_INFOBAR_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_INFOBAR_DELEGATE_H_ | 6 #define CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_INFOBAR_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h" | 8 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h" |
| 9 #include "third_party/skia/include/core/SkColor.h" | 9 #include "third_party/skia/include/core/SkColor.h" |
| 10 | 10 |
| 11 // An interface derived from ConfirmInfoBarDelegate implemented for the | 11 // An interface derived from ConfirmInfoBarDelegate implemented for the |
| 12 // one-click sign in inforbar experiments. | 12 // one-click sign in inforbar experiments. |
| 13 class OneClickSigninInfoBarDelegate : public ConfirmInfoBarDelegate { | 13 class OneClickSigninInfoBarDelegate : public ConfirmInfoBarDelegate { |
| 14 public: | 14 public: |
| 15 // A set of alternate colours for the experiment. The colour values are only | 15 // A set of alternate colours for the experiment. The colour values are only |
| 16 // used if |enabled| is true. Otherwise the infobar uses its default colours. | 16 // used if |enabled| is true. Otherwise the infobar uses its default colours. |
| 17 struct AlternateColors { | 17 struct AlternateColors { |
| 18 bool enabled; | 18 bool enabled; |
| 19 SkColor infobar_top_color; | 19 SkColor infobar_top_color; |
| 20 SkColor infobar_bottom_color; | 20 SkColor infobar_bottom_color; |
| 21 SkColor button_text_color; | 21 SkColor button_text_color; |
| 22 SkColor button_background_color; | 22 SkColor button_background_color; |
| 23 SkColor button_border_color; | 23 SkColor button_border_color; |
| 24 }; | 24 }; |
| 25 | 25 |
| 26 explicit OneClickSigninInfoBarDelegate(InfoBarService* infobar_service); | |
| 27 virtual ~OneClickSigninInfoBarDelegate(); | 26 virtual ~OneClickSigninInfoBarDelegate(); |
| 28 | 27 |
| 29 // Returns the colours to use with the one click signin infobar. The colours | 28 // Returns the colours to use with the one click signin infobar. The colours |
| 30 // depend on the experimental group. | 29 // depend on the experimental group. |
| 31 virtual void GetAlternateColors(AlternateColors* alt_colors); | 30 virtual void GetAlternateColors(AlternateColors* alt_colors); |
| 32 | 31 |
| 32 protected: |
| 33 explicit OneClickSigninInfoBarDelegate(InfoBarService* infobar_service); |
| 34 |
| 33 private: | 35 private: |
| 34 #if defined(TOOLKIT_VIEWS) | 36 #if defined(TOOLKIT_VIEWS) |
| 35 // Because the experiment is only running for views, only override this | 37 // Because the experiment is only running for views, only override this |
| 36 // function there. Other platforms that support one-click sign in will | 38 // function there. Other platforms that support one-click sign in will |
| 37 // create a regular confirm infobar with no support for colour changes. | 39 // create a regular confirm infobar with no support for colour changes. |
| 38 | 40 |
| 39 // InfoBarDelegate: | 41 // InfoBarDelegate: |
| 40 virtual InfoBar* CreateInfoBar(InfoBarService* owner) OVERRIDE; | 42 virtual InfoBar* CreateInfoBar(InfoBarService* owner) OVERRIDE; |
| 41 #endif | 43 #endif |
| 42 | 44 |
| 43 DISALLOW_COPY_AND_ASSIGN(OneClickSigninInfoBarDelegate); | 45 DISALLOW_COPY_AND_ASSIGN(OneClickSigninInfoBarDelegate); |
| 44 }; | 46 }; |
| 45 | 47 |
| 46 #endif // CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_INFOBAR_DELEGATE_H_ | 48 #endif // CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_INFOBAR_DELEGATE_H_ |
| OLD | NEW |