mirror of
https://github.com/browseros-ai/BrowserOS.git
synced 2026-05-13 23:53:25 +00:00
fix: clean-up old clawd support
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
|
||||
index e80a06d6cb742..03f3835d6525b 100644
|
||||
index ba5ddf7d8837e..08dc267110f67 100644
|
||||
--- a/chrome/browser/about_flags.cc
|
||||
+++ b/chrome/browser/about_flags.cc
|
||||
@@ -12068,6 +12068,20 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
@@ -11742,6 +11742,16 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
{"bookmarks-tree-view", flag_descriptions::kBookmarksTreeViewName,
|
||||
flag_descriptions::kBookmarksTreeViewDescription, kOsDesktop,
|
||||
FEATURE_VALUE_TYPE(features::kBookmarksTreeView)},
|
||||
@@ -12,14 +12,10 @@ index e80a06d6cb742..03f3835d6525b 100644
|
||||
+ flag_descriptions::kBrowserOsAlphaFeaturesDescription, kOsDesktop,
|
||||
+ FEATURE_VALUE_TYPE(features::kBrowserOsAlphaFeatures)},
|
||||
+
|
||||
+ {"enable-browseros-clawdbot", flag_descriptions::kBrowserOsClawdbotName,
|
||||
+ flag_descriptions::kBrowserOsClawdbotDescription, kOsDesktop,
|
||||
+ FEATURE_VALUE_TYPE(features::kBrowserOsClawdbot)},
|
||||
+
|
||||
+ {"enable-browseros-keyboard-shortcuts",
|
||||
+ flag_descriptions::kBrowserOsKeyboardShortcutsName,
|
||||
+ flag_descriptions::kBrowserOsKeyboardShortcutsDescription, kOsDesktop,
|
||||
+ FEATURE_VALUE_TYPE(features::kBrowserOsKeyboardShortcuts)},
|
||||
#endif
|
||||
|
||||
{"enable-secure-payment-confirmation-availability-api",
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
|
||||
@@ -1,17 +1,14 @@
|
||||
diff --git a/chrome/browser/browser_features.cc b/chrome/browser/browser_features.cc
|
||||
index ed397bd22e079..a765f2c515516 100644
|
||||
index 875b4d0c538c5..00d5084d2e168 100644
|
||||
--- a/chrome/browser/browser_features.cc
|
||||
+++ b/chrome/browser/browser_features.cc
|
||||
@@ -41,6 +41,16 @@ BASE_FEATURE(kBookmarkTriggerForPreconnect, base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
@@ -41,6 +41,13 @@ BASE_FEATURE(kBookmarkTriggerForPreconnect, base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
// crbug.com/413259638 for more details of Bookmark triggered prefetching.
|
||||
BASE_FEATURE(kBookmarkTriggerForPrefetch, base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
|
||||
+// Enables BrowserOS alpha features.
|
||||
+BASE_FEATURE(kBrowserOsAlphaFeatures, base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
+
|
||||
+// Enables Clawdbot Browser Relay extension.
|
||||
+BASE_FEATURE(kBrowserOsClawdbot, base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
+
|
||||
+// Enables BrowserOS keyboard shortcuts (Option+K, Option+L, Option+A, etc.).
|
||||
+// Disable this on keyboards where Option+letter produces special characters.
|
||||
+BASE_FEATURE(kBrowserOsKeyboardShortcuts, base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
diff --git a/chrome/browser/browser_features.h b/chrome/browser/browser_features.h
|
||||
index 5737721a47154..5ad629ba0ea88 100644
|
||||
index a9cbacc50c7b5..cf13309f8f308 100644
|
||||
--- a/chrome/browser/browser_features.h
|
||||
+++ b/chrome/browser/browser_features.h
|
||||
@@ -35,6 +35,9 @@ BASE_DECLARE_FEATURE(kAllowUnmutedAutoplayForTWA);
|
||||
@@ -35,6 +35,8 @@ BASE_DECLARE_FEATURE(kAllowUnmutedAutoplayForTWA);
|
||||
BASE_DECLARE_FEATURE(kAutocompleteActionPredictorConfidenceCutoff);
|
||||
BASE_DECLARE_FEATURE(kBookmarksTreeView);
|
||||
BASE_DECLARE_FEATURE(kBookmarkTriggerForPrerender2KillSwitch);
|
||||
+BASE_DECLARE_FEATURE(kBrowserOsAlphaFeatures);
|
||||
+BASE_DECLARE_FEATURE(kBrowserOsClawdbot);
|
||||
+BASE_DECLARE_FEATURE(kBrowserOsKeyboardShortcuts);
|
||||
BASE_DECLARE_FEATURE(kBookmarkTriggerForPreconnect);
|
||||
BASE_DECLARE_FEATURE(kBookmarkTriggerForPrefetch);
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
diff --git a/chrome/browser/browseros/core/browseros_constants.h b/chrome/browser/browseros/core/browseros_constants.h
|
||||
new file mode 100644
|
||||
index 0000000000000..a9fe1bf4d7d1f
|
||||
index 0000000000000..1e5f2cbc71a62
|
||||
--- /dev/null
|
||||
+++ b/chrome/browser/browseros/core/browseros_constants.h
|
||||
@@ -0,0 +1,229 @@
|
||||
@@ -0,0 +1,223 @@
|
||||
+// Copyright 2024 The Chromium Authors
|
||||
+// Use of this source code is governed by a BSD-style license that can be
|
||||
+// found in the LICENSE file.
|
||||
@@ -44,10 +44,6 @@ index 0000000000000..a9fe1bf4d7d1f
|
||||
+inline constexpr char kControllerExtensionId[] =
|
||||
+ "nlnihljpboknmfagkikhkdblbedophja";
|
||||
+
|
||||
+// Clawdbot Browser Relay Extension ID (feature-gated)
|
||||
+inline constexpr char kClawdbotExtensionId[] =
|
||||
+ "nkaehhfoahfeglbnbdglnkidgpapbgma";
|
||||
+
|
||||
+// uBlock Origin Extension ID (Chrome Web Store)
|
||||
+// inline constexpr char kUBlockOriginExtensionId[] =
|
||||
+// "cjpalhdlnbpafiamejdnhcphjbkeiagm";
|
||||
@@ -176,8 +172,6 @@ index 0000000000000..a9fe1bf4d7d1f
|
||||
+ {kControllerExtensionId, false, false},
|
||||
+ // ublock origin gets installed from chrome web store
|
||||
+ // {kUBlockOriginExtensionId, false, false},
|
||||
+ // Clawdbot is feature-gated (kBrowserOsClawdbot)
|
||||
+ {kClawdbotExtensionId, true, false},
|
||||
+};
|
||||
+
|
||||
+inline constexpr size_t kBrowserOSExtensionsCount =
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
diff --git a/chrome/browser/browseros/extensions/browseros_extension_installer.cc b/chrome/browser/browseros/extensions/browseros_extension_installer.cc
|
||||
new file mode 100644
|
||||
index 0000000000000..27fadedbd37ef
|
||||
index 0000000000000..e8c6dd400d699
|
||||
--- /dev/null
|
||||
+++ b/chrome/browser/browseros/extensions/browseros_extension_installer.cc
|
||||
@@ -0,0 +1,341 @@
|
||||
@@ -0,0 +1,317 @@
|
||||
+// Copyright 2024 The Chromium Authors
|
||||
+// Use of this source code is governed by a BSD-style license that can be
|
||||
+// found in the LICENSE file.
|
||||
@@ -146,12 +146,6 @@ index 0000000000000..27fadedbd37ef
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ // Skip Clawdbot unless feature is enabled
|
||||
+ if (extension_id == kClawdbotExtensionId &&
|
||||
+ !base::FeatureList::IsEnabled(features::kBrowserOsClawdbot)) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ const base::Value::Dict& config_dict = config.GetDict();
|
||||
+ const std::string* crx_file = config_dict.FindString("external_crx");
|
||||
+ const std::string* version = config_dict.FindString("external_version");
|
||||
@@ -266,12 +260,6 @@ index 0000000000000..27fadedbd37ef
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ // Skip Clawdbot unless feature is enabled
|
||||
+ if (extension_id == kClawdbotExtensionId &&
|
||||
+ !base::FeatureList::IsEnabled(features::kBrowserOsClawdbot)) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ result.extension_ids.insert(extension_id);
|
||||
+
|
||||
+ const base::Value::Dict& config_dict = config.GetDict();
|
||||
@@ -302,18 +290,6 @@ index 0000000000000..27fadedbd37ef
|
||||
+ LOG(INFO) << "browseros: Loaded " << result.prefs.size()
|
||||
+ << " extensions from remote config";
|
||||
+
|
||||
+ // Add Clawdbot if feature enabled and not already in config.
|
||||
+ // Uses main update URL since alpha config would already contain Clawdbot.
|
||||
+ if (base::FeatureList::IsEnabled(features::kBrowserOsClawdbot) &&
|
||||
+ !result.prefs.contains(kClawdbotExtensionId)) {
|
||||
+ base::Value::Dict clawdbot_prefs;
|
||||
+ clawdbot_prefs.Set(extensions::ExternalProviderImpl::kExternalUpdateUrl,
|
||||
+ kBrowserOSUpdateUrl);
|
||||
+ result.prefs.Set(kClawdbotExtensionId, std::move(clawdbot_prefs));
|
||||
+ result.extension_ids.insert(kClawdbotExtensionId);
|
||||
+ LOG(INFO) << "browseros: Added Clawdbot via feature flag";
|
||||
+ }
|
||||
+
|
||||
+ Complete(std::move(result));
|
||||
+}
|
||||
+
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
diff --git a/chrome/browser/browseros/extensions/browseros_extension_loader.cc b/chrome/browser/browseros/extensions/browseros_extension_loader.cc
|
||||
new file mode 100644
|
||||
index 0000000000000..52703e88e7478
|
||||
index 0000000000000..b1bafdc42be93
|
||||
--- /dev/null
|
||||
+++ b/chrome/browser/browseros/extensions/browseros_extension_loader.cc
|
||||
@@ -0,0 +1,212 @@
|
||||
@@ -0,0 +1,203 @@
|
||||
+// Copyright 2024 The Chromium Authors
|
||||
+// Use of this source code is governed by a BSD-style license that can be
|
||||
+// found in the LICENSE file.
|
||||
@@ -41,17 +41,8 @@ index 0000000000000..52703e88e7478
|
||||
+ : kBrowserOSConfigUrl);
|
||||
+
|
||||
+ for (const std::string& id : GetBrowserOSExtensionIds()) {
|
||||
+ // Clawdbot is feature-gated, skip here and add conditionally below
|
||||
+ if (id == kClawdbotExtensionId) {
|
||||
+ continue;
|
||||
+ }
|
||||
+ extension_ids_.insert(id);
|
||||
+ }
|
||||
+
|
||||
+ // Add Clawdbot extension only if feature is enabled
|
||||
+ if (base::FeatureList::IsEnabled(features::kBrowserOsClawdbot)) {
|
||||
+ extension_ids_.insert(kClawdbotExtensionId);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+BrowserOSExtensionLoader::~BrowserOSExtensionLoader() = default;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
|
||||
index d73e9a053eb63..e22ef4d7024af 100644
|
||||
index d73e9a053eb63..5174931bde25d 100644
|
||||
--- a/chrome/browser/flag_descriptions.h
|
||||
+++ b/chrome/browser/flag_descriptions.h
|
||||
@@ -284,6 +284,22 @@ inline constexpr char kBookmarksTreeViewName[] =
|
||||
@@ -284,6 +284,18 @@ inline constexpr char kBookmarksTreeViewName[] =
|
||||
inline constexpr char kBookmarksTreeViewDescription[] =
|
||||
"Show the bookmarks side panel in a tree view while in compact mode.";
|
||||
|
||||
@@ -12,10 +12,6 @@ index d73e9a053eb63..e22ef4d7024af 100644
|
||||
+inline constexpr char kBrowserOsAlphaFeaturesDescription[] =
|
||||
+ "Enables BrowserOS alpha features.";
|
||||
+
|
||||
+inline constexpr char kBrowserOsClawdbotName[] = "BrowserOS Clawdbot";
|
||||
+inline constexpr char kBrowserOsClawdbotDescription[] =
|
||||
+ "Enables Clawdbot Browser Relay extension.";
|
||||
+
|
||||
+inline constexpr char kBrowserOsKeyboardShortcutsName[] =
|
||||
+ "BrowserOS Keyboard Shortcuts";
|
||||
+inline constexpr char kBrowserOsKeyboardShortcutsDescription[] =
|
||||
|
||||
Reference in New Issue
Block a user