Skip to content

Commit 110b9bf

Browse files
committed
Uplift AI Chat Full Page Storage feature
- [AIChat conversation data storage by petemill · Pull Request \#25876 · brave/brave-core](#25876) - [AI Chat conversations should persist browser restart · Issue \#42800 · brave/brave-browser](brave/brave-browser#42800) `QA/Yes` - [\[AIChat\]: Add URL based routing for different chats by fallaciousreasoning · Pull Request \#26050 · brave/brave-core](#26050) - [\[AI Chat\]: URLs for all conversations · Issue \#42055 · brave/brave-browser](brave/brave-browser#42055) `QA/Yes` - test plan: url and header variations specified - [AI Chat fullpage UI notices and polish by petemill · Pull Request \#26678 · brave/brave-core](#26678) - [AI Chat conversation list should prompt to enable history storage if it's disabled · Issue \#42576 · brave/brave-browser](brave/brave-browser#42576) `QA/Yes` - test plan: specified - [AI Chat notice for conversation storage · Issue \#42360 · brave/brave-browser](brave/brave-browser#42360) `QA/Yes` - test plan: specified - [AI Chat FullPage shouldn't show in SidePanel mode when restored at startup · Issue \#42413 · brave/brave-browser](brave/brave-browser#42413) `QA/Yes` - test plan: specified - [AI Chat becomes a trusted WebUI with an UntrustedWebUI frame for LLM-generated responses by petemill · Pull Request \#26855 · brave/brave-core](#26855) - [Change AI Chat url to chrome://leo-ai · Issue \#42817 · brave/brave-browser](brave/brave-browser#42817) `QA/Yes` - [AI Chat conversation entries should be isolated in an untrusted frame · Issue \#42818 · brave/brave-browser](brave/brave-browser#42818) `QA/No` - [\[AI Chat\]: Update copy button label by fallaciousreasoning · Pull Request \#26422 · brave/brave-core](#26422) - [Change copy button name to text if text in code block · Issue \#42117 · brave/brave-browser](brave/brave-browser#42117) `QA/Yes` - [\[AI Chat\]: Conversation starter pack, for unassociated content by fallaciousreasoning · Pull Request \#26379 · brave/brave-core](#26379) - [\[AI Chat\]: Add support for static conversation starters · Issue \#42106 · brave/brave-browser](brave/brave-browser#42106) `QA/Yes` - test plan: needs improvement - [Css tweaks and icon change for sidebar by aguscruiz · Pull Request \#26450 · brave/brave-core](#26450) - [\[Leo full page\] - Tweak to expand/collapse sidebar icons · Issue \#42068 · brave/brave-browser](brave/brave-browser#42068) `QA/Yes` - test plan: specified (check icons are correct) - [\[AI Chat\]: Update styling on suggestions by fallaciousreasoning · Pull Request \#26565 · brave/brave-core](#26565) - [\[AI Chat\]: Update suggestions style to match new design · Issue \#42107 · brave/brave-browser](brave/brave-browser#42107) `QA/Yes` - test plan: specified (check suggestions have new style) - [\[AI Chat\]: Don't show starter suggestions on non-empty chats by fallaciousreasoning · Pull Request \#26677 · brave/brave-core](#26677) - [AI Chat static conversation starters shouldn't show if conversation has chat history · Issue \#42412 · brave/brave-browser](brave/brave-browser#42412) `QA/Yes` - test plan: specified (verify conversation starters only show when applicable) - [fix hit area for leo conversations list by aguscruiz · Pull Request \#26793 · brave/brave-core](#26793) - [Leo full page - Conversation list - Make the whole item clickable instead of excluding the padding · Issue \#42552 · brave/brave-browser](brave/brave-browser#42552) `QA/No` - [\[Nala / @brave/leo\] update dependency by petemill · Pull Request \#26767 · brave/brave-core](#26767) - brave/brave-browser#42545 `QA/No`
1 parent c4a2c55 commit 110b9bf

File tree

239 files changed

+7606
-1998
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

239 files changed

+7606
-1998
lines changed

app/brave_settings_strings.grdp

+16-10
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
Position
9797
</message>
9898
<message name="IDS_SETTINGS_APPEARANCE_SETTINGS_BRAVE_TAB_VERTICAL_TAB_EXPANDED_STATE_PER_WINDOW" desc="Title for checkbox to set expanded state per window">
99-
Expand vertical tabs independently per window
99+
Expand vertical tabs independently per window
100100
</message>
101101
<message name="IDS_SETTINGS_APPEARANCE_SETTINGS_BRAVE_TAB_VERTICAL_TAB_SHOW_SCROLLBAR" desc="Title for checkbox to show scrollbar on vertical tabs">
102102
Show scrollbar
@@ -1332,23 +1332,29 @@
13321332
<message name="IDS_SETTINGS_LEO_ASSISTANT_SHOW_SUGGESTED_PROMPTS_LABEL" desc="The text for settings option">
13331333
Show suggested prompts in the conversation
13341334
</message>
1335-
<message name="IDS_SETTINGS_LEO_ASSISTANT_RESET_AND_CLEAR_DATA_LABEL" desc="The text for settings option">
1336-
Clear Leo data
1335+
<message name="IDS_SETTINGS_LEO_ASSISTANT_HISTORY_PREFERENCE_LABEL" desc="The label for the checkbox determining whether to store AI Chat conversations">
1336+
Store my conversation history
1337+
</message>
1338+
<message name="IDS_SETTINGS_LEO_ASSISTANT_HISTORY_PREFERENCE_CONFIRM" desc="The confirmation prompt about disabling the AI Chat history preference">
1339+
Disabling conversation storage will permanently erase all previously stored conversations. This action can't be undone.
1340+
</message>
1341+
<message name="IDS_SETTINGS_LEO_ASSISTANT_RESET_AND_CLEAR_DATA_LABEL" desc="The button label for deleteing all AI Chat conversations">
1342+
Delete all Leo AI conversation data
13371343
</message>
13381344
<message name="IDS_SETTINGS_LEO_ASSISTANT_RESET_AND_CLEAR_DATA_CONFIRMATION_LABEL" desc="The confirmation window message for reset option">
1339-
Resetting the Leo assistant will require you to opt-in to use Brave
1340-
Leo in the future and will also clear your chat history. Clearing your
1345+
Resetting Leo AI will require you to opt-in to use Brave
1346+
Leo AI in the future and will also clear your chat history. Clearing your
13411347
chat history will delete all your previous conversations with Brave
1342-
Leo. This action can't be undone.
1348+
Leo AI. This action can't be undone.
13431349
</message>
13441350
<message name="IDS_SETTINGS_LEO_ASSISTANT_AUTOCOMPLETE_LINK" desc="A label for a link to settings page to adjust autocomplete suggestion based on Leo">
13451351
Adjust autocomplete suggestions
13461352
</message>
1347-
<message name="IDS_SETTINGS_LEO_ASSISTANT_CLEAR_HISTORY_DATA_LABEL" desc="The text for settings option">
1348-
Leo
1353+
<message name="IDS_SETTINGS_AI_CHAT_CLEAR_HISTORY_DATA_LABEL" desc="Label for checkbox to select AI assistant conversations for deletion when deleting browser data">
1354+
Leo AI
13491355
</message>
1350-
<message name="IDS_SETTINGS_LEO_ASSISTANT_CLEAR_HISTORY_DATA_SUBLABEL" desc="The text for settings option">
1351-
Data and chat history
1356+
<message name="IDS_SETTINGS_AI_CHAT_CLEAR_HISTORY_DATA_SUBLABEL" desc="Label description for checkbox to select AI assistant conversations for deletion when deleting browser data">
1357+
Chat history
13521358
</message>
13531359
<message name="IDS_SETTINGS_LEO_ASSISTANT_MODEL_SELECTION_LABEL" desc="Label for selecting default model">
13541360
Default model for new conversations

browser/ai_chat/ai_chat_service_factory.cc

+2-1
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,10 @@ AIChatServiceFactory::BuildServiceInstanceForBrowserContext(
7777
(g_brave_browser_process->process_misc_metrics())
7878
? g_brave_browser_process->process_misc_metrics()->ai_chat_metrics()
7979
: nullptr,
80+
g_browser_process->os_crypt_async(),
8081
context->GetDefaultStoragePartition()
8182
->GetURLLoaderFactoryForBrowserProcess(),
82-
version_info::GetChannelString(chrome::GetChannel()));
83+
version_info::GetChannelString(chrome::GetChannel()), context->GetPath());
8384
}
8485

