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

Unified Diff: chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc
diff --git a/chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc b/chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc
index c4719a74fee1139dfea35f17c39d5d57b27d58e8..ebb315994704023eaa95d3ee8bf457675a899892 100644
--- a/chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc
+++ b/chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc
@@ -15,9 +15,12 @@
#include "chrome/browser/ui/gtk/gtk_chrome_button.h"
#include "chrome/browser/ui/gtk/gtk_theme_service.h"
#include "chrome/browser/ui/gtk/gtk_util.h"
+#include "grit/ui_strings.h"
+#include "net/base/net_util.h"
#include "ui/base/dragdrop/gtk_dnd_util.h"
#include "ui/base/gtk/gtk_hig_constants.h"
#include "ui/base/gtk/gtk_screen_util.h"
+#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/text/text_elider.h"
#include "ui/gfx/canvas_skia_paint.h"
@@ -456,4 +459,12 @@ bool CreateNewBookmarkFromNetscapeURL(GtkSelectionData* selection_data,
return true;
}
+string16 GetNameForURL(const GURL& url) {
+ if (url.is_valid()) {
+ return net::GetSuggestedFilename(url, "", "", "", "", std::string());
+ } else {
+ return l10n_util::GetStringUTF16(IDS_APP_UNTITLED_SHORTCUT_FILE_NAME);
+ }
+}
+
} // namespace bookmark_utils
« no previous file with comments | « chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.h ('k') | ui/base/dragdrop/os_exchange_data_provider_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698