Commit f760a46e authored by Nancy Wang's avatar Nancy Wang Committed by Commit Bot

Implement the pause/block app accessbility requirement in Shelf.

If the app icon has the pause or block badge, announce 'Paused' or
'Blocked' for Chrome Vox, when the icon item is selected/focused from
shelf.

Add the AppStatus to ShelfItem to record whether the app is paused or
blocked, to announce 'blocked' or 'paused' when the shelf item is
focused. Example:
'Gmail button. Blocked' / 'Gmail button. Paused'.

Block badge has higher priority. When the app is paused and blocked,
set the block badge, and announce 'Blocked'.

Add test cases to verify the change, including the priority for the
block and pause status.

BUG=1144384

Change-Id: I8a849dae570152634d2f1c2767f37848e8ead474
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2550104
Commit-Queue: Nancy Wang <nancylingwang@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#829986}
parent 43d6c496
...@@ -3195,6 +3195,12 @@ Here are some things you can try to get started. ...@@ -3195,6 +3195,12 @@ Here are some things you can try to get started.
Search Search
</message> </message>
<message name="IDS_SHELF_ITEM_HAS_BLOCK_BADGE" desc="Accessibility announcement notifying users that the currently focused shelf app is blocked.">
Blocked
</message>
<message name="IDS_SHELF_ITEM_HAS_PAUSE_BADGE" desc="Accessibility announcement notifying users that the currently focused shelf app is paused.">
Paused
</message>
<message name="IDS_APP_ACCESSIBILITY_BLOCKED_INSTALLED_APP_ANNOUNCEMENT" desc="Accessibility text to specify a search result is a blocked installed app."> <message name="IDS_APP_ACCESSIBILITY_BLOCKED_INSTALLED_APP_ANNOUNCEMENT" desc="Accessibility text to specify a search result is a blocked installed app.">
<ph name="APP_NAME">$1<ex>Files</ex></ph>, Installed App, Blocked <ph name="APP_NAME">$1<ex>Files</ex></ph>, Installed App, Blocked
</message> </message>
......
d496d201da12f24749665ef6b11b23318b09ed63
\ No newline at end of file
bafe2f9ad68cacea93dac11c8e3467eb1b2722b0
\ No newline at end of file
...@@ -33,6 +33,9 @@ struct ASH_PUBLIC_EXPORT ShelfItem { ...@@ -33,6 +33,9 @@ struct ASH_PUBLIC_EXPORT ShelfItem {
// The title to display for tooltips, etc. // The title to display for tooltips, etc.
base::string16 title; base::string16 title;
// App status.
AppStatus app_status = AppStatus::kReady;
// Whether the item is associated with a window in the currently active desk. // Whether the item is associated with a window in the currently active desk.
// This value is valid only when |features::kPerDeskShelf| is enabled. // This value is valid only when |features::kPerDeskShelf| is enabled.
// Otherwise it won't be updated and will always be true. // Otherwise it won't be updated and will always be true.
......
...@@ -187,6 +187,16 @@ enum ShelfItemStatus { ...@@ -187,6 +187,16 @@ enum ShelfItemStatus {
STATUS_ATTENTION, STATUS_ATTENTION,
}; };
// Represents the app status in the shelf or app_list.
enum AppStatus {
// The app is ready.
kReady,
// The app is blocked.
kBlocked,
// The app is paused.
kPaused,
};
// A unique shelf item id composed of an |app_id| and a |launch_id|. // A unique shelf item id composed of an |app_id| and a |launch_id|.
// |app_id| is the non-empty application id associated with a set of windows. // |app_id| is the non-empty application id associated with a set of windows.
// |launch_id| is passed on app launch, to support multiple shelf items per app. // |launch_id| is passed on app launch, to support multiple shelf items per app.
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include "ash/shelf/shelf.h" #include "ash/shelf/shelf.h"
#include "ash/shelf/shelf_button_delegate.h" #include "ash/shelf/shelf_button_delegate.h"
#include "ash/shelf/shelf_view.h" #include "ash/shelf/shelf_view.h"
#include "ash/strings/grit/ash_strings.h"
#include "ash/style/default_color_constants.h" #include "ash/style/default_color_constants.h"
#include "ash/style/default_colors.h" #include "ash/style/default_colors.h"
#include "ash/wm/tablet_mode/tablet_mode_controller.h" #include "ash/wm/tablet_mode/tablet_mode_controller.h"
...@@ -24,6 +25,7 @@ ...@@ -24,6 +25,7 @@
#include "skia/ext/image_operations.h" #include "skia/ext/image_operations.h"
#include "ui/accessibility/ax_action_data.h" #include "ui/accessibility/ax_action_data.h"
#include "ui/accessibility/ax_node_data.h" #include "ui/accessibility/ax_node_data.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_features.h" #include "ui/base/ui_base_features.h"
#include "ui/compositor/layer.h" #include "ui/compositor/layer.h"
#include "ui/compositor/scoped_layer_animation_settings.h" #include "ui/compositor/scoped_layer_animation_settings.h"
...@@ -544,6 +546,21 @@ void ShelfAppButton::GetAccessibleNodeData(ui::AXNodeData* node_data) { ...@@ -544,6 +546,21 @@ void ShelfAppButton::GetAccessibleNodeData(ui::AXNodeData* node_data) {
ShelfButton::GetAccessibleNodeData(node_data); ShelfButton::GetAccessibleNodeData(node_data);
const base::string16 title = shelf_view_->GetTitleForView(this); const base::string16 title = shelf_view_->GetTitleForView(this);
node_data->SetName(title.empty() ? GetAccessibleName() : title); node_data->SetName(title.empty() ? GetAccessibleName() : title);
switch (app_status_) {
case AppStatus::kBlocked:
node_data->SetDescription(
ui::ResourceBundle::GetSharedInstance().GetLocalizedString(
IDS_SHELF_ITEM_HAS_BLOCK_BADGE));
break;
case AppStatus::kPaused:
node_data->SetDescription(
ui::ResourceBundle::GetSharedInstance().GetLocalizedString(
IDS_SHELF_ITEM_HAS_PAUSE_BADGE));
break;
default:
break;
}
} }
bool ShelfAppButton::ShouldEnterPushedState(const ui::Event& event) { bool ShelfAppButton::ShouldEnterPushedState(const ui::Event& event) {
...@@ -561,6 +578,8 @@ void ShelfAppButton::ReflectItemStatus(const ShelfItem& item) { ...@@ -561,6 +578,8 @@ void ShelfAppButton::ReflectItemStatus(const ShelfItem& item) {
ClearState(ShelfAppButton::STATE_NOTIFICATION); ClearState(ShelfAppButton::STATE_NOTIFICATION);
} }
app_status_ = item.app_status;
const ShelfID active_id = shelf_view_->model()->active_shelf_id(); const ShelfID active_id = shelf_view_->model()->active_shelf_id();
if (!active_id.IsNull() && item.id == active_id) { if (!active_id.IsNull() && item.id == active_id) {
// The active status trumps all other statuses. // The active status trumps all other statuses.
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#define ASH_SHELF_SHELF_APP_BUTTON_H_ #define ASH_SHELF_SHELF_APP_BUTTON_H_
#include "ash/ash_export.h" #include "ash/ash_export.h"
#include "ash/public/cpp/shelf_types.h"
#include "ash/shelf/shelf_button.h" #include "ash/shelf/shelf_button.h"
#include "ash/shelf/shelf_button_delegate.h" #include "ash/shelf/shelf_button_delegate.h"
#include "base/macros.h" #include "base/macros.h"
...@@ -204,6 +205,9 @@ class ASH_EXPORT ShelfAppButton : public ShelfButton, ...@@ -204,6 +205,9 @@ class ASH_EXPORT ShelfAppButton : public ShelfButton,
// The scaling factor for displaying the app icon. // The scaling factor for displaying the app icon.
float icon_scale_ = 1.0f; float icon_scale_ = 1.0f;
// App status.
AppStatus app_status_ = AppStatus::kReady;
// Indicates whether the ink drop animation starts. // Indicates whether the ink drop animation starts.
bool ink_drop_animation_started_ = false; bool ink_drop_animation_started_ = false;
......
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
#include "base/task/post_task.h" #include "base/task/post_task.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "chrome/app/chrome_command_ids.h" #include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/apps/app_service/app_service_proxy.h"
#include "chrome/browser/apps/app_service/app_service_proxy_factory.h"
#include "chrome/browser/chromeos/accessibility/accessibility_manager.h" #include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
#include "chrome/browser/chromeos/login/screens/sync_consent_screen.h" #include "chrome/browser/chromeos/login/screens/sync_consent_screen.h"
#include "chrome/browser/chromeos/login/test/device_state_mixin.h" #include "chrome/browser/chromeos/login/test/device_state_mixin.h"
...@@ -513,6 +515,103 @@ IN_PROC_BROWSER_TEST_P(ShelfNotificationBadgeSpokenFeedbackTest, ...@@ -513,6 +515,103 @@ IN_PROC_BROWSER_TEST_P(ShelfNotificationBadgeSpokenFeedbackTest,
sm_.Replay(); sm_.Replay();
} }
// Verifies that an announcement is triggered when focusing a paused app
// ShelfItem.
IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest,
ShelfPausedAppIconBadgeAnnouncement) {
EnableChromeVox();
std::string app_id = "TestApp";
// Set the app status as paused;
std::vector<apps::mojom::AppPtr> apps;
apps::mojom::AppPtr app = apps::mojom::App::New();
app->app_type = apps::mojom::AppType::kBuiltIn;
app->app_id = app_id;
app->readiness = apps::mojom::Readiness::kReady;
app->paused = apps::mojom::OptionalBool::kTrue;
apps.push_back(std::move(app));
apps::AppServiceProxyFactory::GetForProfile(
chromeos::AccessibilityManager::Get()->profile())
->AppRegistryCache()
.OnApps(std::move(apps));
// Create and add a test app to the shelf model.
ash::ShelfItem item;
item.id = ash::ShelfID(app_id);
item.title = base::ASCIIToUTF16("TestAppTitle");
item.type = ash::ShelfItemType::TYPE_APP;
item.app_status = ash::AppStatus::kPaused;
ash::ShelfModel::Get()->Add(item);
// Focus on the shelf.
sm_.Call([this]() { PerformAcceleratorAction(ash::FOCUS_SHELF); });
sm_.ExpectSpeech("Launcher");
sm_.ExpectSpeech("Button");
sm_.ExpectSpeech("Shelf");
sm_.ExpectSpeech("Tool bar");
// Press right key twice to focus the test app.
sm_.Call([this]() { SendKeyPressWithSearch(ui::VKEY_RIGHT); });
sm_.Call([this]() { SendKeyPressWithSearch(ui::VKEY_RIGHT); });
sm_.ExpectSpeech("TestAppTitle");
sm_.ExpectSpeech("Button");
// Check that when a paused app shelf item is focused, the correct
// announcement occurs.
sm_.ExpectSpeech("Paused");
sm_.Replay();
}
// Verifies that an announcement is triggered when focusing a blocked app
// ShelfItem.
IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest,
ShelfBlockedAppIconBadgeAnnouncement) {
EnableChromeVox();
std::string app_id = "TestApp";
// Set the app status as paused;
std::vector<apps::mojom::AppPtr> apps;
apps::mojom::AppPtr app = apps::mojom::App::New();
app->app_type = apps::mojom::AppType::kBuiltIn;
app->app_id = app_id;
app->readiness = apps::mojom::Readiness::kDisabledByPolicy;
apps.push_back(std::move(app));
apps::AppServiceProxyFactory::GetForProfile(
chromeos::AccessibilityManager::Get()->profile())
->AppRegistryCache()
.OnApps(std::move(apps));
// Create and add a test app to the shelf model.
ash::ShelfItem item;
item.id = ash::ShelfID(app_id);
item.title = base::ASCIIToUTF16("TestAppTitle");
item.type = ash::ShelfItemType::TYPE_APP;
item.app_status = ash::AppStatus::kBlocked;
ash::ShelfModel::Get()->Add(item);
// Focus on the shelf.
sm_.Call([this]() { PerformAcceleratorAction(ash::FOCUS_SHELF); });
sm_.ExpectSpeech("Launcher");
sm_.ExpectSpeech("Button");
sm_.ExpectSpeech("Shelf");
sm_.ExpectSpeech("Tool bar");
// Press right key twice to focus the test app.
sm_.Call([this]() { SendKeyPressWithSearch(ui::VKEY_RIGHT); });
sm_.Call([this]() { SendKeyPressWithSearch(ui::VKEY_RIGHT); });
sm_.ExpectSpeech("TestAppTitle");
sm_.ExpectSpeech("Button");
// Check that when a blocked shelf app shelf item is focused, the correct
// announcement occurs.
sm_.ExpectSpeech("Blocked");
sm_.Replay();
}
IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, OpenStatusTray) { IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, OpenStatusTray) {
EnableChromeVox(); EnableChromeVox();
......
...@@ -27,30 +27,34 @@ LauncherAppServiceAppUpdater::LauncherAppServiceAppUpdater( ...@@ -27,30 +27,34 @@ LauncherAppServiceAppUpdater::LauncherAppServiceAppUpdater(
LauncherAppServiceAppUpdater::~LauncherAppServiceAppUpdater() = default; LauncherAppServiceAppUpdater::~LauncherAppServiceAppUpdater() = default;
void LauncherAppServiceAppUpdater::OnAppUpdate(const apps::AppUpdate& update) { void LauncherAppServiceAppUpdater::OnAppUpdate(const apps::AppUpdate& update) {
if (!update.ReadinessChanged()) { if (!update.ReadinessChanged() && !update.PausedChanged())
return; return;
}
const std::string& app_id = update.AppId(); const std::string& app_id = update.AppId();
std::set<std::string>::const_iterator it = installed_apps_.find(app_id); if (update.ReadinessChanged()) {
switch (update.Readiness()) { std::set<std::string>::const_iterator it = installed_apps_.find(app_id);
case apps::mojom::Readiness::kReady: switch (update.Readiness()) {
if (it == installed_apps_.end()) { case apps::mojom::Readiness::kReady:
installed_apps_.insert(app_id); if (it == installed_apps_.end()) {
} installed_apps_.insert(app_id);
delegate()->OnAppInstalled(browser_context(), app_id); }
break; delegate()->OnAppInstalled(browser_context(), app_id);
case apps::mojom::Readiness::kUninstalledByUser: return;
if (it != installed_apps_.end()) { case apps::mojom::Readiness::kUninstalledByUser:
installed_apps_.erase(it); if (it != installed_apps_.end()) {
delegate()->OnAppUninstalledPrepared(browser_context(), app_id); installed_apps_.erase(it);
delegate()->OnAppUninstalled(browser_context(), app_id); delegate()->OnAppUninstalledPrepared(browser_context(), app_id);
} delegate()->OnAppUninstalled(browser_context(), app_id);
break; }
default: return;
delegate()->OnAppUpdated(browser_context(), app_id); default:
break; delegate()->OnAppUpdated(browser_context(), app_id);
return;
}
} }
if (update.PausedChanged())
delegate()->OnAppUpdated(browser_context(), app_id);
} }
void LauncherAppServiceAppUpdater::OnAppRegistryCacheWillBeDestroyed( void LauncherAppServiceAppUpdater::OnAppRegistryCacheWillBeDestroyed(
......
...@@ -854,11 +854,23 @@ void ChromeLauncherController::OnAppInstalled( ...@@ -854,11 +854,23 @@ void ChromeLauncherController::OnAppInstalled(
app_icon_loader->ClearImage(app_id); app_icon_loader->ClearImage(app_id);
app_icon_loader->FetchImage(app_id); app_icon_loader->FetchImage(app_id);
} }
bool needs_update = false;
if (item.title.empty()) { if (item.title.empty()) {
needs_update = true;
item.title = LauncherControllerHelper::GetAppTitle( item.title = LauncherControllerHelper::GetAppTitle(
latest_active_profile_, app_id); latest_active_profile_, app_id);
model_->Set(index, item);
} }
ash::AppStatus app_status = LauncherControllerHelper::GetAppStatus(
latest_active_profile_, app_id);
if (app_status != item.app_status) {
needs_update = true;
item.app_status = app_status;
}
if (needs_update)
model_->Set(index, item);
} }
} }
...@@ -879,6 +891,17 @@ void ChromeLauncherController::OnAppUpdated( ...@@ -879,6 +891,17 @@ void ChromeLauncherController::OnAppUpdated(
AppIconLoader* app_icon_loader = GetAppIconLoaderForApp(app_id); AppIconLoader* app_icon_loader = GetAppIconLoaderForApp(app_id);
if (app_icon_loader) if (app_icon_loader)
app_icon_loader->FetchImage(app_id); app_icon_loader->FetchImage(app_id);
bool needs_update = false;
ash::AppStatus app_status = LauncherControllerHelper::GetAppStatus(
latest_active_profile_, app_id);
if (app_status != item.app_status) {
needs_update = true;
item.app_status = app_status;
}
if (needs_update)
model_->Set(index, item);
} }
} }
} }
...@@ -1165,6 +1188,8 @@ ash::ShelfID ChromeLauncherController::InsertAppLauncherItem( ...@@ -1165,6 +1188,8 @@ ash::ShelfID ChromeLauncherController::InsertAppLauncherItem(
item.type = shelf_item_type; item.type = shelf_item_type;
item.id = item_delegate->shelf_id(); item.id = item_delegate->shelf_id();
item.title = title; item.title = title;
item.app_status = LauncherControllerHelper::GetAppStatus(
latest_active_profile_, item_delegate->shelf_id().app_id);
// Set the delegate first to avoid constructing one in ShelfItemAdded. // Set the delegate first to avoid constructing one in ShelfItemAdded.
model_->SetShelfItemDelegate(item.id, std::move(item_delegate)); model_->SetShelfItemDelegate(item.id, std::move(item_delegate));
model_->AddAt(index, item); model_->AddAt(index, item);
...@@ -1344,6 +1369,14 @@ void ChromeLauncherController::ShelfItemAdded(int index) { ...@@ -1344,6 +1369,14 @@ void ChromeLauncherController::ShelfItemAdded(int index) {
needs_update = true; needs_update = true;
item.status = status; item.status = status;
} }
ash::AppStatus app_status = LauncherControllerHelper::GetAppStatus(
latest_active_profile_, id.app_id);
if (app_status != item.app_status) {
needs_update = true;
item.app_status = app_status;
}
if (needs_update) if (needs_update)
model_->Set(index, item); model_->Set(index, item);
} }
......
...@@ -280,6 +280,32 @@ bool IsWindowOnDesktopOfUser(aura::Window* window, ...@@ -280,6 +280,32 @@ bool IsWindowOnDesktopOfUser(aura::Window* window,
window, account_id); window, account_id);
} }
void UpdateAppRegistryCache(Profile* profile,
const std::string& app_id,
bool block,
bool pause) {
std::vector<apps::mojom::AppPtr> apps;
apps::mojom::AppPtr app = apps::mojom::App::New();
app->app_type = apps::mojom::AppType::kExtension;
app->app_id = app_id;
if (block)
app->readiness = apps::mojom::Readiness::kDisabledByPolicy;
else
app->readiness = apps::mojom::Readiness::kReady;
if (pause)
app->paused = apps::mojom::OptionalBool::kTrue;
else
app->paused = apps::mojom::OptionalBool::kFalse;
apps.push_back(std::move(app));
apps::AppServiceProxyFactory::GetForProfile(profile)
->AppRegistryCache()
.OnApps(std::move(apps));
}
} // namespace } // namespace
class ChromeLauncherControllerTest : public BrowserWithTestWindowTest { class ChromeLauncherControllerTest : public BrowserWithTestWindowTest {
...@@ -5055,6 +5081,67 @@ TEST_F(ChromeLauncherControllerWebAppTest, WebAppPinRunUnpinClose) { ...@@ -5055,6 +5081,67 @@ TEST_F(ChromeLauncherControllerWebAppTest, WebAppPinRunUnpinClose) {
EXPECT_EQ(nullptr, launcher_controller_->GetItem(ash::ShelfID(app_id))); EXPECT_EQ(nullptr, launcher_controller_->GetItem(ash::ShelfID(app_id)));
} }
// Test the app status when the paused app is blocked, un-blocked, and un-paused
TEST_F(ChromeLauncherControllerTest, VerifyAppStatusForPausedApp) {
AddExtension(extension1_.get());
// Set the app as paused
UpdateAppRegistryCache(profile(), extension1_->id(), false /* block */,
true /* pause */);
InitLauncherController();
launcher_controller_->PinAppWithID(extension1_->id());
EXPECT_EQ(2, model_->item_count());
EXPECT_EQ(ash::AppStatus::kPaused, model_->items()[1].app_status);
// Set the app as blocked
UpdateAppRegistryCache(profile(), extension1_->id(), true /* block */,
true /* pause */);
EXPECT_EQ(ash::AppStatus::kBlocked, model_->items()[1].app_status);
// Set the app as ready, but still paused;
UpdateAppRegistryCache(profile(), extension1_->id(), false /* block */,
true /* pause */);
EXPECT_EQ(ash::AppStatus::kPaused, model_->items()[1].app_status);
// Set the app as ready, and not paused;
UpdateAppRegistryCache(profile(), extension1_->id(), false /* block */,
false /* pause */);
EXPECT_EQ(ash::AppStatus::kReady, model_->items()[1].app_status);
}
// Test the app status when the blocked app is paused, un-blocked, and
// un-blocked
TEST_F(ChromeLauncherControllerTest, VerifyAppStatusForBlockedApp) {
AddExtension(extension1_.get());
// Set the app as blocked
UpdateAppRegistryCache(profile(), extension1_->id(), true /* block */,
false /* pause */);
InitLauncherController();
launcher_controller_->PinAppWithID(extension1_->id());
EXPECT_EQ(2, model_->item_count());
EXPECT_EQ(ash::AppStatus::kBlocked, model_->items()[1].app_status);
// Set the app as paused
UpdateAppRegistryCache(profile(), extension1_->id(), true /* block */,
true /* pause */);
EXPECT_EQ(ash::AppStatus::kBlocked, model_->items()[1].app_status);
// Set the app as blocked, but un-paused;
UpdateAppRegistryCache(profile(), extension1_->id(), true /* block */,
false /* pause */);
EXPECT_EQ(ash::AppStatus::kBlocked, model_->items()[1].app_status);
// Set the app as ready, and not paused;
UpdateAppRegistryCache(profile(), extension1_->id(), false /* block */,
false /* pause */);
EXPECT_EQ(ash::AppStatus::kReady, model_->items()[1].app_status);
}
INSTANTIATE_TEST_SUITE_P(All, INSTANTIATE_TEST_SUITE_P(All,
ChromeLauncherControllerPlayStoreAvailabilityTest, ChromeLauncherControllerPlayStoreAvailabilityTest,
::testing::Values(false, true)); ::testing::Values(false, true));
...@@ -189,6 +189,27 @@ base::string16 LauncherControllerHelper::GetAppTitle( ...@@ -189,6 +189,27 @@ base::string16 LauncherControllerHelper::GetAppTitle(
return base::string16(); return base::string16();
} }
// static
ash::AppStatus LauncherControllerHelper::GetAppStatus(
Profile* profile,
const std::string& app_id) {
ash::AppStatus status = ash::AppStatus::kReady;
if (!apps::AppServiceProxyFactory::IsAppServiceAvailableForProfile(profile))
return status;
apps::AppServiceProxyFactory::GetForProfile(profile)
->AppRegistryCache()
.ForOneApp(app_id, [&status](const apps::AppUpdate& update) {
if (update.Readiness() == apps::mojom::Readiness::kDisabledByPolicy)
status = ash::AppStatus::kBlocked;
else if (update.Paused() == apps::mojom::OptionalBool::kTrue)
status = ash::AppStatus::kPaused;
});
return status;
}
std::string LauncherControllerHelper::GetAppID(content::WebContents* tab) { std::string LauncherControllerHelper::GetAppID(content::WebContents* tab) {
ProfileManager* profile_manager = g_browser_process->profile_manager(); ProfileManager* profile_manager = g_browser_process->profile_manager();
if (profile_manager) { if (profile_manager) {
......
...@@ -32,6 +32,12 @@ class LauncherControllerHelper : public ExtensionEnableFlowDelegate { ...@@ -32,6 +32,12 @@ class LauncherControllerHelper : public ExtensionEnableFlowDelegate {
static base::string16 GetAppTitle(Profile* profile, static base::string16 GetAppTitle(Profile* profile,
const std::string& app_id); const std::string& app_id);
// Helper function to return the app status associated with |app_id|. if the
// app is blocked, return AppStatus::kBlocked. Otherwise, if the app is
// paused, return AppStatus::kPaused. Otherwise, return AppStatus::kReady.
static ash::AppStatus GetAppStatus(Profile* profile,
const std::string& app_id);
// Returns the app id of the specified tab, or an empty string if there is // Returns the app id of the specified tab, or an empty string if there is
// no app. All known profiles will be queried for this. // no app. All known profiles will be queried for this.
virtual std::string GetAppID(content::WebContents* tab); virtual std::string GetAppID(content::WebContents* tab);
......
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