Remove resources for cookie consent notices modal

This commit is contained in:
deeppandya
2023-09-20 14:13:41 -04:00
parent 94785957c1
commit 0053ecabfd
29 changed files with 0 additions and 238 deletions
@@ -1539,13 +1539,6 @@ public abstract class BraveActivity extends ChromeActivity
}
}
public void dismissCookieConsent() {
BraveToolbarLayoutImpl layout = getBraveToolbarLayout();
if (layout != null) {
layout.dismissCookieConsent();
}
}
public void openRewardsPanel() {
BraveToolbarLayoutImpl layout = getBraveToolbarLayout();
if (layout != null) {
@@ -1,64 +0,0 @@
/* Copyright (c) 2022 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/. */
package org.chromium.chrome.browser.shields;
import org.chromium.base.annotations.JNINamespace;
import org.chromium.base.annotations.NativeMethods;
import org.chromium.brave_shields.mojom.CookieListOptInPageAndroidHandler;
import org.chromium.chrome.browser.crypto_wallet.util.Utils;
import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.mojo.bindings.ConnectionErrorHandler;
import org.chromium.mojo.bindings.Interface;
import org.chromium.mojo.bindings.Interface.Proxy.Handler;
import org.chromium.mojo.system.MessagePipeHandle;
import org.chromium.mojo.system.impl.CoreImpl;
@JNINamespace("chrome::android")
public class CookieListOptInServiceFactory {
private static final Object lock = new Object();
private static CookieListOptInServiceFactory instance;
public static CookieListOptInServiceFactory getInstance() {
synchronized (lock) {
if (instance == null) {
instance = new CookieListOptInServiceFactory();
}
}
return instance;
}
private CookieListOptInServiceFactory() {}
public CookieListOptInPageAndroidHandler getCookieListOptInPageAndroidHandler(
ConnectionErrorHandler connectionErrorHandler) {
Profile profile = Utils.getProfile(false); // Always use regular profile
if (profile == null) {
return null;
}
long nativeHandle =
CookieListOptInServiceFactoryJni.get().getInterfaceToCookieListOptInService(
profile);
if (nativeHandle == -1) {
return null;
}
MessagePipeHandle handle = wrapNativeHandle(nativeHandle);
CookieListOptInPageAndroidHandler cookieListOptInPageAndroidHandler =
CookieListOptInPageAndroidHandler.MANAGER.attachProxy(handle, 0);
Handler handler = ((Interface.Proxy) cookieListOptInPageAndroidHandler).getProxyHandler();
handler.setErrorHandler(connectionErrorHandler);
return cookieListOptInPageAndroidHandler;
}
private MessagePipeHandle wrapNativeHandle(long nativeHandle) {
return CoreImpl.getInstance().acquireNativeHandle(nativeHandle).toMessagePipeHandle();
}
@NativeMethods
interface Natives {
long getInterfaceToCookieListOptInService(Profile profile);
}
}
@@ -195,26 +195,6 @@ public class BraveToolbarManager extends ToolbarManager {
}
};
HomepageManager.getInstance().addListener(mBraveHomepageStateListener);
mLayoutStateProviderSupplier.onAvailable(
mCallbackController.makeCancelable(this::setLayoutStateProvider));
}
private void setLayoutStateProvider(LayoutStateProvider layoutStateProvider) {
mLayoutStateObserver = new LayoutStateProvider.LayoutStateObserver() {
@Override
public void onStartedShowing(@LayoutType int layoutType) {
if (layoutType == LayoutType.TAB_SWITCHER) {
try {
BraveActivity braveActivity = BraveActivity.getBraveActivity();
braveActivity.dismissCookieConsent();
} catch (BraveActivity.BraveActivityNotFoundException e) {
Log.e(TAG, "setLayoutStateProvider onStartedShowing click " + e);
}
}
}
};
mLayoutStateProvider = layoutStateProvider;
mLayoutStateProvider.addObserver(mLayoutStateObserver);
}
@Override
Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

@@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2022 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/. -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_cookie_background" />
<item>
<shape android:shape="rectangle">
<corners android:radius="8dp"/>
</shape>
</item>
</layer-list>
@@ -1,69 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2022 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/. -->
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/shields_tooltip_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/cookie_consent_tooltip_background"
android:fadeScrollbars="false">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical">
<ImageView
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginTop="24dp"
android:layout_gravity="center_horizontal"
app:srcCompat="@drawable/ic_cookie"
android:contentDescription="@null" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="24sp"
android:layout_marginTop="22dp"
android:layout_marginBottom="16dp"
android:gravity="center_horizontal"
android:text="@string/block_cookie_notices_title"
android:textColor="@color/cookie_consent_text_color"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:layout_marginBottom="32dp"
android:gravity="center_horizontal"
android:text="@string/block_cookie_notices_text"
android:textColor="@color/cookie_consent_text_color"/>
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_action"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center"
android:background="@drawable/crypto_wallet_blue_button"
android:text="@string/block_cookie_notices_action_text"
android:textAllCaps="false"
android:textSize="14sp"
android:paddingVertical="8dp"
android:paddingBottom="8dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:textColor="@android:color/white"
style="?android:attr/borderlessButtonStyle"/>
</LinearLayout>
</ScrollView>
@@ -155,9 +155,6 @@
<!-- Brave Wallet DApp -->
<color name="brave_wallet_dapp_text_color">@android:color/white</color>
<color name="cookie_consent_text_color">#F0F2FF</color>
<color name="cookie_consent_tooltip_color">#1E2029</color>
<!-- Quick Action Search and Bookmark Widget -->
<color name="quick_action_search_and_bookmark_widget_bg_color">#F21E2029</color>
<color name="quick_action_search_and_bookmark_widget_search_bg_color">#405E6175</color>
-3
View File
@@ -272,9 +272,6 @@
<color name="rewards_tipping_text_color">#212529</color>
<color name="vbat_warning_color">#FFD43B</color>
<color name="cookie_consent_text_color">#212529</color>
<color name="cookie_consent_tooltip_color">@android:color/white</color>
<!-- Quick Action Search and Bookmark Widget -->
<color name="quick_action_search_and_bookmark_widget_bg_color">#F2FFFFFF</color>
<color name="quick_action_search_and_bookmark_widget_search_bg_color">#40AEB1C2</color>