| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_TAB_CONTENTS_INFOBAR_H_ | 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_INFOBAR_H_ |
| 6 #define CHROME_BROWSER_TAB_CONTENTS_INFOBAR_H_ | 6 #define CHROME_BROWSER_TAB_CONTENTS_INFOBAR_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 class InfoBarContainer; | 33 class InfoBarContainer; |
| 34 class TabContentsWrapper; | 34 class TabContentsWrapper; |
| 35 | 35 |
| 36 class InfoBar : public ui::AnimationDelegate { | 36 class InfoBar : public ui::AnimationDelegate { |
| 37 public: | 37 public: |
| 38 InfoBar(TabContentsWrapper* owner, InfoBarDelegate* delegate); | 38 InfoBar(TabContentsWrapper* owner, InfoBarDelegate* delegate); |
| 39 virtual ~InfoBar(); | 39 virtual ~InfoBar(); |
| 40 | 40 |
| 41 // Platforms must define these. | 41 // Platforms must define these. |
| 42 static const int kDefaultBarTargetHeight; |
| 42 static const int kSeparatorLineHeight; | 43 static const int kSeparatorLineHeight; |
| 43 static const int kDefaultArrowTargetHeight; | 44 static const int kDefaultArrowTargetHeight; |
| 44 static const int kMaximumArrowTargetHeight; | 45 static const int kMaximumArrowTargetHeight; |
| 45 // The half-width (see comments on |arrow_half_width_| below) scales to its | 46 // The half-width (see comments on |arrow_half_width_| below) scales to its |
| 46 // default and maximum values proportionally to how the height scales to its. | 47 // default and maximum values proportionally to how the height scales to its. |
| 47 static const int kDefaultArrowTargetHalfWidth; | 48 static const int kDefaultArrowTargetHalfWidth; |
| 48 static const int kMaximumArrowTargetHalfWidth; | 49 static const int kMaximumArrowTargetHalfWidth; |
| 49 | 50 |
| 50 InfoBarDelegate* delegate() { return delegate_; } | 51 InfoBarDelegate* delegate() { return delegate_; } |
| 51 void set_container(InfoBarContainer* container) { container_ = container; } | 52 void set_container(InfoBarContainer* container) { container_ = container; } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 67 // delegate once it is invisible. | 68 // delegate once it is invisible. |
| 68 void CloseSoon(); | 69 void CloseSoon(); |
| 69 | 70 |
| 70 const ui::SlideAnimation& animation() const { return animation_; } | 71 const ui::SlideAnimation& animation() const { return animation_; } |
| 71 int arrow_height() const { return arrow_height_; } | 72 int arrow_height() const { return arrow_height_; } |
| 72 int arrow_target_height() const { return arrow_target_height_; } | 73 int arrow_target_height() const { return arrow_target_height_; } |
| 73 int arrow_half_width() const { return arrow_half_width_; } | 74 int arrow_half_width() const { return arrow_half_width_; } |
| 74 int total_height() const { return arrow_height_ + bar_height_; } | 75 int total_height() const { return arrow_height_ + bar_height_; } |
| 75 | 76 |
| 76 protected: | 77 protected: |
| 77 // Platforms must define this. | |
| 78 static const int kDefaultBarTargetHeight; | |
| 79 | |
| 80 // ui::AnimationDelegate: | 78 // ui::AnimationDelegate: |
| 81 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; | 79 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; |
| 82 | 80 |
| 83 // Forwards a close request to our owner. | 81 // Forwards a close request to our owner. |
| 84 void RemoveSelf(); | 82 void RemoveSelf(); |
| 85 | 83 |
| 86 // Changes the target height of the main ("bar") portion of the infobar. | 84 // Changes the target height of the main ("bar") portion of the infobar. |
| 87 void SetBarTargetHeight(int height); | 85 void SetBarTargetHeight(int height); |
| 88 | 86 |
| 89 // Given a control with size |prefsize|, returns the centered y position | 87 // Given a control with size |prefsize|, returns the centered y position |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 int bar_target_height_; | 132 int bar_target_height_; |
| 135 | 133 |
| 136 DISALLOW_COPY_AND_ASSIGN(InfoBar); | 134 DISALLOW_COPY_AND_ASSIGN(InfoBar); |
| 137 }; | 135 }; |
| 138 | 136 |
| 139 #elif defined(OS_MACOSX) | 137 #elif defined(OS_MACOSX) |
| 140 #include "chrome/browser/ui/cocoa/infobars/infobar.h" | 138 #include "chrome/browser/ui/cocoa/infobars/infobar.h" |
| 141 #endif | 139 #endif |
| 142 | 140 |
| 143 #endif // CHROME_BROWSER_TAB_CONTENTS_INFOBAR_H_ | 141 #endif // CHROME_BROWSER_TAB_CONTENTS_INFOBAR_H_ |
| OLD | NEW |