summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos
diff options
context:
space:
mode:
authorjohnnyg@chromium.org <johnnyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-23 23:39:09 +0000
committerjohnnyg@chromium.org <johnnyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-23 23:39:09 +0000
commit9e9e55c35954a06b68d5e62a27fa1ea60675d6f2 (patch)
treeaa031fb90182ccd30df76f9d7947c36799ec611d /chrome/browser/chromeos
parent475b996b15bd1010869876e6d70e4c79bc1fea05 (diff)
downloadchromium_src-9e9e55c35954a06b68d5e62a27fa1ea60675d6f2.zip
chromium_src-9e9e55c35954a06b68d5e62a27fa1ea60675d6f2.tar.gz
chromium_src-9e9e55c35954a06b68d5e62a27fa1ea60675d6f2.tar.bz2
Refactor BalloonViewHost, removing a lot of duplicate code that crept into notifications during the port to mac & linux and making behavior more consistent.
BUG=34826 TEST=notifications on each platform. Review URL: http://codereview.chromium.org/1055005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42404 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos')
-rw-r--r--chrome/browser/chromeos/notifications/balloon_view.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/chrome/browser/chromeos/notifications/balloon_view.cc b/chrome/browser/chromeos/notifications/balloon_view.cc
index 6b9c4f0..af66adf 100644
--- a/chrome/browser/chromeos/notifications/balloon_view.cc
+++ b/chrome/browser/chromeos/notifications/balloon_view.cc
@@ -72,7 +72,7 @@ void BalloonViewImpl::Show(Balloon* balloon) {
balloon_ = balloon;
html_contents_ = new BalloonViewHost(balloon);
- AddChildView(html_contents_);
+ AddChildView(html_contents_->view());
if (controls_) {
close_button_ = new views::TextButton(this, dismiss_text);
close_button_->SetIcon(*rb.GetBitmapNamed(IDR_BALLOON_CLOSE));
@@ -109,8 +109,9 @@ void BalloonViewImpl::Show(Balloon* balloon) {
void BalloonViewImpl::Update() {
stale_ = false;
- html_contents_->render_view_host()->NavigateToURL(
- balloon_->notification().content_url());
+ if (html_contents_->render_view_host())
+ html_contents_->render_view_host()->NavigateToURL(
+ balloon_->notification().content_url());
}
void BalloonViewImpl::Close(bool by_user) {
@@ -145,7 +146,7 @@ void BalloonViewImpl::Layout() {
int x = width() - button_size.width();
int y = height() - button_size.height();
- html_contents_->SetBounds(0, 0, width(), y);
+ html_contents_->view()->SetBounds(0, 0, width(), y);
if (html_contents_->render_view_host()) {
RenderWidgetHostView* view = html_contents_->render_view_host()->view();
if (view)