From 58b66f3b7503b0383b0dd55e60d0fed2184e8bbc Mon Sep 17 00:00:00 2001 From: Jagadesh P Date: Tue, 17 Dec 2024 00:20:29 +0530 Subject: [PATCH] [Android][Sync] Fix some minor UI issues as per design and remove unnecessary colors entries. And move |GetBraveSyncServiceURL| and |GetBraveDefaultSyncServiceURL| to brave_sync_service_impl.cc --- ...e_sync_advanced_options_dialog_background.xml | 3 ++- .../res/drawable/brave_sync_btn_disabled.xml | 2 +- .../drawable/brave_sync_btn_text_selector.xml | 2 +- .../drawable/brave_sync_reset_btn_selector.xml | 4 ++-- .../brave_sync_advanced_options_dialog.xml | 7 +++++-- android/java/res/values-night/brave_colors.xml | 13 ++++++------- android/java/res/values/brave_colors.xml | 9 ++++----- .../components/sync/service/sync_service_impl.cc | 16 ++++------------ .../components/sync/service/sync_service_impl.h | 11 ++++++++--- .../sync/service/brave_sync_service_impl.cc | 11 +++++++++++ .../sync/service/brave_sync_service_impl.h | 3 +++ 11 files changed, 47 insertions(+), 34 deletions(-) diff --git a/android/java/res/drawable/brave_sync_advanced_options_dialog_background.xml b/android/java/res/drawable/brave_sync_advanced_options_dialog_background.xml index 7412d2724aa9..9b7352894ea6 100644 --- a/android/java/res/drawable/brave_sync_advanced_options_dialog_background.xml +++ b/android/java/res/drawable/brave_sync_advanced_options_dialog_background.xml @@ -6,6 +6,7 @@ --> - + + diff --git a/android/java/res/drawable/brave_sync_btn_disabled.xml b/android/java/res/drawable/brave_sync_btn_disabled.xml index e7040f460b3f..cc2156d98eab 100644 --- a/android/java/res/drawable/brave_sync_btn_disabled.xml +++ b/android/java/res/drawable/brave_sync_btn_disabled.xml @@ -7,6 +7,6 @@ - + diff --git a/android/java/res/drawable/brave_sync_btn_text_selector.xml b/android/java/res/drawable/brave_sync_btn_text_selector.xml index 8189a3dacf03..c5b33c29e538 100644 --- a/android/java/res/drawable/brave_sync_btn_text_selector.xml +++ b/android/java/res/drawable/brave_sync_btn_text_selector.xml @@ -7,5 +7,5 @@ - + diff --git a/android/java/res/drawable/brave_sync_reset_btn_selector.xml b/android/java/res/drawable/brave_sync_reset_btn_selector.xml index eb44078fc141..87a67f52922c 100644 --- a/android/java/res/drawable/brave_sync_reset_btn_selector.xml +++ b/android/java/res/drawable/brave_sync_reset_btn_selector.xml @@ -6,6 +6,6 @@ --> - - + + diff --git a/android/java/res/layout/brave_sync_advanced_options_dialog.xml b/android/java/res/layout/brave_sync_advanced_options_dialog.xml index c22b783ea9e6..b9953008d8e2 100644 --- a/android/java/res/layout/brave_sync_advanced_options_dialog.xml +++ b/android/java/res/layout/brave_sync_advanced_options_dialog.xml @@ -20,7 +20,8 @@ android:orientation="vertical" android:clipToOutline="true" android:paddingHorizontal="24dp" - android:paddingVertical="16dp"> + android:paddingTop="24dp" + android:paddingBottom="16dp"> + android:textColorHint="@color/leo_color_text_tertiary" /> @@ -92,6 +93,8 @@ diff --git a/android/java/res/values-night/brave_colors.xml b/android/java/res/values-night/brave_colors.xml index 46ad2e7df11d..8a025a298857 100644 --- a/android/java/res/values-night/brave_colors.xml +++ b/android/java/res/values-night/brave_colors.xml @@ -37,7 +37,7 @@ #F0F2FF #1E2029 - + #A1ABBA @android:color/white @@ -90,11 +90,6 @@ @android:color/transparent @color/modern_grey_800 #212529 - #1B1B1F - #909094 - #33EBEEF0 - #80EBEEF0 - #80EBEEF0 #0d1214 #545ff8 @@ -116,7 +111,7 @@ #F0F2FF #1E2029 - + #F0F2FF #EDEEF1 @@ -278,9 +273,13 @@ #c7c7cc #3b3b3f #c1c4ff + #1b1b1f #303034 #7c91ff #C1C4FF + #909094 + #33EBEEF0 + #80EBEEF0 #000000 diff --git a/android/java/res/values/brave_colors.xml b/android/java/res/values/brave_colors.xml index 04a3009a18bf..88f7943b294a 100644 --- a/android/java/res/values/brave_colors.xml +++ b/android/java/res/values/brave_colors.xml @@ -113,11 +113,6 @@ @color/button_background @color/text_secondary @color/leo_color_text_interactive - #F0F0F4 - #76767A - #3346464A - #8021272A - #8021272A @color/baseline_neutral_90 @@ -431,8 +426,12 @@ #46464a #e3e3e8 #3e37d4 + #f0f0f4 #c7c7cc #3E37D4 + #76767A + #3346464A + #8021272A #FFFFFF diff --git a/chromium_src/components/sync/service/sync_service_impl.cc b/chromium_src/components/sync/service/sync_service_impl.cc index 0ef98eca84ca..507d769e7bff 100644 --- a/chromium_src/components/sync/service/sync_service_impl.cc +++ b/chromium_src/components/sync/service/sync_service_impl.cc @@ -17,9 +17,10 @@ namespace syncer { -GURL BraveGetSyncServiceURL(const base::CommandLine& command_line, - version_info::Channel channel, - PrefService* prefs) { +GURL SyncServiceImpl::BraveGetSyncServiceURL( + const base::CommandLine& command_line, + version_info::Channel channel, + PrefService* prefs) { if (prefs) { std::string value = prefs->GetString(brave_sync::kCustomSyncServiceUrl); if (!value.empty()) { @@ -55,15 +56,6 @@ GURL BraveGetSyncServiceURL(const base::CommandLine& command_line, return GetSyncServiceURL(command_line, channel); } -GURL SyncServiceImpl::GetBraveSyncServiceURL() { - return BraveGetSyncServiceURL(*base::CommandLine::ForCurrentProcess(), - channel_, sync_client_->GetPrefService()); -} - -GURL SyncServiceImpl::GetBraveDefaultSyncServiceURL() { - return GetSyncServiceURL(*base::CommandLine::ForCurrentProcess(), channel_); -} - } // namespace syncer #define SyncAuthManager BraveSyncAuthManager diff --git a/chromium_src/components/sync/service/sync_service_impl.h b/chromium_src/components/sync/service/sync_service_impl.h index 16ee07f81372..1935d7b262bb 100644 --- a/chromium_src/components/sync/service/sync_service_impl.h +++ b/chromium_src/components/sync/service/sync_service_impl.h @@ -9,10 +9,15 @@ #include "base/gtest_prod_util.h" #include "components/signin/public/identity_manager/identity_manager.h" +namespace base { +class CommandLine; +} + #define BRAVE_SYNC_SERVICE_IMPL_H_ \ - public: \ - GURL GetBraveSyncServiceURL(); \ - GURL GetBraveDefaultSyncServiceURL(); \ + protected: \ + static GURL BraveGetSyncServiceURL(const base::CommandLine& command_line, \ + version_info::Channel channel, \ + PrefService* prefs); \ \ private: \ friend class BraveSyncServiceImpl; \ diff --git a/components/sync/service/brave_sync_service_impl.cc b/components/sync/service/brave_sync_service_impl.cc index fdacf1cdac9f..88b560a46c96 100644 --- a/components/sync/service/brave_sync_service_impl.cc +++ b/components/sync/service/brave_sync_service_impl.cc @@ -9,6 +9,7 @@ #include #include "base/auto_reset.h" +#include "base/command_line.h" #include "base/logging.h" #include "base/metrics/histogram_functions.h" #include "base/strings/string_util.h" @@ -19,6 +20,7 @@ #include "brave/components/sync/service/sync_service_impl_delegate.h" #include "build/build_config.h" #include "components/prefs/pref_service.h" +#include "components/sync/base/sync_util.h" #include "components/sync/engine/sync_protocol_error.h" #include "components/sync/model/type_entities_count.h" @@ -439,4 +441,13 @@ bool BraveSyncServiceImpl::SetCustomSyncServiceURL( return false; } +GURL BraveSyncServiceImpl::GetBraveSyncServiceURL() { + return BraveGetSyncServiceURL(*base::CommandLine::ForCurrentProcess(), + channel_, sync_client_->GetPrefService()); +} + +GURL BraveSyncServiceImpl::GetBraveDefaultSyncServiceURL() { + return GetSyncServiceURL(*base::CommandLine::ForCurrentProcess(), channel_); +} + } // namespace syncer diff --git a/components/sync/service/brave_sync_service_impl.h b/components/sync/service/brave_sync_service_impl.h index a7b0622fe5b4..9db9e59c22de 100644 --- a/components/sync/service/brave_sync_service_impl.h +++ b/components/sync/service/brave_sync_service_impl.h @@ -76,6 +76,9 @@ class BraveSyncServiceImpl : public SyncServiceImpl { std::string GetCustomSyncServiceURL(); bool SetCustomSyncServiceURL(std::string custom_sync_url); + GURL GetBraveSyncServiceURL(); + GURL GetBraveDefaultSyncServiceURL(); + private: friend class BraveSyncServiceImplGACookiesTest; friend class BraveSyncServiceImplTest;