| OLD | NEW |
| 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 "content/browser/web_contents/web_contents_view_aura.h" | 5 #include "content/browser/web_contents/web_contents_view_aura.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 registrar_.Add(this, | 184 registrar_.Add(this, |
| 185 NOTIFICATION_WEB_CONTENTS_DISCONNECTED, | 185 NOTIFICATION_WEB_CONTENTS_DISCONNECTED, |
| 186 Source<WebContents>(contents)); | 186 Source<WebContents>(contents)); |
| 187 } | 187 } |
| 188 | 188 |
| 189 virtual ~WebDragSourceAura() { | 189 virtual ~WebDragSourceAura() { |
| 190 base::MessageLoopForUI::current()->RemoveObserver(this); | 190 base::MessageLoopForUI::current()->RemoveObserver(this); |
| 191 } | 191 } |
| 192 | 192 |
| 193 // MessageLoop::Observer implementation: | 193 // MessageLoop::Observer implementation: |
| 194 virtual base::EventStatus WillProcessEvent( | 194 virtual void WillProcessEvent(const base::NativeEvent& event) OVERRIDE {} |
| 195 const base::NativeEvent& event) OVERRIDE { | |
| 196 return base::EVENT_CONTINUE; | |
| 197 } | |
| 198 virtual void DidProcessEvent(const base::NativeEvent& event) OVERRIDE { | 195 virtual void DidProcessEvent(const base::NativeEvent& event) OVERRIDE { |
| 199 if (!contents_) | 196 if (!contents_) |
| 200 return; | 197 return; |
| 201 ui::EventType type = ui::EventTypeFromNative(event); | 198 ui::EventType type = ui::EventTypeFromNative(event); |
| 202 RenderViewHost* rvh = NULL; | 199 RenderViewHost* rvh = NULL; |
| 203 switch (type) { | 200 switch (type) { |
| 204 case ui::ET_MOUSE_DRAGGED: | 201 case ui::ET_MOUSE_DRAGGED: |
| 205 rvh = contents_->GetRenderViewHost(); | 202 rvh = contents_->GetRenderViewHost(); |
| 206 if (rvh) { | 203 if (rvh) { |
| 207 gfx::Point screen_loc_in_pixel = ui::EventLocationFromNative(event); | 204 gfx::Point screen_loc_in_pixel = ui::EventLocationFromNative(event); |
| (...skipping 1301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1509 event.location(), | 1506 event.location(), |
| 1510 gfx::Screen::GetScreenFor(GetNativeView())->GetCursorScreenPoint(), | 1507 gfx::Screen::GetScreenFor(GetNativeView())->GetCursorScreenPoint(), |
| 1511 ConvertAuraEventFlagsToWebInputEventModifiers(event.flags())); | 1508 ConvertAuraEventFlagsToWebInputEventModifiers(event.flags())); |
| 1512 if (drag_dest_delegate_) | 1509 if (drag_dest_delegate_) |
| 1513 drag_dest_delegate_->OnDrop(); | 1510 drag_dest_delegate_->OnDrop(); |
| 1514 current_drop_data_.reset(); | 1511 current_drop_data_.reset(); |
| 1515 return ConvertFromWeb(current_drag_op_); | 1512 return ConvertFromWeb(current_drag_op_); |
| 1516 } | 1513 } |
| 1517 | 1514 |
| 1518 } // namespace content | 1515 } // namespace content |
| OLD | NEW |