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

Side by Side Diff: chrome/browser/dom_ui/new_tab_page_sync_handler.cc

Issue 3750001: base: Move SplitString functions into the base namespace and update the callers. (Closed) Base URL: git://git.chromium.org/chromium.git
Patch Set: brett review, reverted changes in o3d due to it's using an old base revision Created 10 years, 2 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/browser/dom_ui/new_tab_page_sync_handler.h" 5 #include "chrome/browser/dom_ui/new_tab_page_sync_handler.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/string_split.h" 9 #include "base/string_split.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 bool IsGoogleGAIACookieInstalled() { 53 bool IsGoogleGAIACookieInstalled() {
54 for (size_t i = 0; i < arraysize(kGAIACookieFilters); ++i) { 54 for (size_t i = 0; i < arraysize(kGAIACookieFilters); ++i) {
55 // Since we are running on the UI thread don't call GetURLRequestContext(). 55 // Since we are running on the UI thread don't call GetURLRequestContext().
56 net::CookieStore* store = 56 net::CookieStore* store =
57 Profile::GetDefaultRequestContext()->GetCookieStore(); 57 Profile::GetDefaultRequestContext()->GetCookieStore();
58 GURL url(kGAIACookieFilters[i].url); 58 GURL url(kGAIACookieFilters[i].url);
59 net::CookieOptions options; 59 net::CookieOptions options;
60 options.set_include_httponly(); // The SID cookie might be httponly. 60 options.set_include_httponly(); // The SID cookie might be httponly.
61 std::string cookies = store->GetCookiesWithOptions(url, options); 61 std::string cookies = store->GetCookiesWithOptions(url, options);
62 std::vector<std::string> cookie_list; 62 std::vector<std::string> cookie_list;
63 SplitString(cookies, ';', &cookie_list); 63 base::SplitString(cookies, ';', &cookie_list);
64 for (std::vector<std::string>::iterator current = cookie_list.begin(); 64 for (std::vector<std::string>::iterator current = cookie_list.begin();
65 current != cookie_list.end(); 65 current != cookie_list.end();
66 ++current) { 66 ++current) {
67 size_t position = 67 size_t position =
68 current->find(kGAIACookieFilters[i].cookie_id); 68 current->find(kGAIACookieFilters[i].cookie_id);
69 if (0 == position) 69 if (0 == position)
70 return true; 70 return true;
71 } 71 }
72 } 72 }
73 return false; 73 return false;
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 if (linkurl.empty()) { 217 if (linkurl.empty()) {
218 value.SetBoolean("linkurlisset", false); 218 value.SetBoolean("linkurlisset", false);
219 } else { 219 } else {
220 value.SetBoolean("linkurlisset", true); 220 value.SetBoolean("linkurlisset", true);
221 value.SetString("linkurl", linkurl); 221 value.SetString("linkurl", linkurl);
222 } 222 }
223 } 223 }
224 } 224 }
225 dom_ui_->CallJavascriptFunction(L"syncMessageChanged", value); 225 dom_ui_->CallJavascriptFunction(L"syncMessageChanged", value);
226 } 226 }
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/version_loader.cc ('k') | chrome/browser/dom_ui/options/cookies_view_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698