| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "ui/base/dragdrop/os_exchange_data_provider_aura.h" | 5 #include "ui/base/dragdrop/os_exchange_data_provider_aura.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "net/base/net_util.h" | 9 #include "net/base/net_util.h" |
| 10 #include "ui/base/clipboard/clipboard.h" | 10 #include "ui/base/clipboard/clipboard.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 string_ = data; | 47 string_ = data; |
| 48 formats_ |= OSExchangeData::STRING; | 48 formats_ |= OSExchangeData::STRING; |
| 49 } | 49 } |
| 50 | 50 |
| 51 void OSExchangeDataProviderAura::SetURL(const GURL& url, | 51 void OSExchangeDataProviderAura::SetURL(const GURL& url, |
| 52 const base::string16& title) { | 52 const base::string16& title) { |
| 53 url_ = url; | 53 url_ = url; |
| 54 title_ = title; | 54 title_ = title; |
| 55 formats_ |= OSExchangeData::URL; | 55 formats_ |= OSExchangeData::URL; |
| 56 | 56 |
| 57 SetString(base::UTF8ToUTF16(url.spec())); | 57 if (!HasString()) |
| 58 SetString(base::UTF8ToUTF16(url.spec())); |
| 58 } | 59 } |
| 59 | 60 |
| 60 void OSExchangeDataProviderAura::SetFilename(const base::FilePath& path) { | 61 void OSExchangeDataProviderAura::SetFilename(const base::FilePath& path) { |
| 61 filenames_.clear(); | 62 filenames_.clear(); |
| 62 filenames_.push_back(FileInfo(path, base::FilePath())); | 63 filenames_.push_back(FileInfo(path, base::FilePath())); |
| 63 formats_ |= OSExchangeData::FILE_NAME; | 64 formats_ |= OSExchangeData::FILE_NAME; |
| 64 } | 65 } |
| 65 | 66 |
| 66 void OSExchangeDataProviderAura::SetFilenames( | 67 void OSExchangeDataProviderAura::SetFilenames( |
| 67 const std::vector<FileInfo>& filenames) { | 68 const std::vector<FileInfo>& filenames) { |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 | 203 |
| 203 /////////////////////////////////////////////////////////////////////////////// | 204 /////////////////////////////////////////////////////////////////////////////// |
| 204 // OSExchangeData, public: | 205 // OSExchangeData, public: |
| 205 | 206 |
| 206 // static | 207 // static |
| 207 OSExchangeData::Provider* OSExchangeData::CreateProvider() { | 208 OSExchangeData::Provider* OSExchangeData::CreateProvider() { |
| 208 return new OSExchangeDataProviderAura(); | 209 return new OSExchangeDataProviderAura(); |
| 209 } | 210 } |
| 210 | 211 |
| 211 } // namespace ui | 212 } // namespace ui |
| OLD | NEW |