summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-27 22:53:11 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-27 22:53:11 +0000
commit754b00892f26fe56ed59e8659e517ef4097f101a (patch)
tree4fb7d28025e37e9a5360baaccd221666976cab2c /views
parent7ecf29ce9af999e31929e8795d8d020d95219276 (diff)
downloadchromium_src-754b00892f26fe56ed59e8659e517ef4097f101a.zip
chromium_src-754b00892f26fe56ed59e8659e517ef4097f101a.tar.gz
chromium_src-754b00892f26fe56ed59e8659e517ef4097f101a.tar.bz2
views: Make View::GetBaseline() a const method.
BUG=72040 TEST=None R=ben@chromium.org Review URL: http://codereview.chromium.org/7086008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87107 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/controls/label.cc2
-rw-r--r--views/controls/label.h2
-rw-r--r--views/view.cc2
-rw-r--r--views/view.h2
4 files changed, 4 insertions, 4 deletions
diff --git a/views/controls/label.cc b/views/controls/label.cc
index dc5c4de..fc392aa 100644
--- a/views/controls/label.cc
+++ b/views/controls/label.cc
@@ -176,7 +176,7 @@ gfx::Insets Label::GetInsets() const {
return insets;
}
-int Label::GetBaseline() {
+int Label::GetBaseline() const {
return GetInsets().top() + font_.GetBaseline();
}
diff --git a/views/controls/label.h b/views/controls/label.h
index 2c3060d..24944cd 100644
--- a/views/controls/label.h
+++ b/views/controls/label.h
@@ -153,7 +153,7 @@ class Label : public View {
// Overridden from View:
virtual gfx::Insets GetInsets() const;
- virtual int GetBaseline() OVERRIDE;
+ virtual int GetBaseline() const OVERRIDE;
// Overridden to compute the size required to display this label.
virtual gfx::Size GetPreferredSize() OVERRIDE;
// Return the height necessary to display this label with the provided width.
diff --git a/views/view.cc b/views/view.cc
index eb6bd04..8fa73c0 100644
--- a/views/view.cc
+++ b/views/view.cc
@@ -333,7 +333,7 @@ gfx::Size View::GetPreferredSize() {
return gfx::Size();
}
-int View::GetBaseline() {
+int View::GetBaseline() const {
return -1;
}
diff --git a/views/view.h b/views/view.h
index 957e195..4f6f0e3 100644
--- a/views/view.h
+++ b/views/view.h
@@ -286,7 +286,7 @@ class View : public AcceleratorTarget {
// Returns the baseline of this view, or -1 if this view has no baseline. The
// return value is relative to the preferred height.
- virtual int GetBaseline();
+ virtual int GetBaseline() const;
// Get the size the View would like to be, if enough space were available.
virtual gfx::Size GetPreferredSize();