OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_API_INFOBARS_ONE_CLICK_SIGNIN_INFOBAR_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_API_INFOBARS_ONE_CLICK_SIGNIN_INFOBAR_DELEGATE_H_ |
| 7 |
| 8 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h" |
| 9 #include "third_party/skia/include/core/SkColor.h" |
| 10 |
| 11 // An interface derived from ConfirmInfoBarDelegate implemented for the |
| 12 // one-click sign in inforbar experiments. |
| 13 class OneClickSigninInfoBarDelegate : public ConfirmInfoBarDelegate { |
| 14 public: |
| 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. |
| 17 struct AlternateColors { |
| 18 bool enabled; |
| 19 SkColor infobar_top_color; |
| 20 SkColor infobar_bottom_color; |
| 21 SkColor button_text_color; |
| 22 SkColor button_background_color; |
| 23 SkColor button_border_color; |
| 24 }; |
| 25 |
| 26 explicit OneClickSigninInfoBarDelegate(InfoBarService* infobar_service); |
| 27 virtual ~OneClickSigninInfoBarDelegate(); |
| 28 |
| 29 // Returns the colours to use with the one click signin infobar. The colours |
| 30 // depend on the experimental group. |
| 31 virtual void GetAlternateColors(AlternateColors* alt_colors); |
| 32 |
| 33 private: |
| 34 #if defined(OS_WIN) |
| 35 // Because the experiment is only running on windows, only override this |
| 36 // function on that platform. Other platforms that support one-click sign in |
| 37 // will create a regular confirm infobar with no support for colour changes. |
| 38 |
| 39 // InfoBarDelegate: |
| 40 virtual InfoBar* CreateInfoBar(InfoBarService* owner) OVERRIDE; |
| 41 #endif |
| 42 |
| 43 DISALLOW_COPY_AND_ASSIGN(OneClickSigninInfoBarDelegate); |
| 44 }; |
| 45 |
| 46 #endif // CHROME_BROWSER_API_INFOBARS_ONE_CLICK_SIGNIN_INFOBAR_DELEGATE_H_ |
OLD | NEW |