diff options
-rw-r--r-- | ui/base/dragdrop/cocoa_dnd_util.h | 2 | ||||
-rw-r--r-- | ui/base/dragdrop/cocoa_dnd_util.mm | 2 | ||||
-rw-r--r-- | ui/base/dragdrop/drag_utils.cc | 2 | ||||
-rw-r--r-- | ui/base/dragdrop/gtk_dnd_util.cc | 6 | ||||
-rw-r--r-- | ui/base/dragdrop/gtk_dnd_util.h | 6 | ||||
-rw-r--r-- | ui/base/dragdrop/gtk_dnd_util_unittest.cc | 6 | ||||
-rw-r--r-- | ui/base/dragdrop/os_exchange_data.cc | 12 | ||||
-rw-r--r-- | ui/base/dragdrop/os_exchange_data.h | 24 | ||||
-rw-r--r-- | ui/base/dragdrop/os_exchange_data_provider_aura.cc | 12 | ||||
-rw-r--r-- | ui/base/dragdrop/os_exchange_data_provider_aura.h | 19 | ||||
-rw-r--r-- | ui/base/dragdrop/os_exchange_data_provider_aurax11.cc | 21 | ||||
-rw-r--r-- | ui/base/dragdrop/os_exchange_data_provider_aurax11.h | 13 | ||||
-rw-r--r-- | ui/base/dragdrop/os_exchange_data_provider_win.cc | 38 | ||||
-rw-r--r-- | ui/base/dragdrop/os_exchange_data_provider_win.h | 12 |
14 files changed, 89 insertions, 86 deletions
diff --git a/ui/base/dragdrop/cocoa_dnd_util.h b/ui/base/dragdrop/cocoa_dnd_util.h index c143ec6..5b41014 100644 --- a/ui/base/dragdrop/cocoa_dnd_util.h +++ b/ui/base/dragdrop/cocoa_dnd_util.h @@ -35,7 +35,7 @@ UI_EXPORT extern NSString* const kChromeDragImageHTMLPboardType; // the pasteboard, |NO| otherwise. If |convert_filenames| is |YES|, the function // will also attempt to convert filenames in |pboard| to file URLs. UI_EXPORT BOOL PopulateURLAndTitleFromPasteboard(GURL* url, - string16* title, + base::string16* title, NSPasteboard* pboard, BOOL convert_filenames); diff --git a/ui/base/dragdrop/cocoa_dnd_util.mm b/ui/base/dragdrop/cocoa_dnd_util.mm index 86c171d..83a1331 100644 --- a/ui/base/dragdrop/cocoa_dnd_util.mm +++ b/ui/base/dragdrop/cocoa_dnd_util.mm @@ -16,7 +16,7 @@ NSString* const kChromeDragDummyPboardType = @"org.chromium.drag-dummy-type"; NSString* const kChromeDragImageHTMLPboardType = @"org.chromium.image-html"; BOOL PopulateURLAndTitleFromPasteboard(GURL* url, - string16* title, + base::string16* title, NSPasteboard* pboard, BOOL convert_filenames) { CHECK(url); diff --git a/ui/base/dragdrop/drag_utils.cc b/ui/base/dragdrop/drag_utils.cc index e02e457..7ae028f 100644 --- a/ui/base/dragdrop/drag_utils.cc +++ b/ui/base/dragdrop/drag_utils.cc @@ -48,7 +48,7 @@ class FileDragImageSource : public gfx::CanvasImageSource { // Paint the icon. canvas->DrawImageInt(icon_, (size().width() - icon_.width()) / 2, 0); - string16 name = file_name_.BaseName().LossyDisplayName(); + base::string16 name = file_name_.BaseName().LossyDisplayName(); const int flags = gfx::Canvas::TEXT_ALIGN_CENTER; #if defined(OS_WIN) // Paint the file name. We inset it one pixel to allow room for the halo. diff --git a/ui/base/dragdrop/gtk_dnd_util.cc b/ui/base/dragdrop/gtk_dnd_util.cc index d4499df..77e9a97 100644 --- a/ui/base/dragdrop/gtk_dnd_util.cc +++ b/ui/base/dragdrop/gtk_dnd_util.cc @@ -154,7 +154,7 @@ void SetDestTargetList(GtkWidget* dest, const int* target_codes) { void WriteURLWithName(GtkSelectionData* selection_data, const GURL& url, - string16 title, + base::string16 title, int type) { if (title.empty()) { // We prefer to not have empty titles. Set it to the filename extracted @@ -208,7 +208,7 @@ void WriteURLWithName(GtkSelectionData* selection_data, bool ExtractNamedURL(GtkSelectionData* selection_data, GURL* url, - string16* title) { + base::string16* title) { if (!selection_data || gtk_selection_data_get_length(selection_data) <= 0) return false; @@ -249,7 +249,7 @@ bool ExtractURIList(GtkSelectionData* selection_data, std::vector<GURL>* urls) { bool ExtractNetscapeURL(GtkSelectionData* selection_data, GURL* url, - string16* title) { + base::string16* title) { if (!selection_data || gtk_selection_data_get_length(selection_data) <= 0) return false; diff --git a/ui/base/dragdrop/gtk_dnd_util.h b/ui/base/dragdrop/gtk_dnd_util.h index 3744faa..88f00a3 100644 --- a/ui/base/dragdrop/gtk_dnd_util.h +++ b/ui/base/dragdrop/gtk_dnd_util.h @@ -68,7 +68,7 @@ UI_EXPORT void SetDestTargetList(GtkWidget* dest, const int* target_codes); // Write a URL to the selection in the given type. UI_EXPORT void WriteURLWithName(GtkSelectionData* selection_data, const GURL& url, - string16 title, + base::string16 title, int type); // Extracts data of type CHROME_NAMED_URL from |selection_data| into @@ -76,7 +76,7 @@ UI_EXPORT void WriteURLWithName(GtkSelectionData* selection_data, // and the url is valid. UI_EXPORT bool ExtractNamedURL(GtkSelectionData* selection_data, GURL* url, - string16* title); + base::string16* title); // Extracts data of type TEXT_URI_LIST from |selection_data| into |urls|. UI_EXPORT bool ExtractURIList(GtkSelectionData* selection_data, @@ -85,7 +85,7 @@ UI_EXPORT bool ExtractURIList(GtkSelectionData* selection_data, // Extracts a Netscape URL (url\ntitle) from |selection_data|. UI_EXPORT bool ExtractNetscapeURL(GtkSelectionData* selection_data, GURL* url, - string16* title); + base::string16* title); } // namespace ui diff --git a/ui/base/dragdrop/gtk_dnd_util_unittest.cc b/ui/base/dragdrop/gtk_dnd_util_unittest.cc index 4587f5a..bd5e0ae 100644 --- a/ui/base/dragdrop/gtk_dnd_util_unittest.cc +++ b/ui/base/dragdrop/gtk_dnd_util_unittest.cc @@ -27,7 +27,7 @@ TEST(GtkDndUtilTest, ExtractNamedURLValid) { data.length = pickle.size(); GURL url; - string16 title; + base::string16 title; ASSERT_EQ(true, ui::ExtractNamedURL(&data, &url, &title)); EXPECT_EQ(UTF8ToUTF16(kTitle), title); EXPECT_EQ(GURL(kUrl), url); @@ -47,13 +47,13 @@ TEST(GtkDndUtilTest, ExtractNamedURLInvalidURL) { data.length = pickle.size(); GURL url; - string16 title; + base::string16 title; EXPECT_FALSE(ui::ExtractNamedURL(&data, &url, &title)); } TEST(GtkDndUtilTest, ExtractNamedURLInvalidInput) { GURL url; - string16 title; + base::string16 title; GtkSelectionData data; data.data = NULL; data.length = 0; diff --git a/ui/base/dragdrop/os_exchange_data.cc b/ui/base/dragdrop/os_exchange_data.cc index eec4900..c56d306 100644 --- a/ui/base/dragdrop/os_exchange_data.cc +++ b/ui/base/dragdrop/os_exchange_data.cc @@ -36,11 +36,11 @@ OSExchangeData::OSExchangeData(Provider* provider) : provider_(provider) { OSExchangeData::~OSExchangeData() { } -void OSExchangeData::SetString(const string16& data) { +void OSExchangeData::SetString(const base::string16& data) { provider_->SetString(data); } -void OSExchangeData::SetURL(const GURL& url, const string16& title) { +void OSExchangeData::SetURL(const GURL& url, const base::string16& title) { provider_->SetURL(url, title); } @@ -58,11 +58,11 @@ void OSExchangeData::SetPickledData(const CustomFormat& format, provider_->SetPickledData(format, data); } -bool OSExchangeData::GetString(string16* data) const { +bool OSExchangeData::GetString(base::string16* data) const { return provider_->GetString(data); } -bool OSExchangeData::GetURLAndTitle(GURL* url, string16* title) const { +bool OSExchangeData::GetURLAndTitle(GURL* url, base::string16* title) const { return provider_->GetURLAndTitle(url, title); } @@ -167,11 +167,11 @@ void OSExchangeData::SetInDragLoop(bool in_drag_loop) { #endif #if defined(OS_WIN) || defined(USE_AURA) -void OSExchangeData::SetHtml(const string16& html, const GURL& base_url) { +void OSExchangeData::SetHtml(const base::string16& html, const GURL& base_url) { provider_->SetHtml(html, base_url); } -bool OSExchangeData::GetHtml(string16* html, GURL* base_url) const { +bool OSExchangeData::GetHtml(base::string16* html, GURL* base_url) const { return provider_->GetHtml(html, base_url); } #endif diff --git a/ui/base/dragdrop/os_exchange_data.h b/ui/base/dragdrop/os_exchange_data.h index d47d9eb..0f48112 100644 --- a/ui/base/dragdrop/os_exchange_data.h +++ b/ui/base/dragdrop/os_exchange_data.h @@ -96,16 +96,16 @@ class UI_EXPORT OSExchangeData { Provider() {} virtual ~Provider() {} - virtual void SetString(const string16& data) = 0; - virtual void SetURL(const GURL& url, const string16& title) = 0; + virtual void SetString(const base::string16& data) = 0; + virtual void SetURL(const GURL& url, const base::string16& title) = 0; virtual void SetFilename(const base::FilePath& path) = 0; virtual void SetFilenames( const std::vector<FileInfo>& file_names) = 0; virtual void SetPickledData(const CustomFormat& format, const Pickle& data) = 0; - virtual bool GetString(string16* data) const = 0; - virtual bool GetURLAndTitle(GURL* url, string16* title) const = 0; + virtual bool GetString(base::string16* data) const = 0; + virtual bool GetURLAndTitle(GURL* url, base::string16* title) const = 0; virtual bool GetFilename(base::FilePath* path) const = 0; virtual bool GetFilenames( std::vector<FileInfo>* file_names) const = 0; @@ -128,8 +128,8 @@ class UI_EXPORT OSExchangeData { #endif #if defined(OS_WIN) || defined(USE_AURA) - virtual void SetHtml(const string16& html, const GURL& base_url) = 0; - virtual bool GetHtml(string16* html, GURL* base_url) const = 0; + virtual void SetHtml(const base::string16& html, const GURL& base_url) = 0; + virtual bool GetHtml(base::string16* html, GURL* base_url) const = 0; virtual bool HasHtml() const = 0; #endif @@ -165,9 +165,9 @@ class UI_EXPORT OSExchangeData { // the order of enumeration in our IEnumFORMATETC implementation! // This comes into play when selecting the best (most preferable) // data type for insertion into a DropTarget. - void SetString(const string16& data); + void SetString(const base::string16& data); // A URL can have an optional title in some exchange formats. - void SetURL(const GURL& url, const string16& title); + void SetURL(const GURL& url, const base::string16& title); // A full path to a file. void SetFilename(const base::FilePath& path); // Full path to one or more files. See also SetFilenames() in Provider. @@ -180,8 +180,8 @@ class UI_EXPORT OSExchangeData { // functions return and the result is in the out parameter. If the data does // not exist, the out parameter is not touched. The out parameter cannot be // NULL. - bool GetString(string16* data) const; - bool GetURLAndTitle(GURL* url, string16* title) const; + bool GetString(base::string16* data) const; + bool GetURLAndTitle(GURL* url, base::string16* title) const; // Return the path of a file, if available. bool GetFilename(base::FilePath* path) const; bool GetFilenames( @@ -221,8 +221,8 @@ class UI_EXPORT OSExchangeData { #if defined(OS_WIN) || defined(USE_AURA) // Adds a snippet of HTML. |html| is just raw html but this sets both // text/html and CF_HTML. - void SetHtml(const string16& html, const GURL& base_url); - bool GetHtml(string16* html, GURL* base_url) const; + void SetHtml(const base::string16& html, const GURL& base_url); + bool GetHtml(base::string16* html, GURL* base_url) const; #endif private: diff --git a/ui/base/dragdrop/os_exchange_data_provider_aura.cc b/ui/base/dragdrop/os_exchange_data_provider_aura.cc index 88f3202..a02ab12 100644 --- a/ui/base/dragdrop/os_exchange_data_provider_aura.cc +++ b/ui/base/dragdrop/os_exchange_data_provider_aura.cc @@ -18,13 +18,13 @@ OSExchangeDataProviderAura::OSExchangeDataProviderAura() OSExchangeDataProviderAura::~OSExchangeDataProviderAura() {} -void OSExchangeDataProviderAura::SetString(const string16& data) { +void OSExchangeDataProviderAura::SetString(const base::string16& data) { string_ = data; formats_ |= OSExchangeData::STRING; } void OSExchangeDataProviderAura::SetURL(const GURL& url, - const string16& title) { + const base::string16& title) { url_ = url; title_ = title; formats_ |= OSExchangeData::URL; @@ -49,7 +49,7 @@ void OSExchangeDataProviderAura::SetPickledData( formats_ |= OSExchangeData::PICKLED_DATA; } -bool OSExchangeDataProviderAura::GetString(string16* data) const { +bool OSExchangeDataProviderAura::GetString(base::string16* data) const { if ((formats_ & OSExchangeData::STRING) == 0) return false; *data = string_; @@ -57,7 +57,7 @@ bool OSExchangeDataProviderAura::GetString(string16* data) const { } bool OSExchangeDataProviderAura::GetURLAndTitle(GURL* url, - string16* title) const { + base::string16* title) const { if ((formats_ & OSExchangeData::URL) == 0) { title->clear(); return GetPlainTextURL(url); @@ -119,14 +119,14 @@ bool OSExchangeDataProviderAura::HasCustomFormat( return pickle_data_.find(format) != pickle_data_.end(); } -void OSExchangeDataProviderAura::SetHtml(const string16& html, +void OSExchangeDataProviderAura::SetHtml(const base::string16& html, const GURL& base_url) { formats_ |= OSExchangeData::HTML; html_ = html; base_url_ = base_url; } -bool OSExchangeDataProviderAura::GetHtml(string16* html, +bool OSExchangeDataProviderAura::GetHtml(base::string16* html, GURL* base_url) const { if ((formats_ & OSExchangeData::HTML) == 0) return false; diff --git a/ui/base/dragdrop/os_exchange_data_provider_aura.h b/ui/base/dragdrop/os_exchange_data_provider_aura.h index 630d169..38dfdda 100644 --- a/ui/base/dragdrop/os_exchange_data_provider_aura.h +++ b/ui/base/dragdrop/os_exchange_data_provider_aura.h @@ -26,15 +26,15 @@ class UI_EXPORT OSExchangeDataProviderAura virtual ~OSExchangeDataProviderAura(); // Overridden from OSExchangeData::Provider: - virtual void SetString(const string16& data) OVERRIDE; - virtual void SetURL(const GURL& url, const string16& title) OVERRIDE; + virtual void SetString(const base::string16& data) OVERRIDE; + virtual void SetURL(const GURL& url, const base::string16& title) OVERRIDE; virtual void SetFilename(const base::FilePath& path) OVERRIDE; virtual void SetFilenames( const std::vector<OSExchangeData::FileInfo>& filenames) OVERRIDE; virtual void SetPickledData(const OSExchangeData::CustomFormat& format, const Pickle& data) OVERRIDE; - virtual bool GetString(string16* data) const OVERRIDE; - virtual bool GetURLAndTitle(GURL* url, string16* title) const OVERRIDE; + virtual bool GetString(base::string16* data) const OVERRIDE; + virtual bool GetURLAndTitle(GURL* url, base::string16* title) const OVERRIDE; virtual bool GetFilename(base::FilePath* path) const OVERRIDE; virtual bool GetFilenames( std::vector<OSExchangeData::FileInfo>* filenames) const OVERRIDE; @@ -46,8 +46,9 @@ class UI_EXPORT OSExchangeDataProviderAura virtual bool HasCustomFormat(const OSExchangeData::CustomFormat& format) const OVERRIDE; - virtual void SetHtml(const string16& html, const GURL& base_url) OVERRIDE; - virtual bool GetHtml(string16* html, GURL* base_url) const OVERRIDE; + virtual void SetHtml(const base::string16& html, + const GURL& base_url) OVERRIDE; + virtual bool GetHtml(base::string16* html, GURL* base_url) const OVERRIDE; virtual bool HasHtml() const OVERRIDE; virtual void SetDragImage(const gfx::ImageSkia& image, const gfx::Vector2d& cursor_offset) OVERRIDE; @@ -66,11 +67,11 @@ class UI_EXPORT OSExchangeDataProviderAura int formats_; // String contents. - string16 string_; + base::string16 string_; // URL contents. GURL url_; - string16 title_; + base::string16 title_; // File name. std::vector<OSExchangeData::FileInfo> filenames_; @@ -83,7 +84,7 @@ class UI_EXPORT OSExchangeDataProviderAura gfx::Vector2d drag_image_offset_; // For HTML format - string16 html_; + base::string16 html_; GURL base_url_; DISALLOW_COPY_AND_ASSIGN(OSExchangeDataProviderAura); diff --git a/ui/base/dragdrop/os_exchange_data_provider_aurax11.cc b/ui/base/dragdrop/os_exchange_data_provider_aurax11.cc index 7aed8d8..e7a2de6 100644 --- a/ui/base/dragdrop/os_exchange_data_provider_aurax11.cc +++ b/ui/base/dragdrop/os_exchange_data_provider_aurax11.cc @@ -102,7 +102,7 @@ SelectionFormatMap OSExchangeDataProviderAuraX11::GetFormatMap() const { return selection_owner_.selection_format_map(); } -void OSExchangeDataProviderAuraX11::SetString(const string16& text_data) { +void OSExchangeDataProviderAuraX11::SetString(const base::string16& text_data) { std::string utf8 = UTF16ToUTF8(text_data); scoped_refptr<base::RefCountedMemory> mem( base::RefCountedString::TakeString(&utf8)); @@ -114,7 +114,7 @@ void OSExchangeDataProviderAuraX11::SetString(const string16& text_data) { } void OSExchangeDataProviderAuraX11::SetURL(const GURL& url, - const string16& title) { + const base::string16& title) { NOTIMPLEMENTED(); } @@ -133,7 +133,7 @@ void OSExchangeDataProviderAuraX11::SetPickledData( NOTIMPLEMENTED(); } -bool OSExchangeDataProviderAuraX11::GetString(string16* result) const { +bool OSExchangeDataProviderAuraX11::GetString(base::string16* result) const { std::vector< ::Atom> text_atoms = ui::GetTextAtomsFrom(&atom_cache_); std::vector< ::Atom> requested_types; ui::GetAtomIntersection(text_atoms, GetTargets(), &requested_types); @@ -148,8 +148,9 @@ bool OSExchangeDataProviderAuraX11::GetString(string16* result) const { return false; } -bool OSExchangeDataProviderAuraX11::GetURLAndTitle(GURL* url, - string16* title) const { +bool OSExchangeDataProviderAuraX11::GetURLAndTitle( + GURL* url, + base::string16* title) const { std::vector< ::Atom> url_atoms = ui::GetURLAtomsFrom(&atom_cache_); std::vector< ::Atom> requested_types; ui::GetAtomIntersection(url_atoms, GetTargets(), &requested_types); @@ -162,10 +163,10 @@ bool OSExchangeDataProviderAuraX11::GetURLAndTitle(GURL* url, if (data.GetType() == atom_cache_.GetAtom(kMimeTypeMozillaURL)) { // Mozilla URLs are (UTF16: URL, newline, title). - string16 unparsed; + base::string16 unparsed; data.AssignTo(&unparsed); - std::vector<string16> tokens; + std::vector<base::string16> tokens; size_t num_tokens = Tokenize(unparsed, ASCIIToUTF16("\n"), &tokens); if (num_tokens >= 2) { *url = GURL(tokens[0]); @@ -189,7 +190,7 @@ bool OSExchangeDataProviderAuraX11::GetURLAndTitle(GURL* url, } *url = GURL(tokens[0]); - *title = string16(); + *title = base::string16(); return true; } @@ -245,12 +246,12 @@ bool OSExchangeDataProviderAuraX11::HasCustomFormat( return !requested_types.empty(); } -void OSExchangeDataProviderAuraX11::SetHtml(const string16& html, +void OSExchangeDataProviderAuraX11::SetHtml(const base::string16& html, const GURL& base_url) { NOTIMPLEMENTED(); } -bool OSExchangeDataProviderAuraX11::GetHtml(string16* html, +bool OSExchangeDataProviderAuraX11::GetHtml(base::string16* html, GURL* base_url) const { std::vector< ::Atom> url_atoms; url_atoms.push_back(atom_cache_.GetAtom(Clipboard::kMimeTypeHTML)); diff --git a/ui/base/dragdrop/os_exchange_data_provider_aurax11.h b/ui/base/dragdrop/os_exchange_data_provider_aurax11.h index 09568e2..6212563 100644 --- a/ui/base/dragdrop/os_exchange_data_provider_aurax11.h +++ b/ui/base/dragdrop/os_exchange_data_provider_aurax11.h @@ -56,15 +56,15 @@ class UI_EXPORT OSExchangeDataProviderAuraX11 SelectionFormatMap GetFormatMap() const; // Overridden from OSExchangeData::Provider: - virtual void SetString(const string16& data) OVERRIDE; - virtual void SetURL(const GURL& url, const string16& title) OVERRIDE; + virtual void SetString(const base::string16& data) OVERRIDE; + virtual void SetURL(const GURL& url, const base::string16& title) OVERRIDE; virtual void SetFilename(const base::FilePath& path) OVERRIDE; virtual void SetFilenames( const std::vector<OSExchangeData::FileInfo>& filenames) OVERRIDE; virtual void SetPickledData(const OSExchangeData::CustomFormat& format, const Pickle& data) OVERRIDE; - virtual bool GetString(string16* data) const OVERRIDE; - virtual bool GetURLAndTitle(GURL* url, string16* title) const OVERRIDE; + virtual bool GetString(base::string16* data) const OVERRIDE; + virtual bool GetURLAndTitle(GURL* url, base::string16* title) const OVERRIDE; virtual bool GetFilename(base::FilePath* path) const OVERRIDE; virtual bool GetFilenames( std::vector<OSExchangeData::FileInfo>* filenames) const OVERRIDE; @@ -76,8 +76,9 @@ class UI_EXPORT OSExchangeDataProviderAuraX11 virtual bool HasCustomFormat(const OSExchangeData::CustomFormat& format) const OVERRIDE; - virtual void SetHtml(const string16& html, const GURL& base_url) OVERRIDE; - virtual bool GetHtml(string16* html, GURL* base_url) const OVERRIDE; + virtual void SetHtml(const base::string16& html, + const GURL& base_url) OVERRIDE; + virtual bool GetHtml(base::string16* html, GURL* base_url) const OVERRIDE; virtual bool HasHtml() const OVERRIDE; virtual void SetDragImage(const gfx::ImageSkia& image, const gfx::Vector2d& cursor_offset) OVERRIDE; diff --git a/ui/base/dragdrop/os_exchange_data_provider_win.cc b/ui/base/dragdrop/os_exchange_data_provider_win.cc index c33ed5b..1800e06 100644 --- a/ui/base/dragdrop/os_exchange_data_provider_win.cc +++ b/ui/base/dragdrop/os_exchange_data_provider_win.cc @@ -33,8 +33,8 @@ static STGMEDIUM* GetStorageForString(const std::basic_string<T>& data); static void GetInternetShortcutFileContents(const GURL& url, std::string* data); // Creates a valid file name given a suggested title and URL. static void CreateValidFileNameFromTitle(const GURL& url, - const string16& title, - string16* validated); + const base::string16& title, + base::string16* validated); // Creates a new STGMEDIUM object to hold a file. static STGMEDIUM* GetStorageForFileName(const base::FilePath& path); static STGMEDIUM* GetIDListStorageForFileName(const base::FilePath& path); @@ -211,7 +211,7 @@ FormatEtcEnumerator* FormatEtcEnumerator::CloneFromOther( // static bool OSExchangeDataProviderWin::HasPlainTextURL(IDataObject* source) { - string16 plain_text; + base::string16 plain_text; return (ClipboardUtil::GetPlainText(source, &plain_text) && !plain_text.empty() && GURL(plain_text).is_valid()); } @@ -219,7 +219,7 @@ bool OSExchangeDataProviderWin::HasPlainTextURL(IDataObject* source) { // static bool OSExchangeDataProviderWin::GetPlainTextURL(IDataObject* source, GURL* url) { - string16 plain_text; + base::string16 plain_text; if (ClipboardUtil::GetPlainText(source, &plain_text) && !plain_text.empty()) { GURL gurl(plain_text); @@ -265,7 +265,7 @@ OSExchangeDataProviderWin::OSExchangeDataProviderWin() OSExchangeDataProviderWin::~OSExchangeDataProviderWin() { } -void OSExchangeDataProviderWin::SetString(const string16& data) { +void OSExchangeDataProviderWin::SetString(const base::string16& data) { STGMEDIUM* storage = GetStorageForString(data); data_->contents_.push_back(new DataObjectImpl::StoredDataInfo( Clipboard::GetPlainTextWFormatType().ToFormatEtc(), storage)); @@ -277,7 +277,7 @@ void OSExchangeDataProviderWin::SetString(const string16& data) { } void OSExchangeDataProviderWin::SetURL(const GURL& url, - const string16& title) { + const base::string16& title) { // NOTE WELL: // Every time you change the order of the first two CLIPFORMATS that get // added here, you need to update the EnumerationViaCOM test case in @@ -285,7 +285,7 @@ void OSExchangeDataProviderWin::SetURL(const GURL& url, // will fail! It assumes an insertion order. // Add text/x-moz-url for drags from Firefox - string16 x_moz_url_str = UTF8ToUTF16(url.spec()); + base::string16 x_moz_url_str = UTF8ToUTF16(url.spec()); x_moz_url_str += '\n'; x_moz_url_str += title; STGMEDIUM* storage = GetStorageForString(x_moz_url_str); @@ -293,7 +293,7 @@ void OSExchangeDataProviderWin::SetURL(const GURL& url, Clipboard::GetMozUrlFormatType().ToFormatEtc(), storage)); // Add a .URL shortcut file for dragging to Explorer. - string16 valid_file_name; + base::string16 valid_file_name; CreateValidFileNameFromTitle(url, title, &valid_file_name); std::string shortcut_url_file_contents; GetInternetShortcutFileContents(url, &shortcut_url_file_contents); @@ -361,7 +361,7 @@ void OSExchangeDataProviderWin::SetFileContents( Clipboard::GetFileContentZeroFormatType().ToFormatEtc(), storage)); } -void OSExchangeDataProviderWin::SetHtml(const string16& html, +void OSExchangeDataProviderWin::SetHtml(const base::string16& html, const GURL& base_url) { // Add both MS CF_HTML and text/html format. CF_HTML should be in utf-8. std::string utf8_html = UTF16ToUTF8(html); @@ -378,13 +378,13 @@ void OSExchangeDataProviderWin::SetHtml(const string16& html, Clipboard::GetTextHtmlFormatType().ToFormatEtc(), storage_plain)); } -bool OSExchangeDataProviderWin::GetString(string16* data) const { +bool OSExchangeDataProviderWin::GetString(base::string16* data) const { return ClipboardUtil::GetPlainText(source_object_, data); } bool OSExchangeDataProviderWin::GetURLAndTitle(GURL* url, - string16* title) const { - string16 url_str; + base::string16* title) const { + base::string16 url_str; bool success = ClipboardUtil::GetUrl(source_object_, &url_str, title, true); if (success) { GURL test_url(url_str); @@ -403,7 +403,7 @@ bool OSExchangeDataProviderWin::GetURLAndTitle(GURL* url, } bool OSExchangeDataProviderWin::GetFilename(base::FilePath* path) const { - std::vector<string16> filenames; + std::vector<base::string16> filenames; bool success = ClipboardUtil::GetFilenames(source_object_, &filenames); if (success) *path = base::FilePath(filenames[0]); @@ -412,7 +412,7 @@ bool OSExchangeDataProviderWin::GetFilename(base::FilePath* path) const { bool OSExchangeDataProviderWin::GetFilenames( std::vector<OSExchangeData::FileInfo>* filenames) const { - std::vector<string16> filenames_local; + std::vector<base::string16> filenames_local; bool success = ClipboardUtil::GetFilenames(source_object_, &filenames_local); if (success) { for (size_t i = 0; i < filenames_local.size(); ++i) @@ -445,7 +445,7 @@ bool OSExchangeDataProviderWin::GetPickledData( bool OSExchangeDataProviderWin::GetFileContents( base::FilePath* filename, std::string* file_contents) const { - string16 filename_str; + base::string16 filename_str; if (!ClipboardUtil::GetFileContents(source_object_, &filename_str, file_contents)) { return false; @@ -454,7 +454,7 @@ bool OSExchangeDataProviderWin::GetFileContents( return true; } -bool OSExchangeDataProviderWin::GetHtml(string16* html, +bool OSExchangeDataProviderWin::GetHtml(base::string16* html, GURL* base_url) const { std::string url; bool success = ClipboardUtil::GetHtml(source_object_, html, &url); @@ -884,8 +884,8 @@ static void GetInternetShortcutFileContents(const GURL& url, } static void CreateValidFileNameFromTitle(const GURL& url, - const string16& title, - string16* validated) { + const base::string16& title, + base::string16* validated) { if (title.empty()) { if (url.is_valid()) { *validated = net::GetSuggestedFilename(url, "", "", "", "", @@ -1008,7 +1008,7 @@ static STGMEDIUM* GetIDListStorageForFileName(const base::FilePath& path) { static STGMEDIUM* GetStorageForFileDescriptor( const base::FilePath& path) { - string16 file_name = path.value(); + base::string16 file_name = path.value(); DCHECK(!file_name.empty()); HANDLE hdata = GlobalAlloc(GPTR, sizeof(FILEGROUPDESCRIPTOR)); base::win::ScopedHGlobal<FILEGROUPDESCRIPTOR> locked_mem(hdata); diff --git a/ui/base/dragdrop/os_exchange_data_provider_win.h b/ui/base/dragdrop/os_exchange_data_provider_win.h index 4cf2bea..1fbf51d 100644 --- a/ui/base/dragdrop/os_exchange_data_provider_win.h +++ b/ui/base/dragdrop/os_exchange_data_provider_win.h @@ -147,8 +147,8 @@ class UI_EXPORT OSExchangeDataProviderWin : public OSExchangeData::Provider { IDataObjectAsyncCapability* async_operation() const { return data_.get(); } // OSExchangeData::Provider methods. - virtual void SetString(const string16& data); - virtual void SetURL(const GURL& url, const string16& title); + virtual void SetString(const base::string16& data); + virtual void SetURL(const GURL& url, const base::string16& title); virtual void SetFilename(const base::FilePath& path); virtual void SetFilenames( const std::vector<OSExchangeData::FileInfo>& filenames); @@ -156,10 +156,10 @@ class UI_EXPORT OSExchangeDataProviderWin : public OSExchangeData::Provider { const Pickle& data); virtual void SetFileContents(const base::FilePath& filename, const std::string& file_contents); - virtual void SetHtml(const string16& html, const GURL& base_url); + virtual void SetHtml(const base::string16& html, const GURL& base_url); - virtual bool GetString(string16* data) const; - virtual bool GetURLAndTitle(GURL* url, string16* title) const; + virtual bool GetString(base::string16* data) const; + virtual bool GetURLAndTitle(GURL* url, base::string16* title) const; virtual bool GetFilename(base::FilePath* path) const; virtual bool GetFilenames( std::vector<OSExchangeData::FileInfo>* filenames) const; @@ -167,7 +167,7 @@ class UI_EXPORT OSExchangeDataProviderWin : public OSExchangeData::Provider { Pickle* data) const; virtual bool GetFileContents(base::FilePath* filename, std::string* file_contents) const; - virtual bool GetHtml(string16* html, GURL* base_url) const; + virtual bool GetHtml(base::string16* html, GURL* base_url) const; virtual bool HasString() const; virtual bool HasURL() const; virtual bool HasFile() const; |