diff options
author | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-24 16:03:23 +0000 |
---|---|---|
committer | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-24 16:03:23 +0000 |
commit | c0f9bf1d9efa6ce1e6442d5f5fb82ff637d6405c (patch) | |
tree | 4683feaf9970a558d064c5d19d108d24d279de21 /views | |
parent | aeaf2b2fa41307829e1a9ba4f51fa95ba2b54732 (diff) | |
download | chromium_src-c0f9bf1d9efa6ce1e6442d5f5fb82ff637d6405c.zip chromium_src-c0f9bf1d9efa6ce1e6442d5f5fb82ff637d6405c.tar.gz chromium_src-c0f9bf1d9efa6ce1e6442d5f5fb82ff637d6405c.tar.bz2 |
Add a first run bubble to show after installing an extension app.
This is similar to what we show when installing a page action or
browser action, albeit with a slightly different text.
Also disable the install warning for extension apps, for the time
being.
And finally, in tab_strip.cc I accidentally checked in a comment,
which I had commented out during testing. It was supposed to be
on (related to my last cl).
BUG=None
TEST=Install an extension app, notice a first run bubble instead
of a installation warning. The first run bubble should have a
checkbox allowing you to create a desktop shortcut.
Review URL: http://codereview.chromium.org/1693008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45537 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r-- | views/controls/button/checkbox.cc | 15 | ||||
-rw-r--r-- | views/controls/button/checkbox.h | 1 |
2 files changed, 15 insertions, 1 deletions
diff --git a/views/controls/button/checkbox.cc b/views/controls/button/checkbox.cc index 1fcbea3..967d5eb 100644 --- a/views/controls/button/checkbox.cc +++ b/views/controls/button/checkbox.cc @@ -72,6 +72,19 @@ gfx::Size Checkbox::GetPreferredSize() { return prefsize; } +int Checkbox::GetHeightForWidth(int w) { + if (!native_wrapper_) + return 0; + + gfx::Size prefsize = native_wrapper_->GetView()->GetPreferredSize(); + if (native_wrapper_->UsesNativeLabel()) + return prefsize.height(); + + int width = prefsize.width() + kCheckboxLabelSpacing + + kLabelFocusPaddingHorizontal * 2; + return label_->GetHeightForWidth(std::max(prefsize.height(), w - width)); +} + void Checkbox::Layout() { if (!native_wrapper_) return; @@ -162,7 +175,7 @@ bool Checkbox::GetAccessibleRole(AccessibilityTypes::Role* role) { bool Checkbox::GetAccessibleState(AccessibilityTypes::State* state) { DCHECK(state); - + *state = checked() ? AccessibilityTypes::STATE_CHECKED : 0; return true; } diff --git a/views/controls/button/checkbox.h b/views/controls/button/checkbox.h index bea240a..736c095 100644 --- a/views/controls/button/checkbox.h +++ b/views/controls/button/checkbox.h @@ -42,6 +42,7 @@ class Checkbox : public NativeButton { // Overridden from View: virtual gfx::Size GetPreferredSize(); + virtual int GetHeightForWidth(int w); virtual void Layout(); virtual void SetEnabled(bool enabled); virtual void PaintFocusBorder(gfx::Canvas* canvas); |