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

Side by Side Diff: chrome/browser/android/contextualsearch/contextual_search_delegate.cc

Issue 1175243009: [Sync] Rename SyncEnabledAndLoggedIn() to CanStartSync(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Missed a const transition. Created 5 years, 6 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
« no previous file with comments | « no previous file | chrome/browser/android/most_visited_sites.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/android/contextualsearch/contextual_search_delegate.h" 5 #include "chrome/browser/android/contextualsearch/contextual_search_delegate.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 // Only allow HTTP URLs or HTTPS URLs. 375 // Only allow HTTP URLs or HTTPS URLs.
376 if (current_page_url.scheme() != url::kHttpScheme && 376 if (current_page_url.scheme() != url::kHttpScheme &&
377 (current_page_url.scheme() != url::kHttpsScheme)) 377 (current_page_url.scheme() != url::kHttpsScheme))
378 return false; 378 return false;
379 379
380 // Check that the user has sync enabled, is logged in, and syncs their Chrome 380 // Check that the user has sync enabled, is logged in, and syncs their Chrome
381 // History. 381 // History.
382 ProfileSyncService* service = 382 ProfileSyncService* service =
383 ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile); 383 ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile);
384 sync_driver::SyncPrefs sync_prefs(profile->GetPrefs()); 384 sync_driver::SyncPrefs sync_prefs(profile->GetPrefs());
385 if (service == NULL || !service->IsSyncEnabledAndLoggedIn() || 385 if (service == NULL || !service->CanSyncStart() ||
386 !sync_prefs.GetPreferredDataTypes(syncer::UserTypes()) 386 !sync_prefs.GetPreferredDataTypes(syncer::UserTypes())
387 .Has(syncer::PROXY_TABS) || 387 .Has(syncer::PROXY_TABS) ||
388 !service->GetActiveDataTypes().Has(syncer::HISTORY_DELETE_DIRECTIVES)) { 388 !service->GetActiveDataTypes().Has(syncer::HISTORY_DELETE_DIRECTIVES)) {
389 return false; 389 return false;
390 } 390 }
391 391
392 return true; 392 return true;
393 } 393 }
394 394
395 // Decodes the given response from the search term resolution request and sets 395 // Decodes the given response from the search term resolution request and sets
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 end_offset -= trim; 481 end_offset -= trim;
482 } 482 }
483 if (result_text.length() > end_offset + padding_each_side_pinned) { 483 if (result_text.length() > end_offset + padding_each_side_pinned) {
484 // Trim the end. 484 // Trim the end.
485 result_text = result_text.substr(0, end_offset + padding_each_side_pinned); 485 result_text = result_text.substr(0, end_offset + padding_each_side_pinned);
486 } 486 }
487 *start = start_offset; 487 *start = start_offset;
488 *end = end_offset; 488 *end = end_offset;
489 return result_text; 489 return result_text;
490 } 490 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/android/most_visited_sites.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698