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

Unified Diff: chrome/browser/bookmarks/bookmark_utils.cc

Issue 7310023: Pre-fill the 'Add Page' bookmark window with the current page (gtk and windows). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: move stuff into bookmark_utils Created 9 years, 5 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/bookmarks/bookmark_utils.cc
diff --git a/chrome/browser/bookmarks/bookmark_utils.cc b/chrome/browser/bookmarks/bookmark_utils.cc
index f4cc03a59bb711767d4b044acfe5a3d3a5c659ab..44c40b0f3576fd6ab61a8466118fac6d331f6dd8 100644
--- a/chrome/browser/bookmarks/bookmark_utils.cc
+++ b/chrome/browser/bookmarks/bookmark_utils.cc
@@ -646,6 +646,16 @@ void GetURLAndTitleToBookmark(TabContents* tab_contents,
*title = tab_contents->GetTitle();
}
+void GetURLAndTitleToBookmarkFromCurrentTab(Profile* profile,
+ GURL* url,
+ string16* title) {
+ Browser* browser = BrowserList::GetLastActiveWithProfile(profile);
+ TabContents* tab_contents = browser ? browser->GetSelectedTabContents()
+ : NULL;
+ if (tab_contents)
+ GetURLAndTitleToBookmark(tab_contents, url, title);
+}
+
void GetURLsForOpenTabs(Browser* browser,
std::vector<std::pair<GURL, string16> >* urls) {
for (int i = 0; i < browser->tab_count(); ++i) {

Powered by Google App Engine
This is Rietveld 408576698