Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4031)

Unified Diff: chrome/browser/ui/views/panels/panel_view.cc

Issue 11669018: Support dragging panels to stack and snap. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix per feedback Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/panels/panel_view.cc
diff --git a/chrome/browser/ui/views/panels/panel_view.cc b/chrome/browser/ui/views/panels/panel_view.cc
index b99dcb419bb4388ba7a2ef83661270ce90aa2701..cfcc1e110f62404b60dee1bc3738eb358c3c89f0 100644
--- a/chrome/browser/ui/views/panels/panel_view.cc
+++ b/chrome/browser/ui/views/panels/panel_view.cc
@@ -13,6 +13,7 @@
#include "chrome/browser/ui/panels/panel.h"
#include "chrome/browser/ui/panels/panel_bounds_animation.h"
#include "chrome/browser/ui/panels/panel_manager.h"
+#include "chrome/browser/ui/panels/stacked_panel_collection.h"
#include "chrome/browser/ui/views/panels/panel_frame_view.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/render_widget_host_view.h"
@@ -582,6 +583,29 @@ int PanelView::TitleOnlyHeight() const {
return panel::kTitlebarHeight;
}
+void PanelView::UpdatePanelStackingProperty() {
+#if defined(OS_WIN) && !defined(USE_AURA)
+ // In order for a panel stack that holds multiple panels to appear as a single
+ // window on the taskbar or launcher, the owner window of this panel view
+ // should be set to the panel stack window. In addition, the extended style
+ // WS_EX_APPWINDOW, that is used to force a top-level window onto the taskbar,
+ // should be cleared.
+ StackedPanelCollection* stack = NULL;
+ if (panel_->collection()->type() == PanelCollection::STACKED)
+ stack = static_cast<StackedPanelCollection*>(panel_->collection());
+ HWND owner = stack ? stack->GetNativeWindow() : NULL;
+ if (owner)
+ UpdateWindowAttribute(GWL_EXSTYLE, 0, WS_EX_APPWINDOW, false);
+ else
+ UpdateWindowAttribute(GWL_EXSTYLE, WS_EX_APPWINDOW, 0, false);
+ ::SetWindowLong(GetNativePanelHandle(),
+ GWL_HWNDPARENT,
+ reinterpret_cast<LONG>(owner));
+#else
+ NOTIMPLEMENTED();
+#endif
+}
+
void PanelView::AttachWebContents(content::WebContents* contents) {
web_view_->SetWebContents(contents);
}

Powered by Google App Engine
This is Rietveld 408576698