Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(399)

Side by Side Diff: ui/base/clipboard/clipboard_win.cc

Issue 8418034: Make string_util::WriteInto() DCHECK() that the supplied |length_with_null| > 1, meaning that the... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sandbox/tests/common/controller.cc ('k') | ui/base/l10n/l10n_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // Many of these functions are based on those found in 5 // Many of these functions are based on those found in
6 // webkit/port/platform/PasteboardWin.cpp 6 // webkit/port/platform/PasteboardWin.cpp
7 7
8 #include "ui/base/clipboard/clipboard.h" 8 #include "ui/base/clipboard/clipboard.h"
9 9
10 #include <shlobj.h> 10 #include <shlobj.h>
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 597
598 HDROP drop = static_cast<HDROP>(::GetClipboardData(CF_HDROP)); 598 HDROP drop = static_cast<HDROP>(::GetClipboardData(CF_HDROP));
599 if (!drop) 599 if (!drop)
600 return; 600 return;
601 601
602 // Count of files in the HDROP. 602 // Count of files in the HDROP.
603 int count = ::DragQueryFile(drop, 0xffffffff, NULL, 0); 603 int count = ::DragQueryFile(drop, 0xffffffff, NULL, 0);
604 604
605 if (count) { 605 if (count) {
606 for (int i = 0; i < count; ++i) { 606 for (int i = 0; i < count; ++i) {
607 int size = ::DragQueryFile(drop, i, NULL, 0) + 1; 607 UINT size = ::DragQueryFile(drop, i, NULL, 0) + 1;
608 DCHECK_GT(size, 1u);
608 std::wstring file; 609 std::wstring file;
609 ::DragQueryFile(drop, i, WriteInto(&file, size), size); 610 ::DragQueryFile(drop, i, WriteInto(&file, size), size);
610 files->push_back(FilePath(file)); 611 files->push_back(FilePath(file));
611 } 612 }
612 } 613 }
613 } 614 }
614 615
615 void Clipboard::ReadData(const std::string& format, std::string* result) { 616 void Clipboard::ReadData(const std::string& format, std::string* result) {
616 if (!result) { 617 if (!result) {
617 NOTREACHED(); 618 NOTREACHED();
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 clipboard_owner_ = ::CreateWindow(L"ClipboardOwnerWindowClass", 738 clipboard_owner_ = ::CreateWindow(L"ClipboardOwnerWindowClass",
738 L"ClipboardOwnerWindow", 739 L"ClipboardOwnerWindow",
739 0, 0, 0, 0, 0, 740 0, 0, 0, 0, 0,
740 HWND_MESSAGE, 741 HWND_MESSAGE,
741 0, 0, 0); 742 0, 0, 0);
742 } 743 }
743 return clipboard_owner_; 744 return clipboard_owner_;
744 } 745 }
745 746
746 } // namespace ui 747 } // namespace ui
OLDNEW
« no previous file with comments | « sandbox/tests/common/controller.cc ('k') | ui/base/l10n/l10n_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698