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

Unified Diff: chrome/browser/ui/webui/ntp/new_tab_page_sync_handler.cc

Issue 7833042: Finalize a CL originally by departed intern ycxiao@ that detaches the loading of cookies from the... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 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/webui/ntp/new_tab_page_sync_handler.cc
===================================================================
--- chrome/browser/ui/webui/ntp/new_tab_page_sync_handler.cc (revision 99705)
+++ chrome/browser/ui/webui/ntp/new_tab_page_sync_handler.cc (working copy)
@@ -26,52 +26,6 @@
// configurable.
static const char kSyncDefaultViewOnlineUrl[] = "http://docs.google.com";
-// TODO(idana): the following code was originally copied from
-// toolbar_importer.h/cc and it needs to be moved to a common Google Accounts
-// utility.
-
-// A simple pair of fields that identify a set of Google cookies, used to
-// filter from a larger set.
-struct GoogleCookieFilter {
- // The generalized, fully qualified URL of pages where
- // cookies with id |cookie_id| are obtained / accessed.
- const char* url;
- // The id of the cookie this filter is selecting,
- // with name/value delimiter (i.e '=').
- const char* cookie_id;
-};
-
-// Filters to select Google GAIA cookies.
-static const GoogleCookieFilter kGAIACookieFilters[] = {
- { "http://.google.com/", "SID=" }, // Gmail.
- // Add filters here for other interesting cookies that should result in
- // showing the promotions (e.g ASIDAS for dasher accounts).
-};
-
-bool IsGoogleGAIACookieInstalled() {
- for (size_t i = 0; i < arraysize(kGAIACookieFilters); ++i) {
- // Since we are running on the UI thread don't call GetURLRequestContext().
- net::CookieStore* store =
- Profile::Deprecated::GetDefaultRequestContext()->
- DONTUSEME_GetCookieStore();
- GURL url(kGAIACookieFilters[i].url);
- net::CookieOptions options;
- options.set_include_httponly(); // The SID cookie might be httponly.
- std::string cookies = store->GetCookiesWithOptions(url, options);
- std::vector<std::string> cookie_list;
- base::SplitString(cookies, ';', &cookie_list);
- for (std::vector<std::string>::iterator current = cookie_list.begin();
- current != cookie_list.end();
- ++current) {
- size_t position =
- current->find(kGAIACookieFilters[i].cookie_id);
- if (0 == position)
- return true;
- }
- }
- return false;
-}
-
NewTabPageSyncHandler::NewTabPageSyncHandler() : sync_service_(NULL),
waiting_for_initial_page_load_(true) {
}
« no previous file with comments | « chrome/browser/ui/webui/ntp/new_tab_page_sync_handler.h ('k') | content/browser/renderer_host/render_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698