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

Unified Diff: chrome/browser/ui/panels/panel.cc

Issue 11669018: Support dragging panels to stack and snap. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix CrOS build for relanding 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
« no previous file with comments | « chrome/browser/ui/panels/panel.h ('k') | chrome/browser/ui/panels/panel_collection.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/panels/panel.cc
diff --git a/chrome/browser/ui/panels/panel.cc b/chrome/browser/ui/panels/panel.cc
index 35900ca68d4845adbbeb4120fc7f36f96116905f..26c1606bb833c110e488854676d01e67e89cfce1 100644
--- a/chrome/browser/ui/panels/panel.cc
+++ b/chrome/browser/ui/panels/panel.cc
@@ -25,6 +25,7 @@
#include "chrome/browser/ui/panels/panel_collection.h"
#include "chrome/browser/ui/panels/panel_host.h"
#include "chrome/browser/ui/panels/panel_manager.h"
+#include "chrome/browser/ui/panels/stacked_panel_collection.h"
#include "chrome/browser/web_applications/web_app.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/extensions/extension.h"
@@ -245,6 +246,11 @@ const std::string Panel::extension_id() const {
return web_app::GetExtensionIdFromApplicationName(app_name_);
}
+StackedPanelCollection* Panel::stack() const {
+ return collection_ && collection_->type() == PanelCollection::STACKED ?
+ static_cast<StackedPanelCollection*>(collection_) : NULL;
+}
+
content::WebContents* Panel::GetWebContents() const {
return panel_host_.get() ? panel_host_->web_contents() : NULL;
}
@@ -809,6 +815,12 @@ void Panel::WebContentsFocused(content::WebContents* contents) {
native_panel_->PanelWebContentsFocused(contents);
}
+void Panel::MoveByInstantly(const gfx::Vector2d& delta_origin) {
+ gfx::Rect bounds = GetBounds();
+ bounds.Offset(delta_origin);
+ SetPanelBoundsInstantly(bounds);
+}
+
const extensions::Extension* Panel::GetExtension() const {
ExtensionService* extension_service =
extensions::ExtensionSystem::Get(profile())->extension_service();
« no previous file with comments | « chrome/browser/ui/panels/panel.h ('k') | chrome/browser/ui/panels/panel_collection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698