Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(211)

Side by Side Diff: chrome/browser/ui/views/infobars/infobar_view.h

Issue 273223002: views: Make view::Views::GetPreferredSize() const. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More compile fix for ToT Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_VIEWS_INFOBARS_INFOBAR_VIEW_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_INFOBARS_INFOBAR_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_INFOBARS_INFOBAR_VIEW_H_ 6 #define CHROME_BROWSER_UI_VIEWS_INFOBARS_INFOBAR_VIEW_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "components/infobars/core/infobar.h" 10 #include "components/infobars/core/infobar.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 80
81 // views::ButtonListener: 81 // views::ButtonListener:
82 // NOTE: This must not be called if we're unowned. (Subclasses should ignore 82 // NOTE: This must not be called if we're unowned. (Subclasses should ignore
83 // calls to ButtonPressed() in this case.) 83 // calls to ButtonPressed() in this case.)
84 virtual void ButtonPressed(views::Button* sender, 84 virtual void ButtonPressed(views::Button* sender,
85 const ui::Event& event) OVERRIDE; 85 const ui::Event& event) OVERRIDE;
86 86
87 // Returns the minimum width the content (that is, everything between the icon 87 // Returns the minimum width the content (that is, everything between the icon
88 // and the close button) can be shrunk to. This is used to prevent the close 88 // and the close button) can be shrunk to. This is used to prevent the close
89 // button from overlapping views that cannot be shrunk any further. 89 // button from overlapping views that cannot be shrunk any further.
90 virtual int ContentMinimumWidth(); 90 virtual int ContentMinimumWidth() const;
91 91
92 // These return x coordinates delimiting the usable area for subclasses to lay 92 // These return x coordinates delimiting the usable area for subclasses to lay
93 // out their controls. 93 // out their controls.
94 int StartX() const; 94 int StartX() const;
95 int EndX() const; 95 int EndX() const;
96 96
97 // Given a |view|, returns the centered y position within us, taking into 97 // Given a |view|, returns the centered y position within us, taking into
98 // account animation so the control "slides in" (or out) as we animate open 98 // account animation so the control "slides in" (or out) as we animate open
99 // and closed. 99 // and closed.
100 int OffsetY(views::View* view) const; 100 int OffsetY(views::View* view) const;
(...skipping 13 matching lines...) Expand all
114 // decreasing preferred width. 114 // decreasing preferred width.
115 static void AssignWidthsSorted(Labels* labels, int available_width); 115 static void AssignWidthsSorted(Labels* labels, int available_width);
116 116
117 // InfoBar: 117 // InfoBar:
118 virtual void PlatformSpecificShow(bool animate) OVERRIDE; 118 virtual void PlatformSpecificShow(bool animate) OVERRIDE;
119 virtual void PlatformSpecificHide(bool animate) OVERRIDE; 119 virtual void PlatformSpecificHide(bool animate) OVERRIDE;
120 virtual void PlatformSpecificOnHeightsRecalculated() OVERRIDE; 120 virtual void PlatformSpecificOnHeightsRecalculated() OVERRIDE;
121 121
122 // views::View: 122 // views::View:
123 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE; 123 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE;
124 virtual gfx::Size GetPreferredSize() OVERRIDE; 124 virtual gfx::Size GetPreferredSize() const OVERRIDE;
125 virtual void PaintChildren(gfx::Canvas* canvas, 125 virtual void PaintChildren(gfx::Canvas* canvas,
126 const views::CullSet& cull_set) OVERRIDE; 126 const views::CullSet& cull_set) OVERRIDE;
127 127
128 // views::ExternalFocusTracker: 128 // views::ExternalFocusTracker:
129 virtual void OnWillChangeFocus(View* focused_before, 129 virtual void OnWillChangeFocus(View* focused_before,
130 View* focused_now) OVERRIDE; 130 View* focused_now) OVERRIDE;
131 131
132 // The optional icon at the left edge of the InfoBar. 132 // The optional icon at the left edge of the InfoBar.
133 views::ImageView* icon_; 133 views::ImageView* icon_;
134 134
135 // The close button at the right edge of the InfoBar. 135 // The close button at the right edge of the InfoBar.
136 views::ImageButton* close_button_; 136 views::ImageButton* close_button_;
137 137
138 // The paths for the InfoBarBackground to draw, sized according to the heights 138 // The paths for the InfoBarBackground to draw, sized according to the heights
139 // above. 139 // above.
140 SkPath fill_path_; 140 SkPath fill_path_;
141 SkPath stroke_path_; 141 SkPath stroke_path_;
142 142
143 // Used to run the menu. 143 // Used to run the menu.
144 scoped_ptr<views::MenuRunner> menu_runner_; 144 scoped_ptr<views::MenuRunner> menu_runner_;
145 145
146 DISALLOW_COPY_AND_ASSIGN(InfoBarView); 146 DISALLOW_COPY_AND_ASSIGN(InfoBarView);
147 }; 147 };
148 148
149 #endif // CHROME_BROWSER_UI_VIEWS_INFOBARS_INFOBAR_VIEW_H_ 149 #endif // CHROME_BROWSER_UI_VIEWS_INFOBARS_INFOBAR_VIEW_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/infobars/infobar_container_view.cc ('k') | chrome/browser/ui/views/infobars/infobar_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698