Remove enable_ai_chat buildflag
This commit is contained in:
@@ -12,14 +12,16 @@
|
||||
#include "base/feature_list.h"
|
||||
#include "base/types/to_address.h"
|
||||
#include "brave/app/brave_command_ids.h"
|
||||
#include "brave/browser/ai_chat/ai_chat_utils.h"
|
||||
#include "brave/browser/profiles/profile_util.h"
|
||||
#include "brave/browser/ui/brave_pages.h"
|
||||
#include "brave/browser/ui/browser_commands.h"
|
||||
#include "brave/browser/ui/sidebar/sidebar_utils.h"
|
||||
#include "brave/browser/ui/tabs/features.h"
|
||||
#include "brave/browser/ui/tabs/split_view_browser_data.h"
|
||||
#include "brave/components/ai_chat/core/common/buildflags/buildflags.h"
|
||||
#include "brave/components/ai_chat/core/browser/utils.h"
|
||||
#include "brave/components/ai_chat/core/common/features.h"
|
||||
#include "brave/components/ai_chat/core/common/pref_names.h"
|
||||
#include "brave/components/brave_rewards/common/rewards_util.h"
|
||||
#include "brave/components/brave_vpn/common/buildflags/buildflags.h"
|
||||
#include "brave/components/brave_wallet/common/common_utils.h"
|
||||
@@ -43,12 +45,6 @@
|
||||
#include "components/sync/base/command_line_switches.h"
|
||||
#include "content/public/browser/web_contents.h"
|
||||
|
||||
#if BUILDFLAG(ENABLE_AI_CHAT)
|
||||
#include "brave/browser/ai_chat/ai_chat_utils.h"
|
||||
#include "brave/components/ai_chat/core/browser/utils.h"
|
||||
#include "brave/components/ai_chat/core/common/pref_names.h"
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(ENABLE_BRAVE_VPN)
|
||||
#include "brave/browser/brave_vpn/brave_vpn_service_factory.h"
|
||||
#include "brave/browser/brave_vpn/vpn_utils.h"
|
||||
@@ -234,10 +230,8 @@ void BraveBrowserCommandController::InitBraveCommandState() {
|
||||
UpdateCommandForBraveVPN();
|
||||
UpdateCommandForPlaylist();
|
||||
UpdateCommandForWaybackMachine();
|
||||
#if BUILDFLAG(ENABLE_AI_CHAT) || BUILDFLAG(ENABLE_BRAVE_VPN)
|
||||
pref_change_registrar_.Init(browser_->profile()->GetPrefs());
|
||||
#endif
|
||||
#if BUILDFLAG(ENABLE_AI_CHAT)
|
||||
|
||||
UpdateCommandForAIChat();
|
||||
if (ai_chat::IsAllowedForContext(browser_->profile(), false)) {
|
||||
pref_change_registrar_.Add(
|
||||
@@ -246,7 +240,7 @@ void BraveBrowserCommandController::InitBraveCommandState() {
|
||||
&BraveBrowserCommandController::UpdateCommandForAIChat,
|
||||
base::Unretained(this)));
|
||||
}
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(ENABLE_BRAVE_VPN)
|
||||
if (brave_vpn::IsAllowedForContext(browser_->profile())) {
|
||||
pref_change_registrar_.Add(
|
||||
@@ -353,7 +347,6 @@ void BraveBrowserCommandController::UpdateCommandForSidebar() {
|
||||
}
|
||||
}
|
||||
|
||||
#if BUILDFLAG(ENABLE_AI_CHAT)
|
||||
void BraveBrowserCommandController::UpdateCommandForAIChat() {
|
||||
// AI Chat command implementation needs sidebar
|
||||
bool allowed_for_context = ai_chat::IsAllowedForContext(browser_->profile());
|
||||
@@ -363,7 +356,6 @@ void BraveBrowserCommandController::UpdateCommandForAIChat() {
|
||||
IDC_OPEN_FULL_PAGE_CHAT,
|
||||
ai_chat::features::IsAIChatHistoryEnabled() && allowed_for_context);
|
||||
}
|
||||
#endif
|
||||
|
||||
void BraveBrowserCommandController::UpdateCommandForBraveVPN() {
|
||||
#if BUILDFLAG(ENABLE_BRAVE_VPN)
|
||||
@@ -542,14 +534,10 @@ bool BraveBrowserCommandController::ExecuteBraveCommandWithDisposition(
|
||||
brave::ShowBraveWallet(&*browser_);
|
||||
break;
|
||||
case IDC_TOGGLE_AI_CHAT:
|
||||
#if BUILDFLAG(ENABLE_AI_CHAT)
|
||||
brave::ToggleAIChat(&*browser_);
|
||||
#endif
|
||||
break;
|
||||
case IDC_OPEN_FULL_PAGE_CHAT:
|
||||
#if BUILDFLAG(ENABLE_AI_CHAT)
|
||||
brave::ShowFullpageChat(&*browser_);
|
||||
#endif
|
||||
break;
|
||||
case IDC_SPEEDREADER_ICON_ONCLICK:
|
||||
brave::MaybeDistillAndShowSpeedreaderBubble(&*browser_);
|
||||
|
||||
Reference in New Issue
Block a user