summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authordcheng <dcheng@chromium.org>2014-11-12 16:48:56 -0800
committerCommit bot <commit-bot@chromium.org>2014-11-13 00:49:52 +0000
commitdb3aefa5b23c8849848c3cdc817e46d666a1836c (patch)
tree548bff43524b903c302cc7521b4ee9cfdf64be12 /ui
parent8c6ae495cf2dd5117d0d209c25169710c491f992 (diff)
downloadchromium_src-db3aefa5b23c8849848c3cdc817e46d666a1836c.zip
chromium_src-db3aefa5b23c8849848c3cdc817e46d666a1836c.tar.gz
chromium_src-db3aefa5b23c8849848c3cdc817e46d666a1836c.tar.bz2
Remove implicit conversions from scoped_refptr to T* in ui/
This patch was generated by running the rewrite_scoped_refptr clang tool on a Windows build. BUG=110610 Review URL: https://codereview.chromium.org/721983002 Cr-Commit-Position: refs/heads/master@{#303941}
Diffstat (limited to 'ui')
-rw-r--r--ui/app_list/views/apps_grid_view.cc6
-rw-r--r--ui/app_list/views/test/apps_grid_view_test_api.cc7
-rw-r--r--ui/base/dragdrop/drop_target_win.cc12
-rw-r--r--ui/base/dragdrop/os_exchange_data_provider_win.cc29
-rw-r--r--ui/base/win/shell.cc11
-rw-r--r--ui/views/widget/desktop_aura/desktop_drag_drop_client_win.cc6
6 files changed, 36 insertions, 35 deletions
diff --git a/ui/app_list/views/apps_grid_view.cc b/ui/app_list/views/apps_grid_view.cc
index 2e699bb..550b5b2 100644
--- a/ui/app_list/views/apps_grid_view.cc
+++ b/ui/app_list/views/apps_grid_view.cc
@@ -537,7 +537,7 @@ void AppsGridView::StartSettingUpSynchronousDrag() {
bool AppsGridView::RunSynchronousDrag() {
#if defined(OS_WIN)
- if (!synchronous_drag_)
+ if (!synchronous_drag_.get())
return false;
if (synchronous_drag_->CanRun()) {
@@ -558,7 +558,7 @@ bool AppsGridView::RunSynchronousDrag() {
void AppsGridView::CleanUpSynchronousDrag() {
#if defined(OS_WIN)
- if (synchronous_drag_)
+ if (synchronous_drag_.get())
synchronous_drag_->EndDragExternally();
synchronous_drag_ = NULL;
@@ -1478,7 +1478,7 @@ void AppsGridView::OnFolderItemReparentTimer() {
if (drag_out_of_folder_container_ && drag_view_) {
bool has_native_drag = drag_and_drop_host_ != nullptr;
#if defined(OS_WIN)
- has_native_drag = has_native_drag || synchronous_drag_;
+ has_native_drag = has_native_drag || synchronous_drag_.get();
#endif
folder_delegate_->ReparentItem(
drag_view_, last_drag_point_, has_native_drag);
diff --git a/ui/app_list/views/test/apps_grid_view_test_api.cc b/ui/app_list/views/test/apps_grid_view_test_api.cc
index 1142f11..4da95e6 100644
--- a/ui/app_list/views/test/apps_grid_view_test_api.cc
+++ b/ui/app_list/views/test/apps_grid_view_test_api.cc
@@ -46,9 +46,10 @@ void AppsGridViewTestApi::PressItemAt(int index) {
void AppsGridViewTestApi::DisableSynchronousDrag() {
#if defined(OS_WIN)
- DCHECK(view_->synchronous_drag_ == NULL) << "DisableSynchronousDrag needs to "
- "be called before "
- "synchronous_drag_ is set up.";
+ DCHECK(view_->synchronous_drag_.get() == NULL)
+ << "DisableSynchronousDrag needs to "
+ "be called before "
+ "synchronous_drag_ is set up.";
view_->use_synchronous_drag_ = false;
#endif
}
diff --git a/ui/base/dragdrop/drop_target_win.cc b/ui/base/dragdrop/drop_target_win.cc
index 078a14e..0370e2b 100644
--- a/ui/base/dragdrop/drop_target_win.cc
+++ b/ui/base/dragdrop/drop_target_win.cc
@@ -49,7 +49,8 @@ HRESULT DropTargetWin::DragEnter(IDataObject* data_object,
current_data_object_ = data_object;
POINT screen_pt = { cursor_position.x, cursor_position.y };
- *effect = OnDragEnter(current_data_object_, key_state, screen_pt, *effect);
+ *effect =
+ OnDragEnter(current_data_object_.get(), key_state, screen_pt, *effect);
return S_OK;
}
@@ -62,7 +63,8 @@ HRESULT DropTargetWin::DragOver(DWORD key_state,
drop_helper->DragOver(reinterpret_cast<POINT*>(&cursor_position), *effect);
POINT screen_pt = { cursor_position.x, cursor_position.y };
- *effect = OnDragOver(current_data_object_, key_state, screen_pt, *effect);
+ *effect =
+ OnDragOver(current_data_object_.get(), key_state, screen_pt, *effect);
return S_OK;
}
@@ -72,7 +74,7 @@ HRESULT DropTargetWin::DragLeave() {
if (drop_helper)
drop_helper->DragLeave();
- OnDragLeave(current_data_object_);
+ OnDragLeave(current_data_object_.get());
current_data_object_ = NULL;
return S_OK;
@@ -85,12 +87,12 @@ HRESULT DropTargetWin::Drop(IDataObject* data_object,
// Tell the helper that we dropped onto it so it can update the drag image.
IDropTargetHelper* drop_helper = DropHelper();
if (drop_helper) {
- drop_helper->Drop(current_data_object_,
+ drop_helper->Drop(current_data_object_.get(),
reinterpret_cast<POINT*>(&cursor_position), *effect);
}
POINT screen_pt = { cursor_position.x, cursor_position.y };
- *effect = OnDrop(current_data_object_, key_state, screen_pt, *effect);
+ *effect = OnDrop(current_data_object_.get(), key_state, screen_pt, *effect);
return S_OK;
}
diff --git a/ui/base/dragdrop/os_exchange_data_provider_win.cc b/ui/base/dragdrop/os_exchange_data_provider_win.cc
index d283394..3b614bc 100644
--- a/ui/base/dragdrop/os_exchange_data_provider_win.cc
+++ b/ui/base/dragdrop/os_exchange_data_provider_win.cc
@@ -401,7 +401,7 @@ void OSExchangeDataProviderWin::SetHtml(const base::string16& html,
}
bool OSExchangeDataProviderWin::GetString(base::string16* data) const {
- return ClipboardUtil::GetPlainText(source_object_, data);
+ return ClipboardUtil::GetPlainText(source_object_.get(), data);
}
bool OSExchangeDataProviderWin::GetURLAndTitle(
@@ -410,14 +410,12 @@ bool OSExchangeDataProviderWin::GetURLAndTitle(
base::string16* title) const {
base::string16 url_str;
bool success = ClipboardUtil::GetUrl(
- source_object_,
- url,
- title,
+ source_object_.get(), url, title,
policy == OSExchangeData::CONVERT_FILENAMES ? true : false);
if (success) {
DCHECK(url->is_valid());
return true;
- } else if (GetPlainTextURL(source_object_, url)) {
+ } else if (GetPlainTextURL(source_object_.get(), url)) {
if (url->is_valid())
*title = net::GetSuggestedFilename(*url, "", "", "", "", std::string());
else
@@ -429,7 +427,7 @@ bool OSExchangeDataProviderWin::GetURLAndTitle(
bool OSExchangeDataProviderWin::GetFilename(base::FilePath* path) const {
std::vector<base::string16> filenames;
- bool success = ClipboardUtil::GetFilenames(source_object_, &filenames);
+ bool success = ClipboardUtil::GetFilenames(source_object_.get(), &filenames);
if (success)
*path = base::FilePath(filenames[0]);
return success;
@@ -438,7 +436,8 @@ bool OSExchangeDataProviderWin::GetFilename(base::FilePath* path) const {
bool OSExchangeDataProviderWin::GetFilenames(
std::vector<FileInfo>* filenames) const {
std::vector<base::string16> filenames_local;
- bool success = ClipboardUtil::GetFilenames(source_object_, &filenames_local);
+ bool success =
+ ClipboardUtil::GetFilenames(source_object_.get(), &filenames_local);
if (success) {
for (size_t i = 0; i < filenames_local.size(); ++i)
filenames->push_back(
@@ -470,7 +469,7 @@ bool OSExchangeDataProviderWin::GetFileContents(
base::FilePath* filename,
std::string* file_contents) const {
base::string16 filename_str;
- if (!ClipboardUtil::GetFileContents(source_object_, &filename_str,
+ if (!ClipboardUtil::GetFileContents(source_object_.get(), &filename_str,
file_contents)) {
return false;
}
@@ -481,34 +480,34 @@ bool OSExchangeDataProviderWin::GetFileContents(
bool OSExchangeDataProviderWin::GetHtml(base::string16* html,
GURL* base_url) const {
std::string url;
- bool success = ClipboardUtil::GetHtml(source_object_, html, &url);
+ bool success = ClipboardUtil::GetHtml(source_object_.get(), html, &url);
if (success)
*base_url = GURL(url);
return success;
}
bool OSExchangeDataProviderWin::HasString() const {
- return ClipboardUtil::HasPlainText(source_object_);
+ return ClipboardUtil::HasPlainText(source_object_.get());
}
bool OSExchangeDataProviderWin::HasURL(
OSExchangeData::FilenameToURLPolicy policy) const {
return (ClipboardUtil::HasUrl(
- source_object_,
+ source_object_.get(),
policy == OSExchangeData::CONVERT_FILENAMES ? true : false) ||
- HasPlainTextURL(source_object_));
+ HasPlainTextURL(source_object_.get()));
}
bool OSExchangeDataProviderWin::HasFile() const {
- return ClipboardUtil::HasFilenames(source_object_);
+ return ClipboardUtil::HasFilenames(source_object_.get());
}
bool OSExchangeDataProviderWin::HasFileContents() const {
- return ClipboardUtil::HasFileContents(source_object_);
+ return ClipboardUtil::HasFileContents(source_object_.get());
}
bool OSExchangeDataProviderWin::HasHtml() const {
- return ClipboardUtil::HasHtml(source_object_);
+ return ClipboardUtil::HasHtml(source_object_.get());
}
bool OSExchangeDataProviderWin::HasCustomFormat(
diff --git a/ui/base/win/shell.cc b/ui/base/win/shell.cc
index 91eaf93..60c3ac5 100644
--- a/ui/base/win/shell.cc
+++ b/ui/base/win/shell.cc
@@ -75,7 +75,7 @@ bool PreventWindowFromPinning(HWND hwnd) {
return false;
return base::win::SetBooleanValueForPropertyStore(
- pps, PKEY_AppUserModel_PreventPinning, true);
+ pps.get(), PKEY_AppUserModel_PreventPinning, true);
}
// TODO(calamity): investigate moving this out of the UI thread as COM
@@ -95,18 +95,19 @@ void SetAppDetailsForWindow(const base::string16& app_id,
hwnd, __uuidof(*pps), reinterpret_cast<void**>(pps.Receive()));
if (S_OK == result) {
if (!app_id.empty())
- base::win::SetAppIdForPropertyStore(pps, app_id.c_str());
+ base::win::SetAppIdForPropertyStore(pps.get(), app_id.c_str());
if (!app_icon.empty()) {
base::win::SetStringValueForPropertyStore(
- pps, PKEY_AppUserModel_RelaunchIconResource, app_icon.c_str());
+ pps.get(), PKEY_AppUserModel_RelaunchIconResource, app_icon.c_str());
}
if (!relaunch_command.empty()) {
base::win::SetStringValueForPropertyStore(
- pps, PKEY_AppUserModel_RelaunchCommand, relaunch_command.c_str());
+ pps.get(), PKEY_AppUserModel_RelaunchCommand,
+ relaunch_command.c_str());
}
if (!relaunch_display_name.empty()) {
base::win::SetStringValueForPropertyStore(
- pps, PKEY_AppUserModel_RelaunchDisplayNameResource,
+ pps.get(), PKEY_AppUserModel_RelaunchDisplayNameResource,
relaunch_display_name.c_str());
}
}
diff --git a/ui/views/widget/desktop_aura/desktop_drag_drop_client_win.cc b/ui/views/widget/desktop_aura/desktop_drag_drop_client_win.cc
index 26431c1..f471b32 100644
--- a/ui/views/widget/desktop_aura/desktop_drag_drop_client_win.cc
+++ b/ui/views/widget/desktop_aura/desktop_drag_drop_client_win.cc
@@ -37,10 +37,8 @@ int DesktopDragDropClientWin::StartDragAndDrop(
drag_source_ = new ui::DragSourceWin;
DWORD effect;
HRESULT result = DoDragDrop(
- ui::OSExchangeDataProviderWin::GetIDataObject(data),
- drag_source_,
- ui::DragDropTypes::DragOperationToDropEffect(operation),
- &effect);
+ ui::OSExchangeDataProviderWin::GetIDataObject(data), drag_source_.get(),
+ ui::DragDropTypes::DragOperationToDropEffect(operation), &effect);
drag_drop_in_progress_ = false;