🎨 Redesign private tab UI following Figma design.
Private tab redesign includes three new sections "Leave no trace", "Browsing visibility" and "Brave VPN".
Brave VPN section will show a call to action text view that will redirect to the subscription page. If the user is already a paying customer, or the VPN is not supported the CTA view will be hidden.
The design is responsive and adjust to large device screens and tablets, following the logic provided by Figma design.
The entire layout is centered in the visible part of the page.
* Fixed navigation bar color at private tab; fixesbrave/brave-browser#41545
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/52962da478ed750038f966c386c4ee0ff2d73837
Always apply luminance calculation to navigation bar icons
Currently, the navigation bar icons only respond to the color of the navigation bar during animations. Since animations are being disabled for the navbar coloring experiment, it's important that the luminance calculation to properly color the navigation bar icons is applied all the time, not just during animations.
Bug: 364228106, 40925025
fixes https://github.com/brave/brave-browser/issues/41402
Crash happened at app menu => Settings => Brave Shields & privacy => Content Filtering.
Tombstone
```
java.lang.ClassCastException: org.chromium.chrome.browser.settings.SettingsActivity cannot be cast to org.chromium.chrome.browser.settings.BraveSettingsActivity
at org.chromium.chrome.browser.shields.ContentFilteringFragment.onAttach(ContentFilteringFragment.java:86)
```
Upstream had added a new place to create Intent for Settings activity.
Related Chromium change:
https://source.chromium.org/chromium/chromium/src/+/d4af6a2c4ccc6427aa7df0f2beacf61793459e66
[Settings] Introduce a central place to construct intents
SettingsIntentUtil becomes the central place to construct intents
launching the settings activity.
Bug: b/356743945
Change-Id: Id6988af4a182fe6603bb02c9dae8b2ac48f80fed
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5832868
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/52962da478ed750038f966c386c4ee0ff2d73837
Always apply luminance calculation to navigation bar icons
Currently, the navigation bar icons only respond to the color of the navigation bar during animations. Since animations are being disabled for the navbar coloring experiment, it's important that the luminance calculation to properly color the navigation bar icons is applied all the time, not just during animations.
Bug: 364228106, 40925025
We must it duplicate at our brave/android/java/org/chromium/chrome/browser/ntp/IncognitoNewTabPageView.java
Related Chromium change:
https://source.chromium.org/chromium/chromium/src/+/a269abacce33fa1cdb136a4c4b0ef6b6d20d4d0b
[E2E] Draw Incognito NTP edge to edge
This change plumb through the EdgeToEdgeController to Incognito NTP (INTP). When drawing edge to edge, add the bottom inset padding to INTP's scroll view, and #setClipToPadding(false). This makes the view drawing into the nav bar region while ensure the controls in the page remains reachable when scrolled to the bottom.
The change also introduces an interface for NativePage to check if it is compatible for edge to edge. Currently only INTP is supported, and change is guarded behind DrawKeyNativePageToEdge.
The preview:
https://screenshot.googleplex.com/BYiJ8TkNP4Q3pqa
Bug: 339025702
Change-Id: I86459682089adc9f8898382fb90278136444c705
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5847378
This fixes Lint error
```
../../brave/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkManagerMediator.java:156: Warning: Using name is unsafe as it is a filename obtained directly from a ContentProvider. You should sanitize it before using it for creating a File. [UnsanitizedFilenameFromContentProvider]
File file = new File(mContext.getFilesDir(), name);
~~~~
```
Related Chromium change (android-security-lints):
https://github.com/google/android-security-lints/pull/8/files
Upload @TudorMagirescu's UnsanitizedFilenameFromContentProvider lint check
Related Chromium change:
https://source.chromium.org/chromium/chromium/src/+/669963ea86e76265f27de29b3925df97b4b8ea83
[Settings] Make the activity responsible for setting the title
Today, each setting page implementation mutates the activity's title by
calling getActivity().setTitle(). This is problematic as we redesign the
setting UI for two primary reasons: (1) we are going to show the page
title in the header of the detail pane, not as the activity title (2) we
have to restore the page title when the user hits the back button after
we migrate from the activity-based UI to the fragment-based UI.
This patch rewrites all existing setting page implementation to tell the
settings activity their page name, instead of directly mutating the
activity title.
For this purpose, this patch introduces a new interface SettingsPage to
be implemented by all fragments that can be shown as a setting page.
a few lines in the file
Low-Coverage-Reason: TRIVIAL_CHANGE Interface change that modifies only
Bug: b/356743945
Change-Id: I73a0db0b384850385cdce1ebb8077a96c761d7ce
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5804482
- new argument at BottomControlsMediator.ctor - browserControlsVisibilityDelegate
- new argment at BottomControlsCoordinator.ctor - browserControlsVisibilityDelegate
Related Chromium change:
https://source.chromium.org/chromium/chromium/src/+/d813d2e1ad66f8954e2e1da0821fa55eb9a21a70
Force browser controls to show up when creating new tab group
When tab group is created via long press context menu, it'll triggers SimpleAnimationLayout then shows the tab group. This flow will detach the current tab and add it back; during this process, the new browser controls height, which is changed due to tab group UI being added, does not dispatched to the render. This causes a bug when the tab is reattached and becomes interactable, the offset read from TabBrowserControlsOffsetHelper is stale, leaving the tab group UI scene layer on the screen.
This CL work around this by forcing the browser controls to be visible when the tab group UI becomes from hidden to visible. This has no impact to flows other than context menu -> "open new tab in group", as switching tabs will force browser controls to show transiently already.
Bug: 357398783
Change-Id: I419b9303b033f0f621956952bc61c56a199fc338
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5809240
* AI Chat: Introduce AIChatService, ConversationHandler, and direct bindings from UI
Modified AIChat WebUI to directly bind to both AIChatService and ConversationHandler for most operations.
Lays the groundwork for conversations to be independent of web content. In fact, most of this functionality is also within this PR. Conversation persistance (in-memory) is guarded behind a feature flag.
Refactor print preview extractor to be passed to AIChatTabHelper directly
Also removed max page content consideration since:
1) Model can be changed after fetching the content
2) Multiple callbacks could occur with different page content limits from different conversations
3) We need to know the (reasonable) total content length to report the percentage of content that Leo has been sent.
I did consider sending the requested page content maximum length for each GetContent call, but that does not solve all the issues. Since there is a maximum limit of 20 print preview pages, it seems it's ok.
kAIChatHistory flag -> AIChatHistory
* ConversationHandler doesn't need to deal with navigation ID
* test fix
* AIChatTabHelper params instead of multiple test. Always trim content.
* test and review feedback - comments, id->uuid, page-navigation-tests
* fix for android build
* fix same-document back/forward navigation by considering page title changes during navigation
* ios refactor
* Fix compiling on iOS. Fix Service registration crash.
* Fix crashes on iOS. Fix logic so AIChat on iOS works correctly. Fix models list conversion to iOS.
* fix ConversationHandler::GenerateQuestions, refactor non-conversation rewriting out of ConversationHandler, test ConversationHandler::GetState
* feedback
* fix AIChatRenderViewContextMenuBrowserTest
* don't wait for client connection before submitting human message
* AIChatService::MaybeAssociateContentWithConversation
* feedback
* android HandleVoiceRecognition now optionally passes ConversationId to target a specific conversation
* feedback
* fix ModelService migrating from chat-claude-instant default model pref value
* feedback
* format
* rebase fixes
* AIChatTabHelper refine and test retry logic
* fix android compile
* fix android again
* no channel_info new string
* associatedcontentdriver - remove is_page_text_fetch_in_progress_
* ConversationHandler::HasAnyHistory ignores staged entries
* AIChatService: erase from content_conversation map, and test it
* MaybeUnlink should check if client is connected
* fix android again?
* ChromeAutocompleteProviderClient should check AIChatService exists
---------
Co-authored-by: Brandon T <JustBrandonT@gmail.com>