summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/views')
-rw-r--r--chrome/browser/views/bookmark_folder_tree_view.cc7
-rw-r--r--chrome/browser/views/bookmark_table_view.cc7
-rw-r--r--chrome/browser/views/tab_contents/tab_contents_view_win.cc16
3 files changed, 17 insertions, 13 deletions
diff --git a/chrome/browser/views/bookmark_folder_tree_view.cc b/chrome/browser/views/bookmark_folder_tree_view.cc
index bd464c8..74a6dea 100644
--- a/chrome/browser/views/bookmark_folder_tree_view.cc
+++ b/chrome/browser/views/bookmark_folder_tree_view.cc
@@ -8,6 +8,7 @@
#include "app/drag_drop_types.h"
#include "app/os_exchange_data.h"
+#include "app/os_exchange_data_provider_win.h"
#include "base/base_drag_source.h"
#include "chrome/browser/bookmarks/bookmark_utils.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
@@ -125,12 +126,12 @@ void BookmarkFolderTreeView::BeginDrag(const BookmarkNode* node) {
std::vector<const BookmarkNode*> nodes_to_drag;
nodes_to_drag.push_back(node);
- scoped_refptr<OSExchangeData> data = new OSExchangeData;
- BookmarkDragData(nodes_to_drag).Write(profile_, data);
+ OSExchangeData data;
+ BookmarkDragData(nodes_to_drag).Write(profile_, &data);
scoped_refptr<BaseDragSource> drag_source(new BaseDragSource);
DWORD effects;
is_dragging_ = true;
- DoDragDrop(data, drag_source,
+ DoDragDrop(OSExchangeDataProviderWin::GetIDataObject(data), drag_source,
DROPEFFECT_LINK | DROPEFFECT_COPY | DROPEFFECT_MOVE, &effects);
is_dragging_ = false;
}
diff --git a/chrome/browser/views/bookmark_table_view.cc b/chrome/browser/views/bookmark_table_view.cc
index 3eaa2f3..1ea3aa6 100644
--- a/chrome/browser/views/bookmark_table_view.cc
+++ b/chrome/browser/views/bookmark_table_view.cc
@@ -11,6 +11,7 @@
#include "app/gfx/font.h"
#include "app/l10n_util.h"
#include "app/os_exchange_data.h"
+#include "app/os_exchange_data_provider_win.h"
#include "app/resource_bundle.h"
#include "base/base_drag_source.h"
#include "chrome/browser/bookmarks/bookmark_utils.h"
@@ -197,11 +198,11 @@ void BookmarkTableView::BeginDrag() {
// We do this as SelectionBegin starts at the end of the visual order.
std::reverse(nodes_to_drag.begin(), nodes_to_drag.end());
- scoped_refptr<OSExchangeData> data = new OSExchangeData;
- BookmarkDragData(nodes_to_drag).Write(profile_, data);
+ OSExchangeData data;
+ BookmarkDragData(nodes_to_drag).Write(profile_, &data);
scoped_refptr<BaseDragSource> drag_source(new BaseDragSource);
DWORD effects;
- DoDragDrop(data, drag_source,
+ DoDragDrop(OSExchangeDataProviderWin::GetIDataObject(data), drag_source,
DROPEFFECT_LINK | DROPEFFECT_COPY | DROPEFFECT_MOVE, &effects);
}
diff --git a/chrome/browser/views/tab_contents/tab_contents_view_win.cc b/chrome/browser/views/tab_contents/tab_contents_view_win.cc
index 570df67..47a73e3 100644
--- a/chrome/browser/views/tab_contents/tab_contents_view_win.cc
+++ b/chrome/browser/views/tab_contents/tab_contents_view_win.cc
@@ -8,6 +8,7 @@
#include "app/gfx/canvas_paint.h"
#include "app/os_exchange_data.h"
+#include "app/os_exchange_data_provider_win.h"
#include "base/time.h"
#include "chrome/browser/bookmarks/bookmark_drag_data.h"
#include "chrome/browser/browser.h" // TODO(beng): this dependency is awful.
@@ -132,7 +133,7 @@ void TabContentsViewWin::GetContainerBounds(gfx::Rect* out) const {
}
void TabContentsViewWin::StartDragging(const WebDropData& drop_data) {
- scoped_refptr<OSExchangeData> data(new OSExchangeData);
+ OSExchangeData data;
// TODO(tc): Generate an appropriate drag image.
@@ -150,10 +151,10 @@ void TabContentsViewWin::StartDragging(const WebDropData& drop_data) {
net::GetSuggestedFilename(drop_data.url, "", "", L""));
}
file_name = file_name.ReplaceExtension(drop_data.file_extension);
- data->SetFileContents(file_name.value(), drop_data.file_contents);
+ data.SetFileContents(file_name.value(), drop_data.file_contents);
}
if (!drop_data.text_html.empty())
- data->SetHtml(drop_data.text_html, drop_data.html_base_url);
+ data.SetHtml(drop_data.text_html, drop_data.html_base_url);
if (drop_data.url.is_valid()) {
if (drop_data.url.SchemeIs(chrome::kJavaScriptScheme)) {
// We don't want to allow javascript URLs to be dragged to the desktop,
@@ -170,13 +171,13 @@ void TabContentsViewWin::StartDragging(const WebDropData& drop_data) {
// Pass in NULL as the profile so that the bookmark always adds the url
// rather than trying to move an existing url.
- bm_drag_data.Write(NULL, data);
+ bm_drag_data.Write(NULL, &data);
} else {
- data->SetURL(drop_data.url, drop_data.url_title);
+ data.SetURL(drop_data.url, drop_data.url_title);
}
}
if (!drop_data.plain_text.empty())
- data->SetString(drop_data.plain_text);
+ data.SetString(drop_data.plain_text);
drag_source_ = new WebDragSource(GetNativeView(), tab_contents());
@@ -186,7 +187,8 @@ void TabContentsViewWin::StartDragging(const WebDropData& drop_data) {
// updates while in the system DoDragDrop loop.
bool old_state = MessageLoop::current()->NestableTasksAllowed();
MessageLoop::current()->SetNestableTasksAllowed(true);
- DoDragDrop(data, drag_source_, DROPEFFECT_COPY | DROPEFFECT_LINK, &effects);
+ DoDragDrop(OSExchangeDataProviderWin::GetIDataObject(data), drag_source_,
+ DROPEFFECT_COPY | DROPEFFECT_LINK, &effects);
MessageLoop::current()->SetNestableTasksAllowed(old_state);
drag_source_ = NULL;