Chromium Code Reviews| 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 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 362 provider->MarkOriginatedFromRenderer(); | 362 provider->MarkOriginatedFromRenderer(); |
| 363 #if defined(OS_WIN) | 363 #if defined(OS_WIN) |
| 364 // Put download before file contents to prefer the download of a image over | 364 // Put download before file contents to prefer the download of a image over |
| 365 // its thumbnail link. | 365 // its thumbnail link. |
| 366 if (!drop_data.download_metadata.empty()) | 366 if (!drop_data.download_metadata.empty()) |
| 367 PrepareDragForDownload(drop_data, provider, web_contents); | 367 PrepareDragForDownload(drop_data, provider, web_contents); |
| 368 #endif | 368 #endif |
| 369 #if (!defined(OS_CHROMEOS) && defined(USE_X11)) || defined(OS_WIN) | 369 #if (!defined(OS_CHROMEOS) && defined(USE_X11)) || defined(OS_WIN) |
| 370 // We set the file contents before the URL because the URL also sets file | 370 // We set the file contents before the URL because the URL also sets file |
| 371 // contents (to a .URL shortcut). We want to prefer file content data over | 371 // contents (to a .URL shortcut). We want to prefer file content data over |
| 372 // a shortcut so we add it first. | 372 // a shortcut so we add it first. |
|
pkotwicz
2014/06/20 22:12:01
I am not changing this comment because it is not a
pkotwicz
2014/06/20 22:17:25
I take the comment about consistency back. SetData
Peter Kasting
2014/06/20 22:26:22
All I can say about this comment is that even afte
| |
| 373 if (!drop_data.file_contents.empty()) | 373 if (!drop_data.file_contents.empty()) |
| 374 PrepareDragForFileContents(drop_data, provider); | 374 PrepareDragForFileContents(drop_data, provider); |
| 375 #endif | 375 #endif |
| 376 // Call SetString() before SetURL() when we actually have a custom string. | |
| 377 // SetURL() will itself do SetString() when a string hasn't been set yet, | |
| 378 // but we want to prefer drop_data.text.string() over the URL string if it | |
| 379 // exists. | |
| 376 if (!drop_data.text.string().empty()) | 380 if (!drop_data.text.string().empty()) |
| 377 provider->SetString(drop_data.text.string()); | 381 provider->SetString(drop_data.text.string()); |
| 378 if (drop_data.url.is_valid()) | 382 if (drop_data.url.is_valid()) |
| 379 provider->SetURL(drop_data.url, drop_data.url_title); | 383 provider->SetURL(drop_data.url, drop_data.url_title); |
| 380 if (!drop_data.html.string().empty()) | 384 if (!drop_data.html.string().empty()) |
| 381 provider->SetHtml(drop_data.html.string(), drop_data.html_base_url); | 385 provider->SetHtml(drop_data.html.string(), drop_data.html_base_url); |
| 382 if (!drop_data.filenames.empty()) | 386 if (!drop_data.filenames.empty()) |
| 383 provider->SetFilenames(drop_data.filenames); | 387 provider->SetFilenames(drop_data.filenames); |
| 384 if (!drop_data.file_system_files.empty()) { | 388 if (!drop_data.file_system_files.empty()) { |
| 385 Pickle pickle; | 389 Pickle pickle; |
| (...skipping 1183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1569 void WebContentsViewAura::OnWindowVisibilityChanged(aura::Window* window, | 1573 void WebContentsViewAura::OnWindowVisibilityChanged(aura::Window* window, |
| 1570 bool visible) { | 1574 bool visible) { |
| 1571 // Ignore any visibility changes in the hierarchy below. | 1575 // Ignore any visibility changes in the hierarchy below. |
| 1572 if (window != window_.get() && window_->Contains(window)) | 1576 if (window != window_.get() && window_->Contains(window)) |
| 1573 return; | 1577 return; |
| 1574 | 1578 |
| 1575 UpdateWebContentsVisibility(web_contents_, visible); | 1579 UpdateWebContentsVisibility(web_contents_, visible); |
| 1576 } | 1580 } |
| 1577 | 1581 |
| 1578 } // namespace content | 1582 } // namespace content |
| OLD | NEW |