| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_UI_VIEWS_DRAG_AND_DROP_INTERACTIVE_UITEST_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_DRAG_AND_DROP_INTERACTIVE_UITEST_H_ |
| 7 |
| 8 #include <memory> |
| 9 #include <string> |
| 10 |
| 11 #include "base/macros.h" |
| 12 |
| 13 namespace content { |
| 14 class WebContents; |
| 15 } // namespace content |
| 16 |
| 17 namespace gfx { |
| 18 class Point; |
| 19 } // namespace gfx |
| 20 |
| 21 // Test helper for simulating drag and drop happening in WebContents. |
| 22 class ExternalDragEnterSimulator { |
| 23 public: |
| 24 static std::unique_ptr<ExternalDragEnterSimulator> Create( |
| 25 content::WebContents* web_contents); |
| 26 |
| 27 virtual ~ExternalDragEnterSimulator() {} |
| 28 |
| 29 // Simulates notification that |text| was dragged from outside of the browser, |
| 30 // into the specified |location| inside |web_contents|. |
| 31 // |location| is relative to |web_contents|. |
| 32 // Returns true upon success. |
| 33 virtual bool SimulateDragEnter(const gfx::Point& location, |
| 34 const std::string& text) = 0; |
| 35 |
| 36 // Simulates dropping of the drag-and-dropped item. |
| 37 // SimulateDragEnter needs to be called first. |
| 38 // Returns true upon success. |
| 39 virtual bool SimulateDrop(const gfx::Point& location); |
| 40 |
| 41 protected: |
| 42 ExternalDragEnterSimulator() = default; |
| 43 |
| 44 private: |
| 45 DISALLOW_COPY_AND_ASSIGN(ExternalDragEnterSimulator); |
| 46 }; |
| 47 |
| 48 #endif // CHROME_BROWSER_UI_VIEWS_DRAG_AND_DROP_INTERACTIVE_UITEST_H_ |
| OLD | NEW |