diff --git a/browser/ai_chat/ai_chat_browsertests.cc b/browser/ai_chat/ai_chat_browsertests.cc index 83df01665bd..f7b43f49065 100644 --- a/browser/ai_chat/ai_chat_browsertests.cc +++ b/browser/ai_chat/ai_chat_browsertests.cc @@ -20,9 +20,9 @@ namespace ai_chat { -class AiChatBrowserTest : public InProcessBrowserTest { +class AIChatBrowserTest : public InProcessBrowserTest { public: - AiChatBrowserTest() = default; + AIChatBrowserTest() = default; void SetUpOnMainThread() override { base::FilePath test_data_dir = @@ -81,7 +81,7 @@ class AiChatBrowserTest : public InProcessBrowserTest { net::EmbeddedTestServer https_server_{net::EmbeddedTestServer::TYPE_HTTPS}; }; -IN_PROC_BROWSER_TEST_F(AiChatBrowserTest, YoutubeNavigations) { +IN_PROC_BROWSER_TEST_F(AIChatBrowserTest, YoutubeNavigations) { const GURL url("https://www.youtube.com/youtube.html"); ui_test_utils::NavigateToURLWithDisposition( diff --git a/browser/ai_chat/ai_chat_throttle_unittest.cc b/browser/ai_chat/ai_chat_throttle_unittest.cc index b6f25c41baa..cbbf01eebbe 100644 --- a/browser/ai_chat/ai_chat_throttle_unittest.cc +++ b/browser/ai_chat/ai_chat_throttle_unittest.cc @@ -27,13 +27,13 @@ constexpr char kTestProfileName[] = "TestProfile"; } // namespace -class AiChatThrottleUnitTest : public testing::Test, +class AIChatThrottleUnitTest : public testing::Test, public ::testing::WithParamInterface { public: - AiChatThrottleUnitTest() = default; - AiChatThrottleUnitTest(const AiChatThrottleUnitTest&) = delete; - AiChatThrottleUnitTest& operator=(const AiChatThrottleUnitTest&) = delete; - ~AiChatThrottleUnitTest() override = default; + AIChatThrottleUnitTest() = default; + AIChatThrottleUnitTest(const AIChatThrottleUnitTest&) = delete; + AIChatThrottleUnitTest& operator=(const AIChatThrottleUnitTest&) = delete; + ~AIChatThrottleUnitTest() override = default; void SetUp() override { TestingBrowserProcess* browser_process = TestingBrowserProcess::GetGlobal(); @@ -68,13 +68,13 @@ class AiChatThrottleUnitTest : public testing::Test, INSTANTIATE_TEST_SUITE_P( , - AiChatThrottleUnitTest, + AIChatThrottleUnitTest, ::testing::Bool(), - [](const testing::TestParamInfo& info) { + [](const testing::TestParamInfo& info) { return base::StrCat({"History", info.param ? "Enabled" : "Disabled"}); }); -TEST_P(AiChatThrottleUnitTest, CancelNavigationFromTab) { +TEST_P(AIChatThrottleUnitTest, CancelNavigationFromTab) { content::MockNavigationHandle test_handle(web_contents()); test_handle.set_url(GURL(kAIChatUIURL)); @@ -85,8 +85,8 @@ TEST_P(AiChatThrottleUnitTest, CancelNavigationFromTab) { test_handle.set_page_transition(transition); - std::unique_ptr throttle = - AiChatThrottle::MaybeCreateThrottleFor(&test_handle); + std::unique_ptr throttle = + AIChatThrottle::MaybeCreateThrottleFor(&test_handle); #if !BUILDFLAG(IS_ANDROID) if (IsAIChatHistoryEnabled()) { @@ -101,7 +101,7 @@ TEST_P(AiChatThrottleUnitTest, CancelNavigationFromTab) { #endif } -TEST_P(AiChatThrottleUnitTest, CancelNavigationToFrame) { +TEST_P(AIChatThrottleUnitTest, CancelNavigationToFrame) { content::MockNavigationHandle test_handle(web_contents()); test_handle.set_url(GURL(kAIChatUntrustedConversationUIURL)); @@ -112,8 +112,8 @@ TEST_P(AiChatThrottleUnitTest, CancelNavigationToFrame) { test_handle.set_page_transition(transition); - std::unique_ptr throttle = - AiChatThrottle::MaybeCreateThrottleFor(&test_handle); + std::unique_ptr throttle = + AIChatThrottle::MaybeCreateThrottleFor(&test_handle); #if !BUILDFLAG(IS_ANDROID) EXPECT_EQ(content::NavigationThrottle::CANCEL_AND_IGNORE, throttle->WillStartRequest().action()); @@ -122,7 +122,7 @@ TEST_P(AiChatThrottleUnitTest, CancelNavigationToFrame) { #endif } -TEST_P(AiChatThrottleUnitTest, AllowNavigationFromPanel) { +TEST_P(AIChatThrottleUnitTest, AllowNavigationFromPanel) { content::MockNavigationHandle test_handle(web_contents()); test_handle.set_url(GURL(kAIChatUIURL)); @@ -137,8 +137,8 @@ TEST_P(AiChatThrottleUnitTest, AllowNavigationFromPanel) { test_handle.set_page_transition(transition); - std::unique_ptr throttle = - AiChatThrottle::MaybeCreateThrottleFor(&test_handle); + std::unique_ptr throttle = + AIChatThrottle::MaybeCreateThrottleFor(&test_handle); EXPECT_EQ(throttle.get(), nullptr); } diff --git a/browser/brave_content_browser_client.cc b/browser/brave_content_browser_client.cc index a855e1ee0e4..7302bceddb5 100644 --- a/browser/brave_content_browser_client.cc +++ b/browser/brave_content_browser_client.cc @@ -1284,7 +1284,7 @@ BraveContentBrowserClient::CreateThrottlesForNavigation( if (Profile::FromBrowserContext(context)->IsRegularProfile()) { if (auto ai_chat_throttle = - ai_chat::AiChatThrottle::MaybeCreateThrottleFor(handle)) { + ai_chat::AIChatThrottle::MaybeCreateThrottleFor(handle)) { throttles.push_back(std::move(ai_chat_throttle)); } } diff --git a/components/ai_chat/content/browser/ai_chat_throttle.cc b/components/ai_chat/content/browser/ai_chat_throttle.cc index 87ce37b862a..13c2dad9776 100644 --- a/components/ai_chat/content/browser/ai_chat_throttle.cc +++ b/components/ai_chat/content/browser/ai_chat_throttle.cc @@ -23,7 +23,7 @@ namespace ai_chat { // static -std::unique_ptr AiChatThrottle::MaybeCreateThrottleFor( +std::unique_ptr AIChatThrottle::MaybeCreateThrottleFor( content::NavigationHandle* navigation_handle) { // The throttle's only purpose is to deny navigation in a Tab. @@ -65,21 +65,21 @@ std::unique_ptr AiChatThrottle::MaybeCreateThrottleFor( ui::PageTransition::PAGE_TRANSITION_FROM_ADDRESS_BAR)) { return nullptr; } - return std::make_unique(navigation_handle); + return std::make_unique(navigation_handle); #endif // BUILDFLAG(IS_ANDROID) } -AiChatThrottle::AiChatThrottle(content::NavigationHandle* handle) +AIChatThrottle::AIChatThrottle(content::NavigationHandle* handle) : content::NavigationThrottle(handle) {} -AiChatThrottle::~AiChatThrottle() {} +AIChatThrottle::~AIChatThrottle() {} -AiChatThrottle::ThrottleCheckResult AiChatThrottle::WillStartRequest() { +AIChatThrottle::ThrottleCheckResult AIChatThrottle::WillStartRequest() { return CANCEL_AND_IGNORE; } -const char* AiChatThrottle::GetNameForLogging() { - return "AiChatThrottle"; +const char* AIChatThrottle::GetNameForLogging() { + return "AIChatThrottle"; } } // namespace ai_chat diff --git a/components/ai_chat/content/browser/ai_chat_throttle.h b/components/ai_chat/content/browser/ai_chat_throttle.h index c07d94b5cad..dc4843d4de7 100644 --- a/components/ai_chat/content/browser/ai_chat_throttle.h +++ b/components/ai_chat/content/browser/ai_chat_throttle.h @@ -17,12 +17,12 @@ class NavigationHandle; namespace ai_chat { // Prevents navigation to certain AI Chat URLs -class AiChatThrottle : public content::NavigationThrottle { +class AIChatThrottle : public content::NavigationThrottle { public: - explicit AiChatThrottle(content::NavigationHandle* handle); - ~AiChatThrottle() override; + explicit AIChatThrottle(content::NavigationHandle* handle); + ~AIChatThrottle() override; - static std::unique_ptr MaybeCreateThrottleFor( + static std::unique_ptr MaybeCreateThrottleFor( content::NavigationHandle* navigation_handle); // content::NavigationThrottle: diff --git a/components/sidebar/browser/sidebar_service_unittest.cc b/components/sidebar/browser/sidebar_service_unittest.cc index 29bda159994..ea5db3bdafb 100644 --- a/components/sidebar/browser/sidebar_service_unittest.cc +++ b/components/sidebar/browser/sidebar_service_unittest.cc @@ -1073,7 +1073,7 @@ TEST_F(SidebarServiceOrderingTest, LoadFromPrefsWalletBuiltInHidden) { LoadFromPrefsTest(std::move(sidebar), items, expected_count); } -TEST_F(SidebarServiceOrderingTest, LoadFromPrefsAiChatBuiltInNotListed) { +TEST_F(SidebarServiceOrderingTest, LoadFromPrefsAIChatBuiltInNotListed) { base::Value::Dict sidebar = base::test::ParseJsonDict(sidebar_builtin_ai_chat_not_listed_json);