Chromium Code Reviews| Index: content/browser/web_contents/web_drag_source_win.cc |
| =================================================================== |
| --- content/browser/web_contents/web_drag_source_win.cc (revision 164670) |
| +++ content/browser/web_contents/web_drag_source_win.cc (working copy) |
| @@ -13,9 +13,8 @@ |
| #include "content/public/browser/web_contents.h" |
| using WebKit::WebDragOperationNone; |
| -using content::BrowserThread; |
| -using content::WebContents; |
| +namespace content { |
| namespace { |
| static void GetCursorPositions(gfx::NativeWindow wnd, gfx::Point* client, |
|
tfarina
2012/10/29 19:37:19
nit: no static, sorry for point out. :(
|
| @@ -38,10 +37,10 @@ |
| source_wnd_(source_wnd), |
| render_view_host_(web_contents->GetRenderViewHost()), |
| effect_(DROPEFFECT_NONE) { |
| - registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_SWAPPED, |
| - content::Source<WebContents>(web_contents)); |
| - registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED, |
| - content::Source<WebContents>(web_contents)); |
| + registrar_.Add(this, NOTIFICATION_WEB_CONTENTS_SWAPPED, |
| + Source<WebContents>(web_contents)); |
| + registrar_.Add(this, NOTIFICATION_WEB_CONTENTS_DISCONNECTED, |
| + Source<WebContents>(web_contents)); |
| } |
| WebDragSource::~WebDragSource() { |
| @@ -87,7 +86,7 @@ |
| GetCursorPositions(source_wnd_, &client, &screen); |
| render_view_host_->DragSourceEndedAt( |
| client.x(), client.y(), screen.x(), screen.y(), |
| - web_drag_utils_win::WinDragOpToWebDragOp(effect_)); |
| + WinDragOpToWebDragOp(effect_)); |
| } |
| void WebDragSource::OnDragSourceMove() { |
| @@ -110,17 +109,19 @@ |
| } |
| void WebDragSource::Observe(int type, |
| - const content::NotificationSource& source, |
| - const content::NotificationDetails& details) { |
| - if (content::NOTIFICATION_WEB_CONTENTS_SWAPPED == type) { |
| + const NotificationSource& source, |
|
tfarina
2012/10/29 19:37:19
nit: indentation is off here!
jam
2012/10/29 20:01:51
Done.
|
| + const NotificationDetails& details) { |
| + if (NOTIFICATION_WEB_CONTENTS_SWAPPED == type) { |
|
tfarina
2012/10/29 19:37:19
note your fault of course, but I have seen more th
jam
2012/10/29 20:01:51
Done.
|
| // When the WebContents get swapped, our render view host goes away. |
| // That's OK, we can continue the drag, we just can't send messages back to |
| // our drag source. |
| render_view_host_ = NULL; |
| - } else if (content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED == type) { |
| + } else if (NOTIFICATION_WEB_CONTENTS_DISCONNECTED == type) { |
| // This could be possible when we close the tab and the source is still |
| // being used in DoDragDrop at the time that the virtual file is being |
| // downloaded. |
| render_view_host_ = NULL; |
| } |
| } |
| + |
| +} // namespace content |