summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authoroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-05 22:02:18 +0000
committeroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-05 22:02:18 +0000
commit2e5cc5f3deae4aa459b8d5f9188c7cf766b7c08f (patch)
treed97df15a49e7f28e07462b0f14d3e734e48bce44 /chrome
parent252b699b7bf6b8431e96901e6e960b84e41ab74e (diff)
downloadchromium_src-2e5cc5f3deae4aa459b8d5f9188c7cf766b7c08f.zip
chromium_src-2e5cc5f3deae4aa459b8d5f9188c7cf766b7c08f.tar.gz
chromium_src-2e5cc5f3deae4aa459b8d5f9188c7cf766b7c08f.tar.bz2
1st step to implement notification panel for chromeos
- re-using views implementation, but removed layout related code - add NotificationPanel - added SetSize in BalloonViewHost. I needed this because I removed animation code and NativeViewHostGtk doesn't know about render view. I need to think a bit more to find out how to deal wit this. It's using existing balloon collection, but we may need one for chromeos (or may not). BUG=33306 TEST=none Review URL: http://codereview.chromium.org/572018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38255 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/app/generated_resources.grd3
-rw-r--r--chrome/browser/chromeos/notifications/balloon_view.cc228
-rw-r--r--chrome/browser/chromeos/notifications/balloon_view.h110
-rw-r--r--chrome/browser/chromeos/notifications/notification_panel.cc150
-rw-r--r--chrome/browser/chromeos/notifications/notification_panel.h58
-rw-r--r--chrome/browser/chromeos/panel_controller.cc1
-rw-r--r--chrome/browser/views/notifications/balloon_view_host.cc1
-rwxr-xr-xchrome/chrome_browser.gypi8
8 files changed, 557 insertions, 2 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index 0c83225..329a033 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -6884,6 +6884,9 @@ Keep your key file in a safe place. You will need it to create new versions of y
<message name="IDS_LOGIN_ERROR_NO_NETWORK_LIBRARY" desc="Couldn't log in because nework library couldn't be loaded">
Can't access network library
</message>
+ <message name="IDS_NOTIFICATION_PANEL_TITLE" desc="Text for the title of the notification panel.">
+ Notifications
+ </message>
</if>
<message name="IDS_BOOKMARK_BAR_IMPORT_LINK" desc="text shown for importing ">
Import bookmarks now...
diff --git a/chrome/browser/chromeos/notifications/balloon_view.cc b/chrome/browser/chromeos/notifications/balloon_view.cc
new file mode 100644
index 0000000..489ac49
--- /dev/null
+++ b/chrome/browser/chromeos/notifications/balloon_view.cc
@@ -0,0 +1,228 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/chromeos/notifications/balloon_view.h"
+
+#include <vector>
+
+#include "app/l10n_util.h"
+#include "app/resource_bundle.h"
+#include "base/message_loop.h"
+#include "base/string_util.h"
+#include "chrome/browser/chromeos/notifications/notification_panel.h"
+#include "chrome/browser/notifications/balloon.h"
+#include "chrome/browser/notifications/desktop_notification_service.h"
+#include "chrome/browser/profile.h"
+#include "chrome/browser/views/notifications/balloon_view_host.h"
+#include "chrome/common/notification_details.h"
+#include "chrome/common/notification_source.h"
+#include "chrome/common/notification_type.h"
+#include "grit/generated_resources.h"
+#include "grit/theme_resources.h"
+#include "views/controls/button/menu_button.h"
+#include "views/controls/button/text_button.h"
+#include "views/controls/menu/menu_2.h"
+#include "views/widget/root_view.h"
+
+namespace {
+// Menu commands
+const int kRevokePermissionCommand = 0;
+
+} // namespace
+
+BalloonViewImpl::BalloonViewImpl()
+ : balloon_(NULL),
+ html_contents_(NULL),
+ method_factory_(this),
+ close_button_(NULL),
+ options_menu_contents_(NULL),
+ options_menu_menu_(NULL),
+ options_menu_button_(NULL) {
+ // This object is not to be deleted by the views hierarchy,
+ // as it is owned by the balloon.
+ set_parent_owned(false);
+}
+
+BalloonViewImpl::~BalloonViewImpl() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// BallonViewImpl, BalloonView implementation.
+
+void BalloonViewImpl::Show(Balloon* balloon) {
+ ResourceBundle& rb = ResourceBundle::GetSharedInstance();
+ const std::wstring source_label_text = l10n_util::GetStringF(
+ IDS_NOTIFICATION_BALLOON_SOURCE_LABEL,
+ balloon->notification().display_source());
+ const std::wstring options_text =
+ l10n_util::GetString(IDS_NOTIFICATION_OPTIONS_MENU_LABEL);
+ const std::wstring dismiss_text =
+ l10n_util::GetString(IDS_NOTIFICATION_BALLOON_DISMISS_LABEL);
+ balloon_ = balloon;
+
+ html_contents_ = new BalloonViewHost(balloon);
+ AddChildView(html_contents_);
+ close_button_ = new views::TextButton(this, dismiss_text);
+ close_button_->SetIcon(*rb.GetBitmapNamed(IDR_BALLOON_CLOSE));
+ close_button_->SetHoverIcon(*rb.GetBitmapNamed(IDR_BALLOON_CLOSE_HOVER));
+ close_button_->SetFont(rb.GetFont(ResourceBundle::SmallFont));
+ close_button_->SetEnabledColor(SK_ColorWHITE);
+ close_button_->SetHoverColor(SK_ColorDKGRAY);
+ close_button_->set_alignment(views::TextButton::ALIGN_CENTER);
+ close_button_->set_icon_placement(views::TextButton::ICON_ON_RIGHT);
+ AddChildView(close_button_);
+
+ options_menu_button_ = new views::MenuButton(NULL, options_text, this, false);
+ options_menu_button_->SetFont(rb.GetFont(ResourceBundle::SmallFont));
+ options_menu_button_->SetIcon(*rb.GetBitmapNamed(IDR_BALLOON_OPTIONS_ARROW));
+ options_menu_button_->SetHoverIcon(
+ *rb.GetBitmapNamed(IDR_BALLOON_OPTIONS_ARROW_HOVER));
+ options_menu_button_->set_alignment(views::TextButton::ALIGN_CENTER);
+ options_menu_button_->set_icon_placement(views::TextButton::ICON_ON_RIGHT);
+ options_menu_button_->SetEnabledColor(SK_ColorWHITE);
+ options_menu_button_->SetHoverColor(SK_ColorDKGRAY);
+ AddChildView(options_menu_button_);
+
+ source_label_ = new views::Label(source_label_text);
+ source_label_->SetFont(rb.GetFont(ResourceBundle::SmallFont));
+ source_label_->SetColor(SK_ColorWHITE);
+ source_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT);
+ AddChildView(source_label_);
+
+ SetBounds(0, 0,
+ balloon_->content_size().width(),
+ balloon_->content_size().height() +
+ close_button_->GetPreferredSize().height());
+
+ // TODO(oshima): We're not sure if this is the right place to
+ // add & show in the panel. Revisit the deisgn once we have a collection
+ // for chromeos.
+ chromeos::NotificationPanel::Get()->Add(this);
+ chromeos::NotificationPanel::Get()->Show();
+ notification_registrar_.Add(this,
+ NotificationType::NOTIFY_BALLOON_DISCONNECTED, Source<Balloon>(balloon));
+}
+
+void BalloonViewImpl::Close(bool by_user) {
+ MessageLoop::current()->PostTask(FROM_HERE,
+ method_factory_.NewRunnableMethod(
+ &BalloonViewImpl::DelayedClose, by_user));
+}
+
+gfx::Size BalloonViewImpl::GetSize() const {
+ // Not used. The layout is managed by the Panel.
+ return gfx::Size(0, 0);
+}
+
+void BalloonViewImpl::RepositionToBalloon() {
+ // Not used. The layout is managed by the Panel.
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// views::View interface overrides.
+
+void BalloonViewImpl::Layout() {
+ gfx::Size button_size = close_button_->GetPreferredSize();
+
+ int x = width() - button_size.width();
+ int y = height() - button_size.height();
+
+ html_contents_->SetBounds(0, 0, width(), y);
+
+ close_button_->SetBounds(x, y, button_size.width(), button_size.height());
+ x -= close_button_->GetPreferredSize().width();
+ options_menu_button_->SetBounds(
+ x, y, button_size.width(), button_size.height());
+ source_label_->SetBounds(0, y, x, button_size.height());
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// views::ViewMenuDelegate implementation.
+
+void BalloonViewImpl::RunMenu(views::View* source, const gfx::Point& pt) {
+ CreateOptionsMenu();
+ options_menu_menu_->RunMenuAt(pt, views::Menu2::ALIGN_TOPRIGHT);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// views::Button implementation.
+
+void BalloonViewImpl::ButtonPressed(views::Button* sender,
+ const views::Event&) {
+ Close(true);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// menus::SimpleMenuModel::Delegate implementation.
+
+bool BalloonViewImpl::IsCommandIdChecked(int /* command_id */) const {
+ // Nothing in the menu is checked.
+ return false;
+}
+
+bool BalloonViewImpl::IsCommandIdEnabled(int /* command_id */) const {
+ // All the menu options are always enabled.
+ return true;
+}
+
+bool BalloonViewImpl::GetAcceleratorForCommandId(
+ int /* command_id */, menus::Accelerator* /* accelerator */) {
+ // Currently no accelerators.
+ return false;
+}
+
+void BalloonViewImpl::ExecuteCommand(int command_id) {
+ DesktopNotificationService* service =
+ balloon_->profile()->GetDesktopNotificationService();
+ switch (command_id) {
+ case kRevokePermissionCommand:
+ service->DenyPermission(balloon_->notification().origin_url());
+ break;
+ default:
+ NOTIMPLEMENTED();
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// NotificationObserver overrides.
+
+void BalloonViewImpl::Observe(NotificationType type,
+ const NotificationSource& source,
+ const NotificationDetails& details) {
+ if (type != NotificationType::NOTIFY_BALLOON_DISCONNECTED) {
+ NOTREACHED();
+ return;
+ }
+
+ // If the renderer process attached to this balloon is disconnected
+ // (e.g., because of a crash), we want to close the balloon.
+ notification_registrar_.Remove(this,
+ NotificationType::NOTIFY_BALLOON_DISCONNECTED, Source<Balloon>(balloon_));
+ Close(false);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// BalloonViewImpl private.
+
+void BalloonViewImpl::CreateOptionsMenu() {
+ if (options_menu_contents_.get())
+ return;
+
+ const string16 label_text = WideToUTF16Hack(l10n_util::GetStringF(
+ IDS_NOTIFICATION_BALLOON_REVOKE_MESSAGE,
+ this->balloon_->notification().display_source()));
+
+ options_menu_contents_.reset(new menus::SimpleMenuModel(this));
+ options_menu_contents_->AddItem(kRevokePermissionCommand, label_text);
+
+ options_menu_menu_.reset(new views::Menu2(options_menu_contents_.get()));
+}
+
+void BalloonViewImpl::DelayedClose(bool by_user) {
+ html_contents_->Shutdown();
+ // Remove html_contents from panel.
+ chromeos::NotificationPanel::Get()->Remove(this);
+
+ balloon_->OnClose(by_user);
+}
diff --git a/chrome/browser/chromeos/notifications/balloon_view.h b/chrome/browser/chromeos/notifications/balloon_view.h
new file mode 100644
index 0000000..5b4fcfa
--- /dev/null
+++ b/chrome/browser/chromeos/notifications/balloon_view.h
@@ -0,0 +1,110 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Draws the view for the balloons.
+
+#ifndef CHROME_BROWSER_CHROMEOS_NOTIFICATIONS_BALLOON_VIEW_H_
+#define CHROME_BROWSER_CHROMEOS_NOTIFICATIONS_BALLOON_VIEW_H_
+
+#include "app/gfx/path.h"
+#include "app/menus/simple_menu_model.h"
+#include "base/basictypes.h"
+#include "base/gfx/point.h"
+#include "base/gfx/rect.h"
+#include "base/gfx/size.h"
+#include "base/scoped_ptr.h"
+#include "base/task.h"
+#include "chrome/browser/notifications/balloon.h"
+#include "chrome/common/notification_registrar.h"
+#include "chrome/common/notification_service.h"
+#include "views/controls/button/button.h"
+#include "views/controls/label.h"
+#include "views/controls/menu/view_menu_delegate.h"
+#include "views/view.h"
+
+namespace views {
+class Menu2;
+class MenuButton;
+class TextButton;
+} // namespace views
+
+class BalloonViewHost;
+class NotificationDetails;
+class NotificationSource;
+
+// A balloon view is the UI component for a notification panel.
+class BalloonViewImpl : public BalloonView,
+ public views::View,
+ public views::ViewMenuDelegate,
+ public menus::SimpleMenuModel::Delegate,
+ public NotificationObserver,
+ public views::ButtonListener {
+ // views::View interface.
+ public:
+ BalloonViewImpl();
+ ~BalloonViewImpl();
+
+ // BalloonView interface.
+ void Show(Balloon* balloon);
+ void Close(bool by_user);
+ void RepositionToBalloon();
+ gfx::Size GetSize() const;
+
+ private:
+ // views::View interface.
+ virtual gfx::Size GetPreferredSize() {
+ return gfx::Size(1000, 1000);
+ }
+ virtual void Layout();
+
+ // views::ViewMenuDelegate interface.
+ virtual void RunMenu(views::View* source, const gfx::Point& pt);
+
+ // views::ButtonListener interface.
+ virtual void ButtonPressed(views::Button* sender, const views::Event&);
+
+ // menus::SimpleMenuModel::Delegate interface.
+ virtual bool IsCommandIdChecked(int command_id) const;
+ virtual bool IsCommandIdEnabled(int command_id) const;
+ virtual bool GetAcceleratorForCommandId(int command_id,
+ menus::Accelerator* accelerator);
+ virtual void ExecuteCommand(int command_id);
+
+ // NotificationObserver interface.
+ virtual void Observe(NotificationType type,
+ const NotificationSource& source,
+ const NotificationDetails& details);
+
+ // Initializes the options menu.
+ void CreateOptionsMenu();
+
+ // Do the delayed close work.
+ void DelayedClose(bool by_user);
+
+ // Non-owned pointer to the balloon which owns this object.
+ Balloon* balloon_;
+
+ // The renderer of the HTML contents. Pointer owned by the views hierarchy.
+ BalloonViewHost* html_contents_;
+
+ // The following factory is used to call methods at a later time.
+ ScopedRunnableMethodFactory<BalloonViewImpl> method_factory_;
+
+ // Pointer to sub-view is owned by the View sub-class.
+ views::TextButton* close_button_;
+
+ // Pointer to sub-view is owned by View class.
+ views::Label* source_label_;
+
+ // The options menu.
+ scoped_ptr<menus::SimpleMenuModel> options_menu_contents_;
+ scoped_ptr<views::Menu2> options_menu_menu_;
+ views::MenuButton* options_menu_button_;
+
+ NotificationRegistrar notification_registrar_;
+
+ DISALLOW_COPY_AND_ASSIGN(BalloonViewImpl);
+};
+
+#endif // CHROME_BROWSER_CHROMEOS_NOTIFICATIONS_BALLOON_VIEW_H_
diff --git a/chrome/browser/chromeos/notifications/notification_panel.cc b/chrome/browser/chromeos/notifications/notification_panel.cc
new file mode 100644
index 0000000..46c5b81
--- /dev/null
+++ b/chrome/browser/chromeos/notifications/notification_panel.cc
@@ -0,0 +1,150 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Draws the view for the balloons.
+
+#include "chrome/browser/chromeos/notifications/notification_panel.h"
+
+#include "app/gfx/canvas.h"
+#include "app/l10n_util.h"
+#include "app/resource_bundle.h"
+#include "base/singleton.h"
+#include "chrome/browser/chromeos/notifications/balloon_view.h"
+#include "grit/generated_resources.h"
+#include "views/background.h"
+#include "views/widget/widget_gtk.h"
+
+namespace chromeos {
+
+class BalloonContainer : public views::View {
+ public:
+ explicit BalloonContainer(int margin)
+ : View(),
+ margin_(margin) {
+ }
+
+ virtual ~BalloonContainer() {}
+
+ // views::View overrides.
+ virtual gfx::Size GetPreferredSize() {
+ return preferred_size_;
+ }
+
+ virtual void Layout() {
+ // Layout bottom up
+ int count = GetChildViewCount();
+ int height = 0;
+ for (int i = count - 1; i >= 0; --i) {
+ views::View* child = GetChildViewAt(i);
+ child->SetBounds(0, height, child->width(), child->height());
+ height += child->height() + margin_;
+ }
+ SchedulePaint();
+ }
+
+ // Updates the bound so that it can show all balloons.
+ void UpdateBounds() {
+ int height = 0;
+ int max_width = 0;
+ for (int i = GetChildViewCount() - 1; i >= 0; --i) {
+ views::View* c = GetChildViewAt(i);
+ height += c->height() + margin_;
+ max_width = std::max(max_width, c->width());
+ }
+ if (height > 0) height -= margin_;
+ preferred_size_.set_width(max_width);
+ preferred_size_.set_height(height);
+ PreferredSizeChanged();
+ SizeToPreferredSize();
+ }
+
+ private:
+ gfx::Size preferred_size_;
+ int margin_;
+};
+
+// static
+NotificationPanel* NotificationPanel::Get() {
+ return Singleton<NotificationPanel>::get();
+}
+
+NotificationPanel::NotificationPanel()
+ : panel_widget_(NULL) {
+ Init();
+}
+
+NotificationPanel::~NotificationPanel() {
+}
+
+gfx::Rect NotificationPanel::GetPanelBounds() {
+ gfx::Size pref_size = balloon_container_->GetPreferredSize();
+ int new_height = pref_size.height();
+ return gfx::Rect(0, 0, pref_size.width(), new_height);
+}
+
+void NotificationPanel::Init() {
+ DCHECK(!panel_widget_.get());
+ balloon_container_ = new BalloonContainer(1);
+ balloon_container_->set_parent_owned(false);
+ balloon_container_->set_background(
+ views::Background::CreateSolidBackground(ResourceBundle::frame_color));
+}
+
+void NotificationPanel::Add(BalloonViewImpl* view) {
+ balloon_container_->AddChildView(view);
+ balloon_container_->UpdateBounds();
+ balloon_container_->Layout();
+ if (panel_widget_.get()) {
+ panel_widget_->SetBounds(GetPanelBounds());
+ }
+}
+
+void NotificationPanel::Remove(BalloonViewImpl* view) {
+ balloon_container_->RemoveChildView(view);
+ balloon_container_->UpdateBounds();
+ balloon_container_->Layout();
+ if (panel_widget_.get()) {
+ if (balloon_container_->GetChildViewCount() == 0) {
+ Hide();
+ } else {
+ panel_widget_->SetBounds(GetPanelBounds());
+ }
+ }
+}
+
+void NotificationPanel::Show() {
+ if (!panel_widget_.get()) {
+ // TODO(oshima): Using window because Popup widget behaves weird
+ // when resizing. This needs to be investigated.
+ panel_widget_.reset(new views::WidgetGtk(views::WidgetGtk::TYPE_WINDOW));
+ panel_widget_->Init(NULL, GetPanelBounds());
+ panel_widget_->SetContentsView(balloon_container_);
+ panel_controller_.reset(
+ new PanelController(this,
+ GTK_WINDOW(panel_widget_->GetNativeView()),
+ gfx::Rect(0, 0, 1000, 1000)));
+ }
+ panel_widget_->Show();
+}
+
+void NotificationPanel::Hide() {
+ if (panel_widget_.get()) {
+ panel_widget_.release()->Close();
+ panel_controller_.release()->Close();
+ }
+}
+
+string16 NotificationPanel::GetPanelTitle() {
+ return string16(l10n_util::GetStringUTF16(IDS_NOTIFICATION_PANEL_TITLE));
+}
+
+SkBitmap NotificationPanel::GetPanelIcon() {
+ return SkBitmap();
+}
+
+void NotificationPanel::ClosePanel() {
+ panel_widget_.release()->Close();
+}
+
+} // namespace chromeos
diff --git a/chrome/browser/chromeos/notifications/notification_panel.h b/chrome/browser/chromeos/notifications/notification_panel.h
new file mode 100644
index 0000000..5a02441
--- /dev/null
+++ b/chrome/browser/chromeos/notifications/notification_panel.h
@@ -0,0 +1,58 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Draws the view for the balloons.
+
+#ifndef CHROME_BROWSER_CHROMEOS_NOTIFICATIONS_NOTIFICATION_PANEL_H_
+#define CHROME_BROWSER_CHROMEOS_NOTIFICATIONS_NOTIFICATION_PANEL_H_
+
+#include "base/gfx/rect.h"
+#include "base/scoped_ptr.h"
+#include "base/singleton.h"
+#include "chrome/browser/chromeos/panel_controller.h"
+
+class BalloonViewImpl;
+
+namespace chromeos {
+
+class BalloonContainer;
+
+class NotificationPanel : PanelController::Delegate {
+ public:
+ // Returns the Singleton instance of NotificationPanel.
+ static NotificationPanel* Get();
+
+ // Adds/Removes a ballon view.
+ void Add(BalloonViewImpl* view);
+ void Remove(BalloonViewImpl* view);
+
+ // Shows/Hides the Panel.
+ void Show();
+ void Hide();
+
+ // PanelController overrides.
+ virtual string16 GetPanelTitle();
+ virtual SkBitmap GetPanelIcon();
+ virtual void ClosePanel();
+
+ private:
+ friend struct DefaultSingletonTraits<NotificationPanel>;
+
+ NotificationPanel();
+ virtual ~NotificationPanel();
+
+ void Init();
+ // Returns the panel's bounds in the screen's coordinates.
+ // The position will be controlled by window manager so
+ // the origin is always (0, 0).
+ gfx::Rect GetPanelBounds();
+
+ BalloonContainer* balloon_container_;
+ scoped_ptr<views::Widget> panel_widget_;
+ scoped_ptr<PanelController> panel_controller_;
+};
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_CHROMEOS_NOTIFICATIONS_NOTIFICATION_PANEL_H_
diff --git a/chrome/browser/chromeos/panel_controller.cc b/chrome/browser/chromeos/panel_controller.cc
index 8f8b491..a8c5d76 100644
--- a/chrome/browser/chromeos/panel_controller.cc
+++ b/chrome/browser/chromeos/panel_controller.cc
@@ -115,6 +115,7 @@ void PanelController::Init(const gfx::Rect window_bounds) {
title_content_ = new TitleContentView(this);
title_window_->SetContentsView(title_content_);
+ UpdateTitleBar();
title_window_->Show();
}
diff --git a/chrome/browser/views/notifications/balloon_view_host.cc b/chrome/browser/views/notifications/balloon_view_host.cc
index 6e05160..125ee4b 100644
--- a/chrome/browser/views/notifications/balloon_view_host.cc
+++ b/chrome/browser/views/notifications/balloon_view_host.cc
@@ -134,6 +134,7 @@ void BalloonViewHost::Init(gfx::NativeView parent_hwnd) {
static_cast<RenderWidgetHostViewGtk*>(view);
view_gtk->InitAsChild();
Attach(view_gtk->native_view());
+ view->SetSize(gfx::Size(width(), height()));
#else
NOTIMPLEMENTED();
#endif
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index 6b6ddbd..133b951 100755
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -255,6 +255,10 @@
'browser/chrome_plugin_host.h',
'browser/chrome_thread.cc',
'browser/chrome_thread.h',
+ 'browser/chromeos/notifications/balloon_view.h',
+ 'browser/chromeos/notifications/balloon_view.cc',
+ 'browser/chromeos/notifications/notification_panel.h',
+ 'browser/chromeos/notifications/notification_panel.cc',
'browser/chromeos/browser_notification_observers.cc',
'browser/chromeos/browser_extenders.cc',
'browser/chromeos/browser_view.cc',
@@ -2429,8 +2433,6 @@
['include', '^browser/views/page_info_window_view.cc'],
['include', '^browser/views/notifications/balloon_view_host.cc'],
['include', '^browser/views/notifications/balloon_view_host.h'],
- ['include', '^browser/views/notifications/balloon_view.cc'],
- ['include', '^browser/views/notifications/balloon_view.h'],
# Not necessary unless you're trying to build ChromeOS+views.
#['include', '^browser/views/panels/panel_scroller.cc'],
#['include', '^browser/views/panels/panel_scroller.h'],
@@ -2568,6 +2570,8 @@
['include', '^browser/views/frame/standard_extender.cc'],
['include', '^browser/gtk/external_protocol_dialog_gtk.cc'],
['include', '^browser/gtk/external_protocol_dialog_gtk.h'],
+ ['include', '^browser/views/notifications/balloon_view.cc'],
+ ['include', '^browser/views/notifications/balloon_view.h'],
],
}],
['OS=="linux" and chromeos==0 and toolkit_views==0', {