8586
} // namespace ai_chat

browser/ai_chat/android/ai_chat_utils_android.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ static void JNI_BraveLeoUtils_OpenLeoQuery(
4646
// Send the query
4747
conversation->MaybeUnlinkAssociatedContent();
4848
mojom::ConversationTurnPtr turn = mojom::ConversationTurn::New(
49-
mojom::CharacterType::HUMAN, mojom::ActionType::QUERY,
49+
std::nullopt, mojom::CharacterType::HUMAN, mojom::ActionType::QUERY,
5050
mojom::ConversationTurnVisibility::VISIBLE,
5151
base::android::ConvertJavaStringToUTF8(query), std::nullopt, std::nullopt,
5252
base::Time::Now(), std::nullopt, false);

browser/brave_content_browser_client.cc

+5
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include "brave/browser/skus/skus_service_factory.h"
3939
#include "brave/browser/ui/brave_ui_features.h"
4040
#include "brave/browser/ui/webui/ai_chat/ai_chat_ui.h"
41+
#include "brave/browser/ui/webui/ai_chat/ai_chat_untrusted_conversation_ui.h"
4142
#include "brave/browser/ui/webui/brave_rewards/rewards_page_ui.h"
4243
#include "brave/browser/ui/webui/skus_internals_ui.h"
4344
#include "brave/browser/url_sanitizer/url_sanitizer_service_factory.h"
@@ -49,6 +50,7 @@
4950
#include "brave/components/ai_chat/core/common/mojom/ai_chat.mojom.h"
5051
#include "brave/components/ai_chat/core/common/mojom/page_content_extractor.mojom.h"
5152
#include "brave/components/ai_chat/core/common/mojom/settings_helper.mojom.h"
53+
#include "brave/components/ai_chat/core/common/mojom/untrusted_frame.mojom.h"
5254
#include "brave/components/ai_rewriter/common/buildflags/buildflags.h"
5355
#include "brave/components/body_sniffer/body_sniffer_throttle.h"
5456
#include "brave/components/brave_federated/features.h"
@@ -620,6 +622,9 @@ void BraveContentBrowserClient::RegisterWebUIInterfaceBrokers(
620622
registry.ForWebUI<AIChatUI>()
621623
.Add<ai_chat::mojom::AIChatUIHandler>()
622624
.Add<ai_chat::mojom::Service>();
625+
registry.ForWebUI<AIChatUntrustedConversationUI>()
626+
.Add<ai_chat::mojom::UntrustedUIHandler>()
627+
.Add<ai_chat::mojom::UntrustedConversationHandler>();
623628
}
624629

625630
#if BUILDFLAG(ENABLE_AI_REWRITER)

browser/browsing_data/brave_browsing_data_remover_delegate.cc

+32-11
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
#include <memory>
99
#include <utility>
1010

11+
#include "brave/browser/ai_chat/ai_chat_service_factory.h"
1112
#include "brave/browser/brave_news/brave_news_controller_factory.h"
13+
#include "brave/components/ai_chat/core/browser/ai_chat_service.h"
1214
#include "brave/components/ai_chat/core/browser/utils.h"
1315
#include "brave/components/ai_chat/core/common/features.h"
1416
#include "brave/components/brave_news/browser/brave_news_controller.h"
@@ -19,7 +21,9 @@
1921
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
2022
#include "chrome/browser/profiles/profile.h"
2123
#include "chrome/common/buildflags.h"
24+
#include "components/browsing_data/content/browsing_data_helper.h"
2225
#include "components/content_settings/core/browser/host_content_settings_map.h"
26+
#include "content/public/browser/browsing_data_remover.h"
2327

2428
BraveBrowsingDataRemoverDelegate::BraveBrowsingDataRemoverDelegate(
2529
content::BrowserContext* browser_context)
@@ -48,19 +52,42 @@ void BraveBrowsingDataRemoverDelegate::RemoveEmbedderData(
4852
ClearShieldsSettings(delete_begin, delete_end);
4953
}
5054

51-
// Brave News feed cache
5255
if (remove_mask & chrome_browsing_data_remover::DATA_TYPE_HISTORY) {
56+
// Brave News feed cache
5357
if (auto* brave_news_controller =
5458
brave_news::BraveNewsControllerFactory::GetForBrowserContext(
5559
profile_)) {
5660
brave_news_controller->ClearHistory();
5761
}
62+
// AI Chat history but only associated content, not neccessary if we
63+
// are also deleting entire AI Chat history.
64+
if (!(remove_mask &
65+
chrome_browsing_data_remover::DATA_TYPE_BRAVE_LEO_HISTORY)) {
66+
ai_chat::AIChatService* ai_chat_service =
67+
ai_chat::AIChatServiceFactory::GetForBrowserContext(profile_);
68+
if (ai_chat_service) {
69+
ai_chat_service->DeleteAssociatedWebContent(delete_begin, delete_end);
70+
}
71+
}
5872
}
5973

60-
if (remove_mask & chrome_browsing_data_remover::DATA_TYPE_BRAVE_LEO_HISTORY &&
61-
ai_chat::IsAIChatEnabled(profile_->GetPrefs()) &&
62-
ai_chat::features::IsAIChatHistoryEnabled()) {
63-
ClearAiChatHistory(delete_begin, delete_end);
74+
if (remove_mask & chrome_browsing_data_remover::DATA_TYPE_BRAVE_LEO_HISTORY) {
75+
ai_chat::AIChatService* ai_chat_service =
76+
ai_chat::AIChatServiceFactory::GetForBrowserContext(profile_);
77+
if (ai_chat_service) {
78+
ai_chat_service->DeleteConversations(delete_begin, delete_end);
79+
}
80+
}
81+
82+
if ((remove_mask & content::BrowsingDataRemover::DATA_TYPE_COOKIES) ||
83+
(remove_mask & chrome_browsing_data_remover::DATA_TYPE_HISTORY)) {
84+
HostContentSettingsMap::PatternSourcePredicate website_settings_filter =
85+
browsing_data::CreateWebsiteSettingsFilter(filter_builder);
86+
HostContentSettingsMap* host_content_settings_map =
87+
HostContentSettingsMapFactory::GetForProfile(profile_);
88+
host_content_settings_map->ClearSettingsForOneTypeWithPredicate(
89+
ContentSettingsType::BRAVE_SHIELDS_METADATA, delete_begin, delete_end,
90+
website_settings_filter);
6491
}
6592
}
6693

@@ -92,9 +119,3 @@ void BraveBrowsingDataRemoverDelegate::ClearShieldsSettings(
92119
}
93120
}
94121
}
95-
96-
void BraveBrowsingDataRemoverDelegate::ClearAiChatHistory(base::Time begin_time,
97-
base::Time end_time) {
98-
// Handler for the Brave Leo History clearing.
99-
// It is prepared for future implementation.
100-
}

