diff options
Diffstat (limited to 'chrome/browser/chromeos')
5 files changed, 23 insertions, 6 deletions
diff --git a/chrome/browser/chromeos/frame/panel_browser_view.cc b/chrome/browser/chromeos/frame/panel_browser_view.cc index 62bce29..0dda082 100644 --- a/chrome/browser/chromeos/frame/panel_browser_view.cc +++ b/chrome/browser/chromeos/frame/panel_browser_view.cc @@ -10,7 +10,8 @@ namespace chromeos { PanelBrowserView::PanelBrowserView(Browser* browser) - : BrowserView(browser) { + : BrowserView(browser), + creator_xid_(0) { } //////////////////////////////////////////////////////////////////////////////// @@ -35,7 +36,7 @@ void PanelBrowserView::Init() { void PanelBrowserView::Show() { panel_controller_.reset(new PanelController(this, GetNativeHandle())); - panel_controller_->Init(true /* focus when opened */, bounds()); + panel_controller_->Init(true /* focus when opened */, bounds(), creator_xid_); BrowserView::Show(); } @@ -61,6 +62,12 @@ void PanelBrowserView::ActivationChanged(bool activated) { } } +void PanelBrowserView::SetCreatorView(PanelBrowserView* creator) { + DCHECK(creator); + GtkWindow* window = creator->GetNativeHandle(); + creator_xid_ = x11_util::GetX11WindowFromGtkWidget(GTK_WIDGET(window)); +} + //////////////////////////////////////////////////////////////////////////////// // PanelController::Delegate overrides. diff --git a/chrome/browser/chromeos/frame/panel_browser_view.h b/chrome/browser/chromeos/frame/panel_browser_view.h index 5e8b770..c3d7ec3 100644 --- a/chrome/browser/chromeos/frame/panel_browser_view.h +++ b/chrome/browser/chromeos/frame/panel_browser_view.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_CHROMEOS_FRAME_PANEL_BROWSER_VIEW_H_ #define CHROME_BROWSER_CHROMEOS_FRAME_PANEL_BROWSER_VIEW_H_ +#include "app/x11_util.h" #include "base/scoped_ptr.h" #include "chrome/browser/chromeos/frame/panel_controller.h" #include "chrome/browser/views/frame/browser_view.h" @@ -28,6 +29,8 @@ class PanelBrowserView : public BrowserView, virtual void UpdateTitleBar(); virtual void ActivationChanged(bool activated); + virtual void SetCreatorView(PanelBrowserView* creator); + // PanelController::Delegate overrides virtual string16 GetPanelTitle(); virtual SkBitmap GetPanelIcon(); @@ -38,6 +41,10 @@ class PanelBrowserView : public BrowserView, // Controls interactions with the window manager for popup panels. scoped_ptr<chromeos::PanelController> panel_controller_; + // X id for the content window of the panel that created this + // panel. This tells ChromeOS that it should be created next to the + // content window of this panel. + XID creator_xid_; DISALLOW_COPY_AND_ASSIGN(PanelBrowserView); }; diff --git a/chrome/browser/chromeos/frame/panel_controller.cc b/chrome/browser/chromeos/frame/panel_controller.cc index 1c0aa1c..7d0e5f3 100644 --- a/chrome/browser/chromeos/frame/panel_controller.cc +++ b/chrome/browser/chromeos/frame/panel_controller.cc @@ -7,7 +7,6 @@ #include <vector> #include "app/resource_bundle.h" -#include "app/x11_util.h" #include "base/logging.h" #include "base/singleton.h" #include "base/scoped_ptr.h" @@ -89,7 +88,9 @@ PanelController::PanelController(Delegate* delegate, client_event_handler_id_(0) { } -void PanelController::Init(bool initial_focus, const gfx::Rect& window_bounds) { +void PanelController::Init(bool initial_focus, + const gfx::Rect& window_bounds, + XID creator_xid) { gfx::Rect title_bounds( 0, 0, window_bounds.width(), kTitleHeight); @@ -108,6 +109,7 @@ void PanelController::Init(bool initial_focus, const gfx::Rect& window_bounds) { type_params.push_back(title_xid_); type_params.push_back(expanded_ ? 1 : 0); type_params.push_back(initial_focus ? 1 : 0); + type_params.push_back(creator_xid); WmIpc::instance()->SetWindowType( GTK_WIDGET(panel_), WM_IPC_WINDOW_CHROME_PANEL_CONTENT, diff --git a/chrome/browser/chromeos/frame/panel_controller.h b/chrome/browser/chromeos/frame/panel_controller.h index b4ad0c8..58a1660 100644 --- a/chrome/browser/chromeos/frame/panel_controller.h +++ b/chrome/browser/chromeos/frame/panel_controller.h @@ -7,6 +7,7 @@ #include <gtk/gtk.h> +#include "app/x11_util.h" #include "views/controls/button/button.h" class BrowserView; @@ -51,7 +52,7 @@ class PanelController : public views::ButtonListener { // Initializes the panel controller with the initial state of the focus and // the window bounds. - void Init(bool initial_focus, const gfx::Rect& init_bounds); + void Init(bool initial_focus, const gfx::Rect& init_bounds, XID creator_xid); bool TitleMousePressed(const views::MouseEvent& event); void TitleMouseReleased(const views::MouseEvent& event, bool canceled); diff --git a/chrome/browser/chromeos/notifications/notification_panel.cc b/chrome/browser/chromeos/notifications/notification_panel.cc index 8773b94..96b00b9 100644 --- a/chrome/browser/chromeos/notifications/notification_panel.cc +++ b/chrome/browser/chromeos/notifications/notification_panel.cc @@ -458,7 +458,7 @@ void NotificationPanel::Show() { panel_controller_.reset( new PanelController(this, GTK_WINDOW(panel_widget_->GetNativeView()))); panel_controller_->Init(false /* don't focus when opened */, - gfx::Rect(0, 0, kBalloonMinWidth, 1)); + gfx::Rect(0, 0, kBalloonMinWidth, 1), 0); registrar_.Add(this, NotificationType::PANEL_STATE_CHANGED, Source<PanelController>(panel_controller_.get())); } |