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

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

Issue 7016011: iwyu: Include stringprintf.h where appropriate, part 3. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Win fix. Created 9 years, 7 months 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 | « remoting/jingle_glue/iq_request_unittest.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 #include "ui/base/clipboard/clipboard_util_win.h" 5 #include "ui/base/clipboard/clipboard_util_win.h"
6 6
7 #include <shellapi.h> 7 #include <shellapi.h>
8 #include <shlwapi.h> 8 #include <shlwapi.h>
9 #include <wininet.h> // For INTERNET_MAX_URL_LENGTH. 9 #include <wininet.h> // For INTERNET_MAX_URL_LENGTH.
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/memory/scoped_handle.h" 13 #include "base/memory/scoped_handle.h"
14 #include "base/stringprintf.h"
14 #include "base/string_util.h" 15 #include "base/string_util.h"
15 #include "base/utf_string_conversions.h" 16 #include "base/utf_string_conversions.h"
16 #include "base/win/scoped_hglobal.h" 17 #include "base/win/scoped_hglobal.h"
17 18
18 namespace ui { 19 namespace ui {
19 20
20 namespace { 21 namespace {
21 22
22 bool GetUrlFromHDrop(IDataObject* data_object, std::wstring* url, 23 bool GetUrlFromHDrop(IDataObject* data_object, std::wstring* url,
23 std::wstring* title) { 24 std::wstring* title) {
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 size_t start_html_offset = strlen(header) - strlen(NUMBER_FORMAT) * 4 + 460 size_t start_html_offset = strlen(header) - strlen(NUMBER_FORMAT) * 4 +
460 MAX_DIGITS * 4; 461 MAX_DIGITS * 4;
461 if (!base_url.empty()) { 462 if (!base_url.empty()) {
462 start_html_offset += strlen(source_url_prefix) + 463 start_html_offset += strlen(source_url_prefix) +
463 base_url.length() + 2; // Add 2 for \r\n. 464 base_url.length() + 2; // Add 2 for \r\n.
464 } 465 }
465 size_t start_fragment_offset = start_html_offset + strlen(start_markup); 466 size_t start_fragment_offset = start_html_offset + strlen(start_markup);
466 size_t end_fragment_offset = start_fragment_offset + html.length(); 467 size_t end_fragment_offset = start_fragment_offset + html.length();
467 size_t end_html_offset = end_fragment_offset + strlen(end_markup); 468 size_t end_html_offset = end_fragment_offset + strlen(end_markup);
468 469
469 std::string result = StringPrintf(header, start_html_offset, 470 std::string result = base::StringPrintf(header,
470 end_html_offset, start_fragment_offset, end_fragment_offset); 471 start_html_offset,
472 end_html_offset,
473 start_fragment_offset,
474 end_fragment_offset);
471 if (!base_url.empty()) { 475 if (!base_url.empty()) {
472 result.append(source_url_prefix); 476 result.append(source_url_prefix);
473 result.append(base_url); 477 result.append(base_url);
474 result.append("\r\n"); 478 result.append("\r\n");
475 } 479 }
476 result.append(start_markup); 480 result.append(start_markup);
477 result.append(html); 481 result.append(html);
478 result.append(end_markup); 482 result.append(end_markup);
479 483
480 #undef MAX_DIGITS 484 #undef MAX_DIGITS
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 } 539 }
536 if (fragment_start != std::string::npos && 540 if (fragment_start != std::string::npos &&
537 fragment_end != std::string::npos) { 541 fragment_end != std::string::npos) {
538 *html = cf_html.substr(fragment_start, fragment_end - fragment_start); 542 *html = cf_html.substr(fragment_start, fragment_end - fragment_start);
539 TrimWhitespace(*html, TRIM_ALL, html); 543 TrimWhitespace(*html, TRIM_ALL, html);
540 } 544 }
541 } 545 }
542 } 546 }
543 547
544 } // namespace ui 548 } // namespace ui
OLDNEW
« no previous file with comments | « remoting/jingle_glue/iq_request_unittest.cc ('k') | ui/base/l10n/l10n_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698