-
Notifications
You must be signed in to change notification settings - Fork 930
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support iOS Syncing & Bookmarks #6722
Merged
Merged
Changes from all commits
Commits
Show all changes
91 commits
Select commit
Hold shift + click to select a range
a3f4335
brave-sync-ios-compiling
jumde 38d87f9
fix compile errors
bridiver 2595f62
Building works again.. Chromium 83 changed a bunch of interfaces.
Brandon-T 62d88ba
fixing debug builds
jumde 764cf19
Moving all Shared code to one spot in the framework.
Brandon-T e1246a4
updated i10n
jumde 877732f
Rebased
Brandon-T 448a3f1
fixed sequence checker
jumde 913a97e
fix startup crash
bridiver 1a43f3e
Added Singleton BrowserStateManager.
Brandon-T 4b96a85
use chromium_src overrides for chrome_browser_state so we can use the…
bridiver edff4ce
Added BookmarkNode Objective-C++ code.
Brandon-T e8cb58d
localdeviceinfo and passphrase
jumde ea5b768
Fixing SyncDevice and ProfileSyncServiceFactory for iOS.
Brandon-T ad3c983
override channel to empty string for now
bridiver 8ea729d
fix connection to brave sync service
Brandon-T aa9e722
cleanup and api fixes
bridiver f595e08
Moving the brave-sync worker API.
Brandon-T d4c3df8
Bookmarks API is feature complete and can actually be used to create …
Brandon-T e6c9742
Update BraveRewards to link PROPERLY without forcing all symbols to b…
jumde f225ce0
Rename function to match iOS property access - Apple style guide.
Brandon-T 32d444b
fixing patches after rebase
jumde 86317a6
fix sync build for c86
jumde 95ff2cf
GetOSString should return ios/android for mobile devices
jumde 243c63f
Added Bookmarks Observer. Fixed all nullability for Swift to not make…
Brandon-T db2c217
add dcheck to make sure we're calling things on the correct thread
Brandon-T 648b0b2
Created SyncService observers for device and service state changes.
Brandon-T ea0a581
Made APIs a singleton. Exported converting Hex-Seed to Code-Words.
Brandon-T 88820b8
Fixed bug where decryption kept failing due to passphrase being set a…
Brandon-T 09b4fe2
Addressing feedback and using properties instead of functions.
Brandon-T 248d0a2
Added ability to see if a sync code is valid.
Brandon-T f7e72bc
Fixed device not showing up on sync chain when codes are pasted onto …
Brandon-T a47e78b
Fix the ChannelInfo override for iOS production/release builds. Fixed…
Brandon-T 0012e30
Minor changes to interface.
Brandon-T adea3d2
Made all observer functions optional because iOS doesn't need to use …
Brandon-T 2cc336e
No need to MaterialComponents into the BraveRewards framework. Instea…
Brandon-T 0528f44
Import and Export bookmarks Interface linked.
Brandon-T ca6c899
Added importing and exporting bookmarks.
Brandon-T 3da8431
Add callbacks for Import and Export of bookmarks.
Brandon-T 632a6a9
use task runner for db so it always runs on the same thread (gcd has …
Brandon-T a296b67
misc cleanup
bridiver c1e75e8
use task runners for ads db
Brandon-T f44024e
cleanup
bridiver b54b8dc
remove unnecessary patch
bridiver 373a32a
misc cleanup
bridiver 7c4fd25
Added Bookmark Export Utility for CoreData.
Brandon-T 3963e2c
Export interface for iOS side to construct a bookmark IR model.
Brandon-T 980e70a
Cleanup `optional` interface.
Brandon-T d65e262
Fixed threading retaining with weak/strong specifies.
Brandon-T e4b7b63
Minor changes to the interface to use properties.
Brandon-T 8dc8c8b
Export interface to allow iOS side to control what SyncServiceURL to …
Brandon-T 39a1523
Fixing PR feedback.
Brandon-T cc1503e
Fix sync worker to NOT use PrepareForFirstSync and CommitSyncChanges.
Brandon-T 2e77e3c
Fixed language issue where incorrect Locale crashes the framework/app.
Brandon-T a33361b
Remove ability to delete device from sync chain :(
Brandon-T a1c7565
Fixed a "possible" bug in fav_icon images.
Brandon-T 8ef9352
Addressing weird indentations.
Brandon-T e154f8d
Added a boolean to determine if the underlying model has suddenly bec…
Brandon-T 58aeff2
update patch
bridiver 7224cd6
make BraveProfileSyncServiceDelegate compatible with ios
bridiver ac4fb1e
add missing patch update from profile sync delegate
bridiver f7a23e2
remove unnecessary channel info - this is just a framework in ios
bridiver 85b42bc
handle app notifications
bridiver 5995f92
don't strip in debug
bridiver 23b3481
clang format
bridiver 6d627d3
clang format
bridiver bf567ea
don't call GetApplicationContext to get the browser state in the obse…
bridiver a1e2c58
clang format
bridiver a21e9c4
clang format
bridiver a695146
clang format
bridiver 5977b45
clang format
bridiver b64cd13
clang format
bridiver 0bcc76e
lint/clang format
bridiver f5c5754
lint
bridiver 156b28b
fix weird incorrect lint errors like
bridiver ee2eaf3
Fixed exporting of bookmark children and nested children for performa…
Brandon-T fae6eb6
Fixed iOS compiling issues. C++ headers cannot be imported in an expo…
Brandon-T bb8760b
Fixed bookmarks performance.
Brandon-T 4cba657
fix `GetChannel` namespace forios
bridiver d1c39c7
Add missing gn deps
bsclifton c3fdd98
Fixed unit tests linking and execution.
Brandon-T 41766d1
Used the existing `bookmark_codec` to encode bookmarks instead of cop…
Brandon-T bbdd555
fix lint
bridiver 701995e
cleanup
bridiver bbb22dc
remove incorrect header
bridiver 5f447ac
clang format cleanup
bridiver 8464de7
Fixed Xcode 12 compiling and sync service URL to be retrieved from GN.
Brandon-T 4f47f85
Added folder filtering for the iOS side to prevent users from moving …
Brandon-T 46a8534
Rename functions and add documentation explaining it.
Brandon-T 91aeecd
make sure brave_sync_endpoint is not empty for official builds
bridiver c885282
Fixed iOS mobile user agent for Sync UI so it shows "iOS" correctly i…
Brandon-T File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
source_set("sync") { | ||
sources = [ | ||
"brave_profile_sync_service_delegate.cc", | ||
"brave_profile_sync_service_delegate.h", | ||
] | ||
|
||
deps = [ | ||
"//base", | ||
"//components/sync/driver", | ||
"//components/sync_device_info", | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
chromium_src/components/content_settings/core/browser/cookie_settings_util.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* Copyright (c) 2020 The Brave Authors. All rights reserved. | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
#include "base/build_config.h" | ||
|
||
#if defined(OS_IOS) | ||
#define SettingsAllowSigninCookies SettingsAllowSigninCookies_ChromiumImpl | ||
#define SettingsDeleteSigninCookiesOnExit \ | ||
SettingsDeleteSigninCookiesOnExit_ChromiumImpl | ||
#endif | ||
|
||
#include "../../../../../../components/content_settings/core/browser/cookie_settings_utils.cc" | ||
|
||
#if defined(OS_IOS) | ||
bool SettingsAllowSigninCookies( | ||
const content_settings::CookieSettings* cookie_settings) { | ||
return false; | ||
} | ||
|
||
bool SettingsDeleteSigninCookiesOnExit( | ||
const content_settings::CookieSettings* cookie_settings) { | ||
return true; | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* Copyright (c) 2020 The Brave Authors. All rights reserved. | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
#include "components/sync_device_info/device_info.h" | ||
|
||
#include <algorithm> | ||
|
||
#define ToValue ToValue_ChromiumImpl | ||
#include "../../../../components/sync_device_info/device_info.cc" | ||
#undef ToValue | ||
|
||
namespace syncer { | ||
std::unique_ptr<base::DictionaryValue> DeviceInfo::ToValue() const { | ||
std::unique_ptr<base::DictionaryValue> value = ToValue_ChromiumImpl(); | ||
if ((device_type_ == sync_pb::SyncEnums_DeviceType_TYPE_PHONE || | ||
device_type_ == sync_pb::SyncEnums_DeviceType_TYPE_TABLET) && | ||
sync_user_agent_.find("IOS") != std::string::npos) { | ||
value->SetString("os", "ios"); | ||
} else { | ||
value->SetString("os", GetOSString()); | ||
} | ||
return value; | ||
} | ||
} // namespace syncer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* Copyright (c) 2020 The Brave Authors. All rights reserved. | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at https://mozilla.org/MPL/2.0/. */ | ||
|
||
#ifndef BRAVE_CHROMIUM_SRC_COMPONENTS_SYNC_DEVICE_INFO_DEVICE_INFO_H_ | ||
#define BRAVE_CHROMIUM_SRC_COMPONENTS_SYNC_DEVICE_INFO_DEVICE_INFO_H_ | ||
|
||
#include <string> | ||
|
||
#define ToValue \ | ||
ToValue_ChromiumImpl() const; \ | ||
std::unique_ptr<base::DictionaryValue> ToValue | ||
|
||
#include "../../../../components/sync_device_info/device_info.h" | ||
#undef ToValue | ||
|
||
#endif // BRAVE_CHROMIUM_SRC_COMPONENTS_SYNC_DEVICE_INFO_DEVICE_INFO_H_ |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an intentional change, right? Does the 1.15/1.16 forks have this change? Just want to make sure we don't end up having issues submitting to Apple
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change is intentional. This is what Chromium does for Xcode 12.0+. I explicitly changed this to
false
foruse_xcode_clang
. I have not tested submitting to Apple's servers but it did pass verification locally.