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

Side by Side Diff: ui/aura/root_window.cc

Issue 10831361: Draggable region support for frameless app window on CrOS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix build 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/aura/root_window.h" 5 #include "ui/aura/root_window.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after
816 ui::Transform transform = layer()->transform(); 816 ui::Transform transform = layer()->transform();
817 transform.ConcatScale(scale, scale); 817 transform.ConcatScale(scale, scale);
818 event->UpdateForRootTransform(transform); 818 event->UpdateForRootTransform(transform);
819 819
820 SetLastMouseLocation(this, event->location()); 820 SetLastMouseLocation(this, event->location());
821 synthesize_mouse_move_ = false; 821 synthesize_mouse_move_ = false;
822 822
823 Window* target = mouse_pressed_handler_ ? 823 Window* target = mouse_pressed_handler_ ?
824 mouse_pressed_handler_ : client::GetCaptureWindow(this); 824 mouse_pressed_handler_ : client::GetCaptureWindow(this);
825 if (!target) 825 if (!target)
826 target = GetEventHandlerForPoint(event->location()); 826 target = GetEventHandlerForPoint(event->location(), event->type());
827 827
828 if (target && target->delegate()) { 828 if (target && target->delegate()) {
829 int flags = event->flags(); 829 int flags = event->flags();
830 gfx::Point location_in_window = event->location(); 830 gfx::Point location_in_window = event->location();
831 Window::ConvertPointToTarget(this, target, &location_in_window); 831 Window::ConvertPointToTarget(this, target, &location_in_window);
832 if (IsNonClientLocation(target, location_in_window)) 832 if (IsNonClientLocation(target, location_in_window))
833 flags |= ui::EF_IS_NON_CLIENT; 833 flags |= ui::EF_IS_NON_CLIENT;
834 ui::ScrollEvent translated_event( 834 ui::ScrollEvent translated_event(
835 *event, static_cast<Window*>(this), target, event->type(), flags); 835 *event, static_cast<Window*>(this), target, event->type(), flags);
836 return ProcessMouseEvent(target, &translated_event); 836 return ProcessMouseEvent(target, &translated_event);
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
873 } 873 }
874 874
875 if (!target && !bounds().Contains(event->location())) { 875 if (!target && !bounds().Contains(event->location())) {
876 // If the initial touch is outside the root window, target the root. 876 // If the initial touch is outside the root window, target the root.
877 target = this; 877 target = this;
878 status = ProcessTouchEvent(target, event); 878 status = ProcessTouchEvent(target, event);
879 CHECK_EQ(ui::TOUCH_STATUS_UNKNOWN, status); 879 CHECK_EQ(ui::TOUCH_STATUS_UNKNOWN, status);
880 } else { 880 } else {
881 // We only come here when the first contact was within the root window. 881 // We only come here when the first contact was within the root window.
882 if (!target) { 882 if (!target) {
883 target = GetEventHandlerForPoint(event->location()); 883 target = GetEventHandlerForPoint(event->location(), event->type());
884 if (!target) 884 if (!target)
885 return false; 885 return false;
886 } 886 }
887 887
888 ui::TouchEvent translated_event( 888 ui::TouchEvent translated_event(
889 *event, static_cast<Window*>(this), target); 889 *event, static_cast<Window*>(this), target);
890 status = ProcessTouchEvent(target, &translated_event); 890 status = ProcessTouchEvent(target, &translated_event);
891 handled = status != ui::TOUCH_STATUS_UNKNOWN; 891 handled = status != ui::TOUCH_STATUS_UNKNOWN;
892 892
893 if (status == ui::TOUCH_STATUS_QUEUED || 893 if (status == ui::TOUCH_STATUS_QUEUED ||
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
943 // RootWindow, private: 943 // RootWindow, private:
944 944
945 bool RootWindow::DispatchMouseEventImpl(ui::MouseEvent* event) { 945 bool RootWindow::DispatchMouseEventImpl(ui::MouseEvent* event) {
946 float scale = ui::GetDeviceScaleFactor(layer()); 946 float scale = ui::GetDeviceScaleFactor(layer());
947 ui::Transform transform = layer()->transform(); 947 ui::Transform transform = layer()->transform();
948 transform.ConcatScale(scale, scale); 948 transform.ConcatScale(scale, scale);
949 event->UpdateForRootTransform(transform); 949 event->UpdateForRootTransform(transform);
950 Window* target = mouse_pressed_handler_ ? 950 Window* target = mouse_pressed_handler_ ?
951 mouse_pressed_handler_ : client::GetCaptureWindow(this); 951 mouse_pressed_handler_ : client::GetCaptureWindow(this);
952 if (!target) 952 if (!target)
953 target = GetEventHandlerForPoint(event->location()); 953 target = GetEventHandlerForPoint(event->location(), event->type());
954 return DispatchMouseEventToTarget(event, target); 954 return DispatchMouseEventToTarget(event, target);
955 } 955 }
956 956
957 bool RootWindow::DispatchMouseEventToTarget(ui::MouseEvent* event, 957 bool RootWindow::DispatchMouseEventToTarget(ui::MouseEvent* event,
958 Window* target) { 958 Window* target) {
959 static const int kMouseButtonFlagMask = 959 static const int kMouseButtonFlagMask =
960 ui::EF_LEFT_MOUSE_BUTTON | 960 ui::EF_LEFT_MOUSE_BUTTON |
961 ui::EF_MIDDLE_MOUSE_BUTTON | 961 ui::EF_MIDDLE_MOUSE_BUTTON |
962 ui::EF_RIGHT_MOUSE_BUTTON; 962 ui::EF_RIGHT_MOUSE_BUTTON;
963 SetLastMouseLocation(this, event->location()); 963 SetLastMouseLocation(this, event->location());
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
1040 void RootWindow::UnlockCompositor() { 1040 void RootWindow::UnlockCompositor() {
1041 DCHECK(compositor_lock_); 1041 DCHECK(compositor_lock_);
1042 compositor_lock_ = NULL; 1042 compositor_lock_ = NULL;
1043 if (draw_on_compositor_unlock_) { 1043 if (draw_on_compositor_unlock_) {
1044 draw_on_compositor_unlock_ = false; 1044 draw_on_compositor_unlock_ = false;
1045 ScheduleDraw(); 1045 ScheduleDraw();
1046 } 1046 }
1047 } 1047 }
1048 1048
1049 } // namespace aura 1049 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698