Chromium Code Reviews| 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 #ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_DRAG_WIN_H_ | 5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_DRAG_WIN_H_ |
| 6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_DRAG_WIN_H_ | 6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_DRAG_WIN_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 60 private: | 60 private: |
| 61 // Called on either UI thread or drag-and-drop thread. | 61 // Called on either UI thread or drag-and-drop thread. |
| 62 void PrepareDragForDownload(const WebDropData& drop_data, | 62 void PrepareDragForDownload(const WebDropData& drop_data, |
| 63 ui::OSExchangeData* data, | 63 ui::OSExchangeData* data, |
| 64 const GURL& page_url, | 64 const GURL& page_url, |
| 65 const std::string& page_encoding); | 65 const std::string& page_encoding); |
| 66 void PrepareDragForFileContents(const WebDropData& drop_data, | 66 void PrepareDragForFileContents(const WebDropData& drop_data, |
| 67 ui::OSExchangeData* data); | 67 ui::OSExchangeData* data); |
| 68 void PrepareDragForUrl(const WebDropData& drop_data, | 68 void PrepareDragForUrl(const WebDropData& drop_data, |
| 69 ui::OSExchangeData* data); | 69 ui::OSExchangeData* data); |
| 70 void DoDragging(const WebDropData& drop_data, | 70 // Returns false if the source window becomes invalid when the drag ends. |
| 71 // This could happens when the window gets destroyed when the drag is still in | |
|
Ben Goodger (Google)
2012/09/27 16:05:20
happen
| |
| 72 // progress. No further processing should be done beyond this return point | |
| 73 // because the instance has been disposed. | |
|
Ben Goodger (Google)
2012/09/27 16:05:20
destroyed.
| |
| 74 bool DoDragging(const WebDropData& drop_data, | |
| 71 WebKit::WebDragOperationsMask ops, | 75 WebKit::WebDragOperationsMask ops, |
| 72 const GURL& page_url, | 76 const GURL& page_url, |
| 73 const std::string& page_encoding, | 77 const std::string& page_encoding, |
| 74 const gfx::ImageSkia& image, | 78 const gfx::ImageSkia& image, |
| 75 const gfx::Point& image_offset); | 79 const gfx::Point& image_offset); |
| 76 | 80 |
| 77 // Called on drag-and-drop thread. | 81 // Called on drag-and-drop thread. |
| 78 void StartBackgroundDragging(const WebDropData& drop_data, | 82 void StartBackgroundDragging(const WebDropData& drop_data, |
| 79 WebKit::WebDragOperationsMask ops, | 83 WebKit::WebDragOperationsMask ops, |
| 80 const GURL& page_url, | 84 const GURL& page_url, |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 105 | 109 |
| 106 // The flag to guard that EndDragging is not called twice. | 110 // The flag to guard that EndDragging is not called twice. |
| 107 bool drag_ended_; | 111 bool drag_ended_; |
| 108 | 112 |
| 109 base::Callback<void()> drag_end_callback_; | 113 base::Callback<void()> drag_end_callback_; |
| 110 | 114 |
| 111 DISALLOW_COPY_AND_ASSIGN(WebContentsDragWin); | 115 DISALLOW_COPY_AND_ASSIGN(WebContentsDragWin); |
| 112 }; | 116 }; |
| 113 | 117 |
| 114 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_DRAG_WIN_H_ | 118 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_DRAG_WIN_H_ |
| OLD | NEW |