browser/browsing_data/brave_browsing_data_remover_delegate.h

-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ class BraveBrowsingDataRemoverDelegate
4343
base::OnceCallback<void(uint64_t)> callback) override;
4444

4545
void ClearShieldsSettings(base::Time begin_time, base::Time end_time);
46-
void ClearAiChatHistory(base::Time begin_time, base::Time end_time);
4746

4847
raw_ptr<Profile> profile_ = nullptr;
4948
base::WeakPtrFactory<BraveBrowsingDataRemoverDelegate> weak_ptr_factory_{

browser/browsing_data/sources.gni

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ brave_browser_browsing_data_sources = [
1414

1515
brave_browser_browsing_data_deps = [
1616
"//base",
17+
"//brave/browser/ai_chat",
18+
"//brave/components/ai_chat/core/browser",
1719
"//chrome/browser:browser_process",
1820
"//chrome/browser/browsing_data:constants",
1921
"//chrome/browser/profiles:profile",

browser/extensions/api/settings_private/brave_prefs_util.cc

+2
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,8 @@ const PrefsUtil::TypedPrefMap& BravePrefsUtil::GetAllowlistedKeys() {
242242
settings_api::PrefType::kBoolean;
243243

244244
// Leo Assistant pref
245+
(*s_brave_allowlist)[ai_chat::prefs::kStorageEnabled] =
246+
settings_api::PrefType::kBoolean;
245247
(*s_brave_allowlist)[ai_chat::prefs::kBraveChatAutocompleteProviderEnabled] =
246248
settings_api::PrefType::kBoolean;
247249
(*s_brave_allowlist)[ai_chat::prefs::kBraveAIChatContextMenuEnabled] =

browser/resources/settings/brave_clear_browsing_data_dialog/brave_clear_browsing_data_on_exit_page.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
</settings-checkbox>
3131
<settings-checkbox id="leoResetOnExitCheckbox"
3232
pref="{{prefs.browser.clear_data.brave_leo_on_exit}}"
33-
label="$i18n{leoClearHistoryData}"
34-
sub-label="$i18n{leoClearHistoryDataSubLabel}"
33+
label="$i18n{aiChatClearHistoryData}"
34+
sub-label="$i18n{aiChatClearHistoryDataSubLabel}"
3535
hidden="[[!isLeoAssistantAndHistoryAllowed_]]"
3636
no-set-pref>
3737
</settings-checkbox>

browser/resources/settings/brave_clear_browsing_data_dialog/brave_clear_browsing_data_on_exit_page.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Polymer({
4343
},
4444
},
4545

46-
isLeoAssistantAndHistoryAllowed_: {
46+
isAIChatAssistantAndHistoryAllowed_: {
4747
type: Boolean,
4848
value: function() {
4949
return loadTimeData.getBoolean('isLeoAssistantAllowed')

browser/resources/settings/brave_leo_assistant_page/brave_leo_assistant_page.html

+9-2
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,15 @@
115115
<template is="dom-if" if="[[isPremium_]]">
116116
<cr-link-row on-click="openManageAccountPage_" external="true" class="hr" label="$i18n{braveLeoAssistantManageUrlLabel}"></cr-link-row>
117117
</template>
118-
<div class="settings-box " on-click="onResetAssistantData_">
118+
<template is="dom-if" if="[[isHistoryFeatureEnabled_]]">
119+
<settings-toggle-button class="cr-row hr"
120+
pref="{{prefs.brave.ai_chat.storage_enabled}}"
121+
label="$i18n{braveLeoAssistantHistoryPreferenceLabel}"
122+
on-settings-boolean-control-change="onStorageEnabledChange_">
123+
</settings-toggle-button>
124+
<div class="settings-box " on-click="onResetAssistantData_">
119125
<div class="flex cr-padded-text reset-leo">
120126
<div>$i18n{braveLeoAssistantResetAndClearDataLabel}</div>
121127
</div>
122-
</div>
128+
</div>
129+
</template>

browser/resources/settings/brave_leo_assistant_page/brave_leo_assistant_page.ts

+30-7
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,19 @@
44
// You can obtain one at https://mozilla.org/MPL/2.0/.
55

66
import '//resources/cr_elements/md_select.css.js'
7-
import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
8-
import {WebUiListenerMixin} from 'chrome://resources/cr_elements/web_ui_listener_mixin.js';
9-
import {PrefsMixin} from '/shared/settings/prefs/prefs_mixin.js';
10-
import {I18nMixin} from 'chrome://resources/cr_elements/i18n_mixin.js';
7+
import 'chrome://resources/brave/leo.bundle.js'
8+
import {assert} from 'chrome://resources/js/assert.js';
9+
import {I18nMixin} from 'chrome://resources/cr_elements/i18n_mixin.js'
10+
import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'
11+
import {WebUiListenerMixin} from 'chrome://resources/cr_elements/web_ui_listener_mixin.js'
12+
import {PrefsMixin} from '/shared/settings/prefs/prefs_mixin.js'
13+
import {SettingsToggleButtonElement} from '../controls/settings_toggle_button.js'
14+
import {Router} from '../router.js'
15+
import {loadTimeData} from '../i18n_setup.js'
16+
import {routes} from '../route.js';
1117
import {getTemplate} from './brave_leo_assistant_page.html.js'
1218
import {BraveLeoAssistantBrowserProxy, BraveLeoAssistantBrowserProxyImpl, PremiumStatus, ModelWithSubtitle, PremiumInfo, ModelAccess, Model}
1319
from './brave_leo_assistant_browser_proxy.js'
14-
import 'chrome://resources/brave/leo.bundle.js'
15-
import { Router } from '../router.js';
16-
import {routes} from '../route.js';
1720

1821
const BraveLeoAssistantPageBase =
1922
WebUiListenerMixin(I18nMixin(PrefsMixin(PolymerElement)))
@@ -33,6 +36,10 @@ class BraveLeoAssistantPageElement extends BraveLeoAssistantPageBase {
3336

3437
static get properties() {
3538
return {
39+
prefs: {
40+
type: Object,
41+
notify: true,
42+
},
3643
leoAssistantShowOnToolbarPref_: {
3744
type: Boolean,
3845
value: false,
@@ -51,6 +58,10 @@ class BraveLeoAssistantPageElement extends BraveLeoAssistantPageBase {
5158
}
5259

5360
private isPremiumUser_: boolean
61+
62+
isHistoryFeatureEnabled_: boolean =
63+
loadTimeData.getBoolean('isLeoAssistantHistoryAllowed')
64+
5465
leoAssistantShowOnToolbarPref_: boolean
5566
defaultModelKeyPrefValue_: string
5667
models_: ModelWithSubtitle[]
@@ -180,6 +191,18 @@ class BraveLeoAssistantPageElement extends BraveLeoAssistantPageBase {
180191
openManageAccountPage_() {
181192
window.open(this.manageUrl_, "_self", "noopener noreferrer")
182193
}
194+
195+
private onStorageEnabledChange_(event: Event) {
196+
const target = event.target
197+
assert(target instanceof SettingsToggleButtonElement);
198+
// Confirm that the user knows conversation history will be permanently
199+
// deleted.
200+
if (!target?.checked) {
201+
if (!confirm(this.i18n('braveLeoAssistantHistoryPreferenceConfirm'))) {
202+
target.checked = !target.checked
203+
}
204+
}
205+
}
183206
}
184207

185208
customElements.define(

browser/resources/settings/brave_overrides/clear_browsing_data_dialog.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ RegisterPolymerTemplateModifications({
133133
<settings-checkbox
134134
id="leoResetCheckbox"
135135
pref="{{prefs.browser.clear_data.brave_leo}}"
136-
label="[[i18n('leoClearHistoryData')]]"
137-
sub-label="[[i18n('leoClearHistoryDataSubLabel')]]"
136+
label="[[i18n('aiChatClearHistoryData')]]"
137+
sub-label="[[i18n('aiChatClearHistoryDataSubLabel')]]"
138138
disabled="[[clearingInProgress_]]"
139139
no-set-pref>
140140
</settings-checkbox>`)

browser/resources/settings/brave_overrides/settings_menu.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ RegisterPolymerTemplateModifications({
266266
// Add leo item
267267
const leoAssistantEl = createMenuElement(
268268
loadTimeData.getString('leoAssistant'),
269-
'/leo-assistant',
269+
'/leo-ai',
270270
'product-brave-leo',
271271
'leoAssistant',
272272
)

browser/resources/settings/brave_routes.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export default function addBraveRoutes(r: Partial<SettingsRoutes>) {
5353

5454
if (pageVisibility.leoAssistant) {
5555
r.BRAVE_LEO_ASSISTANT =
56-
r.BASIC.createSection('/leo-assistant', 'leoAssistant')
56+
r.BASIC.createSection('/leo-ai', 'leoAssistant')
5757
}
5858
if (pageVisibility.content) {
5959
r.BRAVE_CONTENT = r.BASIC.createSection('/braveContent', 'content')

browser/resources/settings/sources.gni

+1
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ brave_settings_ts_extra_deps =
156156
brave_settings_mojo_files = [
157157
"$root_gen_dir/brave/components/ai_chat/core/common/mojom/settings_helper.mojom-webui.ts",
158158
"$root_gen_dir/brave/components/ai_chat/core/common/mojom/ai_chat.mojom-webui.ts",
159+
"$root_gen_dir/brave/components/ai_chat/core/common/mojom/untrusted_frame.mojom-webui.ts",
159160
]
160161

161162
brave_settings_mojo_files_deps =

browser/ui/BUILD.gn

+3-1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ source_set("ui") {
6666
"webui/ai_chat/ai_chat_ui.h",
6767
"webui/ai_chat/ai_chat_ui_page_handler.cc",
6868
"webui/ai_chat/ai_chat_ui_page_handler.h",
69+
"webui/ai_chat/ai_chat_untrusted_conversation_ui.cc",
70+
"webui/ai_chat/ai_chat_untrusted_conversation_ui.h",
6971
"webui/brave_adblock_internals_ui.cc",
7072
"webui/brave_adblock_internals_ui.h",
7173
"webui/brave_adblock_ui.cc",
@@ -763,7 +765,7 @@ source_set("ui") {
763765
"//brave/components/ai_chat/core/browser",
764766
"//brave/components/ai_chat/core/common",
765767
"//brave/components/ai_chat/core/common/mojom",
766-
"//brave/components/ai_chat/resources/page:generated_resources",
768+
"//brave/components/ai_chat/resources",
767769
"//brave/components/ai_rewriter/common/buildflags",
768770
"//brave/components/brave_adaptive_captcha",
769771
"//brave/components/brave_adblock_ui:generated_resources",

browser/ui/brave_pages.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ void ShowFullpageChat(Browser* browser) {
5050
if (!ai_chat::features::IsAIChatHistoryEnabled()) {
5151
return;
5252
}
53-
ShowSingletonTabOverwritingNTP(browser, GURL(kChatUIURL));
53+
ShowSingletonTabOverwritingNTP(browser, GURL(kAIChatUIURL));
5454
}
5555

5656
void ShowWebcompatReporter(Browser* browser) {

browser/ui/views/side_panel/brave_side_panel_utils.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ std::unique_ptr<views::View> CreateAIChatSidePanelWebView(
2828
auto web_view = std::make_unique<SidePanelWebUIViewT<AIChatUI>>(
2929
scope, base::RepeatingClosure(), base::RepeatingClosure(),
3030
std::make_unique<WebUIContentsWrapperT<AIChatUI>>(
31-
GURL(kChatUIURL), profile.get(),
31+
GURL(kAIChatUIURL), profile.get(),
3232
IDS_SIDEBAR_CHAT_SUMMARIZER_ITEM_TITLE,
3333
/*esc_closes_ui=*/false));
3434
web_view->ShowUI();

0 commit comments

Comments
 (0)