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

Side by Side Diff: ui/base/dragdrop/os_exchange_data_provider_win.cc

Issue 11827058: bookmarks: GetNameForURL() function is only used by gtk. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update os_exchange_data_win_unittest.cc Created 7 years, 11 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
OLDNEW
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_win.h" 5 #include "ui/base/dragdrop/os_exchange_data_provider_win.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 } 381 }
382 382
383 bool OSExchangeDataProviderWin::GetURLAndTitle(GURL* url, 383 bool OSExchangeDataProviderWin::GetURLAndTitle(GURL* url,
384 string16* title) const { 384 string16* title) const {
385 string16 url_str; 385 string16 url_str;
386 bool success = ClipboardUtil::GetUrl(source_object_, &url_str, title, true); 386 bool success = ClipboardUtil::GetUrl(source_object_, &url_str, title, true);
387 if (success) { 387 if (success) {
388 GURL test_url(url_str); 388 GURL test_url(url_str);
389 if (test_url.is_valid()) { 389 if (test_url.is_valid()) {
390 *url = test_url; 390 *url = test_url;
391 *title = net::GetSuggestedFilename(*url, "", "", "", "", std::string());
391 return true; 392 return true;
393 } else {
394 *title = l10n_util::GetStringUTF16(IDS_APP_UNTITLED_SHORTCUT_FILE_NAME);
392 } 395 }
393 } else if (GetPlainTextURL(source_object_, url)) { 396 } else if (GetPlainTextURL(source_object_, url)) {
394 title->clear(); 397 title->clear();
395 return true; 398 return true;
396 } 399 }
397 return false; 400 return false;
398 } 401 }
399 402
400 bool OSExchangeDataProviderWin::GetFilename(FilePath* path) const { 403 bool OSExchangeDataProviderWin::GetFilename(FilePath* path) const {
401 std::vector<string16> filenames; 404 std::vector<string16> filenames;
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
982 return new OSExchangeDataProviderWin(); 985 return new OSExchangeDataProviderWin();
983 } 986 }
984 987
985 // static 988 // static
986 OSExchangeData::CustomFormat OSExchangeData::RegisterCustomFormat( 989 OSExchangeData::CustomFormat OSExchangeData::RegisterCustomFormat(
987 const std::string& type) { 990 const std::string& type) {
988 return RegisterClipboardFormat(ASCIIToUTF16(type).c_str()); 991 return RegisterClipboardFormat(ASCIIToUTF16(type).c_str());
989 } 992 }
990 993
991 } // namespace ui 994 } // namespace ui
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc ('k') | ui/base/dragdrop/os_exchange_data_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698