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

Side by Side Diff: chrome/browser/android/foreign_session_helper.cc

Issue 1155443009: [Sync] Rename SyncActive to IsSyncActive. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More non-android cases. 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/foreign_session_helper.h" 5 #include "chrome/browser/android/foreign_session_helper.h"
6 6
7 #include <jni.h> 7 #include <jni.h>
8 8
9 #include "base/android/jni_string.h" 9 #include "base/android/jni_string.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 24 matching lines...) Expand all
35 using browser_sync::OpenTabsUIDelegate; 35 using browser_sync::OpenTabsUIDelegate;
36 using browser_sync::SyncedSession; 36 using browser_sync::SyncedSession;
37 37
38 namespace { 38 namespace {
39 39
40 OpenTabsUIDelegate* GetOpenTabsUIDelegate(Profile* profile) { 40 OpenTabsUIDelegate* GetOpenTabsUIDelegate(Profile* profile) {
41 ProfileSyncService* service = ProfileSyncServiceFactory::GetInstance()-> 41 ProfileSyncService* service = ProfileSyncServiceFactory::GetInstance()->
42 GetForProfile(profile); 42 GetForProfile(profile);
43 43
44 // Only return the delegate if it exists and it is done syncing sessions. 44 // Only return the delegate if it exists and it is done syncing sessions.
45 if (!service || !service->SyncActive()) 45 if (!service || !service->IsSyncActive())
46 return NULL; 46 return NULL;
47 47
48 return service->GetOpenTabsUIDelegate(); 48 return service->GetOpenTabsUIDelegate();
49 } 49 }
50 50
51 bool ShouldSkipTab(const sessions::SessionTab& session_tab) { 51 bool ShouldSkipTab(const sessions::SessionTab& session_tab) {
52 if (session_tab.navigations.empty()) 52 if (session_tab.navigations.empty())
53 return true; 53 return true;
54 54
55 int selected_index = session_tab.normalized_navigation_index(); 55 int selected_index = session_tab.normalized_navigation_index();
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 jstring session_tag) { 299 jstring session_tag) {
300 OpenTabsUIDelegate* open_tabs = GetOpenTabsUIDelegate(profile_); 300 OpenTabsUIDelegate* open_tabs = GetOpenTabsUIDelegate(profile_);
301 if (open_tabs) 301 if (open_tabs)
302 open_tabs->DeleteForeignSession(ConvertJavaStringToUTF8(env, session_tag)); 302 open_tabs->DeleteForeignSession(ConvertJavaStringToUTF8(env, session_tag));
303 } 303 }
304 304
305 // static 305 // static
306 bool ForeignSessionHelper::RegisterForeignSessionHelper(JNIEnv* env) { 306 bool ForeignSessionHelper::RegisterForeignSessionHelper(JNIEnv* env) {
307 return RegisterNativesImpl(env); 307 return RegisterNativesImpl(env);
308 } 308 }
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