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

Unified Diff: chrome/browser/ui/views/extensions/shell_window_views.cc

Issue 10831361: Draggable region support for frameless app window on CrOS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use ShouldDescendIntoChildForEventHandling Created 8 years, 4 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/extensions/shell_window_views.cc
diff --git a/chrome/browser/ui/views/extensions/shell_window_views.cc b/chrome/browser/ui/views/extensions/shell_window_views.cc
index 387d1f9ed3dd73dd6c16e31dd115b8f25bdff37d..a5064f51c23bc056f04de383874ef1482e9b394d 100644
--- a/chrome/browser/ui/views/extensions/shell_window_views.cc
+++ b/chrome/browser/ui/views/extensions/shell_window_views.cc
@@ -336,6 +336,20 @@ views::View* ShellWindowViews::GetInitiallyFocusedView() {
return web_view_;
}
+bool ShellWindowViews::ShouldDescendIntoChildForEventHandling(
+ aura::Window* child,
+ const gfx::Point& event_location,
+ ui::EventType event_type) {
+ DCHECK_EQ(child, web_view_->web_contents()->GetView()->GetNativeView());
Ben Goodger (Google) 2012/08/21 02:17:40 the body of this function needs to be #ifdef USE_A
jianli 2012/08/21 17:22:00 Done.
+ // Shell window should claim mouse click/drag events that fall within the
+ // draggable region.
+ return !draggable_region_.get() ||
+ !draggable_region_->contains(event_location.x(), event_location.y()) ||
+ (event_type != ui::ET_MOUSE_PRESSED &&
Ben Goodger (Google) 2012/08/21 02:17:40 I don't understand why the need to filter on event
+ event_type != ui::ET_MOUSE_DRAGGED &&
+ event_type != ui::ET_MOUSE_RELEASED);
+}
+
void ShellWindowViews::OnFocus() {
web_view_->RequestFocus();
}
@@ -490,7 +504,7 @@ const views::Widget* ShellWindowViews::GetWidget() const {
void ShellWindowViews::OnViewWasResized() {
// TODO(jeremya): this doesn't seem like a terribly elegant way to keep the
// window shape in sync.
-#if defined(OS_WIN) && !defined(USE_AURA)
+#if defined(OS_WIN) && !defined(USE_ASH)
// Set the window shape of the RWHV.
DCHECK(window_);
DCHECK(web_view_);

Powered by Google App Engine
This is Rietveld 408576698