| OLD | NEW |
| 1 // Copyright (c) 2011 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_VIEWS_INFOBARS_TRANSLATE_INFOBAR_BASE_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_INFOBARS_TRANSLATE_INFOBAR_BASE_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_INFOBARS_TRANSLATE_INFOBAR_BASE_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_INFOBARS_TRANSLATE_INFOBAR_BASE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "chrome/browser/translate/languages_menu_model.h" | 10 #include "chrome/browser/translate/languages_menu_model.h" |
| 11 #include "chrome/browser/translate/translate_infobar_view.h" | 11 #include "chrome/browser/translate/translate_infobar_view.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 38 // Sets the text of the provided language menu button to reflect the current | 38 // Sets the text of the provided language menu button to reflect the current |
| 39 // value from the delegate. | 39 // value from the delegate. |
| 40 void UpdateLanguageButtonText(views::MenuButton* button, | 40 void UpdateLanguageButtonText(views::MenuButton* button, |
| 41 LanguagesMenuModel::LanguageType language); | 41 LanguagesMenuModel::LanguageType language); |
| 42 | 42 |
| 43 // Convenience to retrieve the TranslateInfoBarDelegate for this infobar. | 43 // Convenience to retrieve the TranslateInfoBarDelegate for this infobar. |
| 44 TranslateInfoBarDelegate* GetDelegate(); | 44 TranslateInfoBarDelegate* GetDelegate(); |
| 45 | 45 |
| 46 private: | 46 private: |
| 47 // InfoBarView: | 47 // InfoBarView: |
| 48 virtual void OnPaintBackground(gfx::Canvas* canvas) OVERRIDE; | 48 virtual void OnPaintBackground(gfx::CanvasSkia* canvas) OVERRIDE; |
| 49 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; | 49 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; |
| 50 | 50 |
| 51 // Returns the background that should be displayed when not animating. | 51 // Returns the background that should be displayed when not animating. |
| 52 const views::Background& GetBackground(); | 52 const views::Background& GetBackground(); |
| 53 | 53 |
| 54 // Paints |background| to |canvas| with the opacity level based on | 54 // Paints |background| to |canvas| with the opacity level based on |
| 55 // |animation_value|. | 55 // |animation_value|. |
| 56 void FadeBackground(gfx::Canvas* canvas, | 56 void FadeBackground(gfx::CanvasSkia* canvas, |
| 57 double animation_value, | 57 double animation_value, |
| 58 const views::Background& background); | 58 const views::Background& background); |
| 59 | 59 |
| 60 InfoBarBackground error_background_; | 60 InfoBarBackground error_background_; |
| 61 scoped_ptr<ui::SlideAnimation> background_color_animation_; | 61 scoped_ptr<ui::SlideAnimation> background_color_animation_; |
| 62 | 62 |
| 63 DISALLOW_COPY_AND_ASSIGN(TranslateInfoBarBase); | 63 DISALLOW_COPY_AND_ASSIGN(TranslateInfoBarBase); |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 #endif // CHROME_BROWSER_UI_VIEWS_INFOBARS_TRANSLATE_INFOBAR_BASE_H_ | 66 #endif // CHROME_BROWSER_UI_VIEWS_INFOBARS_TRANSLATE_INFOBAR_BASE_H_ |
| OLD | NEW |