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 "content/browser/web_contents/web_contents_view_aura.h" | 5 #include "content/browser/web_contents/web_contents_view_aura.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 if (!drop_data.download_metadata.empty()) | 355 if (!drop_data.download_metadata.empty()) |
356 PrepareDragForDownload(drop_data, provider, web_contents); | 356 PrepareDragForDownload(drop_data, provider, web_contents); |
357 #endif | 357 #endif |
358 #if (!defined(OS_CHROMEOS) && defined(USE_X11)) || defined(OS_WIN) | 358 #if (!defined(OS_CHROMEOS) && defined(USE_X11)) || defined(OS_WIN) |
359 // We set the file contents before the URL because the URL also sets file | 359 // We set the file contents before the URL because the URL also sets file |
360 // contents (to a .URL shortcut). We want to prefer file content data over | 360 // contents (to a .URL shortcut). We want to prefer file content data over |
361 // a shortcut so we add it first. | 361 // a shortcut so we add it first. |
362 if (!drop_data.file_contents.empty()) | 362 if (!drop_data.file_contents.empty()) |
363 PrepareDragForFileContents(drop_data, provider); | 363 PrepareDragForFileContents(drop_data, provider); |
364 #endif | 364 #endif |
| 365 // Call SetString() before SetURL() when we actually have a custom string. |
| 366 // SetURL() will itself do SetString() when a string hasn't been set yet, |
| 367 // but we want to prefer drop_data.text.string() over the URL string if it |
| 368 // exists. |
365 if (!drop_data.text.string().empty()) | 369 if (!drop_data.text.string().empty()) |
366 provider->SetString(drop_data.text.string()); | 370 provider->SetString(drop_data.text.string()); |
367 if (drop_data.url.is_valid()) | 371 if (drop_data.url.is_valid()) |
368 provider->SetURL(drop_data.url, drop_data.url_title); | 372 provider->SetURL(drop_data.url, drop_data.url_title); |
369 if (!drop_data.html.string().empty()) | 373 if (!drop_data.html.string().empty()) |
370 provider->SetHtml(drop_data.html.string(), drop_data.html_base_url); | 374 provider->SetHtml(drop_data.html.string(), drop_data.html_base_url); |
371 if (!drop_data.filenames.empty()) | 375 if (!drop_data.filenames.empty()) |
372 provider->SetFilenames(drop_data.filenames); | 376 provider->SetFilenames(drop_data.filenames); |
373 if (!drop_data.file_system_files.empty()) { | 377 if (!drop_data.file_system_files.empty()) { |
374 Pickle pickle; | 378 Pickle pickle; |
(...skipping 1225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1600 if (visible) { | 1604 if (visible) { |
1601 if (!web_contents_->should_normally_be_visible()) | 1605 if (!web_contents_->should_normally_be_visible()) |
1602 web_contents_->WasShown(); | 1606 web_contents_->WasShown(); |
1603 } else { | 1607 } else { |
1604 if (web_contents_->should_normally_be_visible()) | 1608 if (web_contents_->should_normally_be_visible()) |
1605 web_contents_->WasHidden(); | 1609 web_contents_->WasHidden(); |
1606 } | 1610 } |
1607 } | 1611 } |
1608 | 1612 |
1609 } // namespace content | 1613 } // namespace content |
OLD | NEW |