Commit a4b140b2 authored by Dirk Pranke's avatar Dirk Pranke Committed by Commit Bot

Revert "Reuse kArcIntentHelperPackageName in c/b/"

This reverts commit bf228a61.

Reason for revert: Didn't compile properly on CrOS (which we missed due to a bad CQ configuration).

Original change's description:
> Reuse kArcIntentHelperPackageName in c/b/
> 
> Reusing kArcIntentHelperPackageName where needed. Also adding a method
> to reuse such package name + a custom string appended to it, this is
> AppendStringToIntentHelperPackageName.
> 
> Bug: None
> Test: Build.
> Change-Id: I1b9115b808533e1e5ed3339b7f3747496ca2f0c3
> Reviewed-on: https://chromium-review.googlesource.com/764396
> Reviewed-by: Scott Violet <sky@chromium.org>
> Reviewed-by: Yusuke Sato <yusukes@chromium.org>
> Commit-Queue: David Jacobo <djacobo@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#516326}

TBR=yusukes@chromium.org,sky@chromium.org,djacobo@chromium.org

Change-Id: Idfef3e2b248c5a1339bb97c47be0f3a6cdf84ba3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: None
Reviewed-on: https://chromium-review.googlesource.com/769187Reviewed-by: default avatarDirk Pranke <dpranke@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#516341}
parent 9b9a86df
......@@ -31,7 +31,6 @@
#include "components/arc/arc_bridge_service.h"
#include "components/arc/arc_browser_context_keyed_service_factory_base.h"
#include "components/arc/bluetooth/bluetooth_type_converters.h"
#include "components/arc/intent_helper/arc_intent_helper_bridge.h"
#include "components/device_event_log/device_event_log.h"
#include "components/prefs/pref_service.h"
#include "components/user_manager/user_manager.h"
......@@ -1495,12 +1494,9 @@ void ArcBluetoothBridge::SendBluetoothPoweredStateBroadcast(
DCHECK(write_success);
intent_instance->SendBroadcast(
ArcIntentHelperBridge::AppendStringToIntentHelperPackageName(
"SET_BLUETOOTH_STATE"),
ArcIntentHelperBridge::kArcIntentHelperPackageName,
ArcIntentHelperBridge::AppendStringToIntentHelperPackageName(
"SettingsReceiver"),
extras_json);
"org.chromium.arc.intent_helper.SET_BLUETOOTH_STATE",
"org.chromium.arc.intent_helper",
"org.chromium.arc.intent_helper.SettingsReceiver", extras_json);
}
void ArcBluetoothBridge::ReadGattCharacteristic(
......
......@@ -32,7 +32,6 @@
#include "components/arc/arc_bridge_service.h"
#include "components/arc/arc_browser_context_keyed_service_factory_base.h"
#include "components/arc/arc_prefs.h"
#include "components/arc/intent_helper/arc_intent_helper_bridge.h"
#include "components/arc/intent_helper/font_size_util.h"
#include "components/onc/onc_pref_names.h"
#include "components/prefs/pref_change_registrar.h"
......@@ -692,10 +691,8 @@ void ArcSettingsServiceImpl::SendSettingsBroadcast(
bool write_success = base::JSONWriter::Write(extras, &extras_json);
DCHECK(write_success);
instance->SendBroadcast(
action, ArcIntentHelperBridge::kArcIntentHelperPackageName,
ArcIntentHelperBridge::AppendStringToIntentHelperPackageName(
"SettingsReceiver"),
instance->SendBroadcast(action, "org.chromium.arc.intent_helper",
"org.chromium.arc.intent_helper.SettingsReceiver",
extras_json);
}
......
......@@ -7,7 +7,6 @@
#include "base/memory/singleton.h"
#include "components/arc/arc_bridge_service.h"
#include "components/arc/arc_browser_context_keyed_service_factory_base.h"
#include "components/arc/intent_helper/arc_intent_helper_bridge.h"
#include "components/session_manager/core/session_manager.h"
namespace arc {
......@@ -61,12 +60,9 @@ void ArcUserSessionService::OnSessionStateChanged() {
return;
instance->SendBroadcast(
ArcIntentHelperBridge::AppendStringToIntentHelperPackageName(
"USER_SESSION_ACTIVE"),
ArcIntentHelperBridge::kArcIntentHelperPackageName,
ArcIntentHelperBridge::AppendStringToIntentHelperPackageName(
"ArcIntentHelperService"),
"{}");
"org.chromium.arc.intent_helper.USER_SESSION_ACTIVE",
"org.chromium.arc.intent_helper",
"org.chromium.arc.intent_helper.ArcIntentHelperService", "{}");
}
void ArcUserSessionService::OnInstanceReady() {
......
......@@ -27,7 +27,6 @@
#include "components/arc/arc_service_manager.h"
#include "components/arc/arc_util.h"
#include "components/arc/common/intent_helper.mojom.h"
#include "components/arc/intent_helper/arc_intent_helper_bridge.h"
#include "components/crx_file/id_util.h"
#include "ui/aura/window.h"
#include "ui/display/display.h"
......@@ -56,11 +55,10 @@ namespace arc {
namespace {
// TODO(djacobo): Evaluate to build these strings by using
// ArcIntentHelperBridge::AppendStringToIntentHelperPackageName.
// Intent helper strings.
constexpr char kIntentHelperClassName[] =
"org.chromium.arc.intent_helper.SettingsReceiver";
constexpr char kIntentHelperPackageName[] = "org.chromium.arc.intent_helper";
constexpr char kSetInTouchModeIntent[] =
"org.chromium.arc.intent_helper.SET_IN_TOUCH_MODE";
constexpr char kShowTalkbackSettingsIntent[] =
......@@ -120,9 +118,8 @@ bool Launch(content::BrowserContext* context,
std::string extras_string;
base::JSONWriter::Write(extras, &extras_string);
intent_helper_instance->SendBroadcast(
kSetInTouchModeIntent,
ArcIntentHelperBridge::kArcIntentHelperPackageName,
kIntentHelperClassName, extras_string);
kSetInTouchModeIntent, kIntentHelperPackageName, kIntentHelperClassName,
extras_string);
}
if (app_info->shortcut || intent.has_value()) {
......@@ -306,9 +303,8 @@ void ShowTalkBackSettings() {
if (!intent_helper_instance)
return;
intent_helper_instance->SendBroadcast(
kShowTalkbackSettingsIntent,
ArcIntentHelperBridge::kArcIntentHelperPackageName,
intent_helper_instance->SendBroadcast(kShowTalkbackSettingsIntent,
kIntentHelperPackageName,
kIntentHelperClassName, "{}");
}
......
......@@ -4,14 +4,11 @@
#include "chrome/browser/ui/views/apps/app_info_dialog/arc_app_info_links_panel.h"
#include <memory>
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/app_list/arc/arc_app_utils.h"
#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h"
#include "chrome/grit/generated_resources.h"
#include "components/arc/common/app.mojom.h"
#include "components/arc/intent_helper/arc_intent_helper_bridge.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/display/display.h"
#include "ui/display/screen.h"
......@@ -21,6 +18,10 @@
#include "ui/views/view.h"
#include "ui/views/widget/widget.h"
namespace {
constexpr char kArcChromePackageName[] = "org.chromium.arc.intent_helper";
}
ArcAppInfoLinksPanel::ArcAppInfoLinksPanel(Profile* profile,
const extensions::Extension* app)
: AppInfoPanel(profile, app),
......@@ -54,9 +55,9 @@ void ArcAppInfoLinksPanel::LinkClicked(views::Link* source, int event_flags) {
display::Screen::GetScreen()
->GetDisplayNearestView(source->GetWidget()->GetNativeView())
.id();
if (arc::ShowPackageInfo(
arc::ArcIntentHelperBridge::kArcIntentHelperPackageName,
arc::mojom::ShowPackageInfoPage::MANAGE_LINKS, display_id)) {
if (arc::ShowPackageInfo(kArcChromePackageName,
arc::mojom::ShowPackageInfoPage::MANAGE_LINKS,
display_id)) {
Close();
}
}
......
......@@ -12,7 +12,6 @@
#include "ash/wallpaper/wallpaper_controller.h"
#include "base/memory/singleton.h"
#include "base/memory/weak_ptr.h"
#include "base/strings/string_util.h"
#include "components/arc/arc_bridge_service.h"
#include "components/arc/arc_browser_context_keyed_service_factory_base.h"
#include "components/arc/arc_service_manager.h"
......@@ -115,12 +114,6 @@ KeyedServiceBaseFactory* ArcIntentHelperBridge::GetFactory() {
return ArcIntentHelperBridgeFactory::GetInstance();
}
// static
std::string ArcIntentHelperBridge::AppendStringToIntentHelperPackageName(
const std::string& to_append) {
return base::JoinString({kArcIntentHelperPackageName, to_append}, ".");
}
ArcIntentHelperBridge::ArcIntentHelperBridge(content::BrowserContext* context,
ArcBridgeService* bridge_service)
: context_(context),
......
......@@ -46,10 +46,6 @@ class ArcIntentHelperBridge
// Returns factory for the ArcIntentHelperBridge.
static KeyedServiceBaseFactory* GetFactory();
// Appends '.' + |to_append| to the intent helper package name.
static std::string AppendStringToIntentHelperPackageName(
const std::string& to_append);
ArcIntentHelperBridge(content::BrowserContext* context,
ArcBridgeService* bridge_service);
~ArcIntentHelperBridge() override;
......
......@@ -350,18 +350,4 @@ TEST_F(ArcIntentHelperTest, TestOnOpenChromeSettings) {
test_open_url_delegate_->TakeLastOpenedUrl());
}
// Tests that AppendStringToIntentHelperPackageName works.
TEST_F(ArcIntentHelperTest, TestAppendStringToIntentHelperPackageName) {
std::string fake_activity = "this_is_a_fake_activity";
EXPECT_EQ(
ArcIntentHelperBridge::AppendStringToIntentHelperPackageName(
fake_activity),
ArcIntentHelperBridge::kArcIntentHelperPackageName + "." + fake_activity);
std::string empty_string = "";
EXPECT_EQ(ArcIntentHelperBridge::AppendStringToIntentHelperPackageName(
empty_string),
ArcIntentHelperBridge::kArcIntentHelperPackageName + ".");
}
} // namespace arc
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment