Commit 30602821 authored by Alexey Baskakov's avatar Alexey Baskakov Committed by Commit Bot

WebApp: Remove extensions dependency from WebAppBrowserController interface.

WebAppBrowserController should be Extensions agnostic.

If we need |reason| or |source| in the future, we will add a
nested enum in WebAppBrowserController.

Bug: 953540
Change-Id: I6e277394993f474429ce8490dbd564ce9da7d87a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1570945Reviewed-by: default avatarAlan Cutter <alancutter@chromium.org>
Reviewed-by: default avatarElly Fong-Jones <ellyjones@chromium.org>
Commit-Queue: Alexey Baskakov <loyso@chromium.org>
Cr-Commit-Position: refs/heads/master@{#653469}
parent eef686db
......@@ -29,6 +29,7 @@
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_system.h"
#include "extensions/browser/management_policy.h"
#include "extensions/browser/uninstall_reason.h"
#include "extensions/common/constants.h"
#include "extensions/common/extension.h"
#include "third_party/blink/public/mojom/renderer_preferences.mojom.h"
......@@ -332,11 +333,12 @@ bool HostedAppBrowserController::CanUninstall() const {
->UserMayModifySettings(GetExtension(), nullptr);
}
void HostedAppBrowserController::Uninstall(UninstallReason reason,
UninstallSource source) {
void HostedAppBrowserController::Uninstall() {
uninstall_dialog_ = ExtensionUninstallDialog::Create(
browser()->profile(), browser()->window()->GetNativeWindow(), this);
uninstall_dialog_->ConfirmUninstall(GetExtension(), reason, source);
uninstall_dialog_->ConfirmUninstall(
GetExtension(), extensions::UNINSTALL_REASON_USER_INITIATED,
extensions::UNINSTALL_SOURCE_HOSTED_APP_MENU);
}
bool HostedAppBrowserController::IsInstalled() const {
......
......@@ -89,7 +89,7 @@ class HostedAppBrowserController : public TabStripModelObserver,
bool CanUninstall() const override;
void Uninstall(UninstallReason reason, UninstallSource source) override;
void Uninstall() override;
// Returns whether the app is installed (uninstallation may complete within
// the lifetime of HostedAppBrowserController).
......
......@@ -76,9 +76,7 @@ bool HostedAppMenuModel::IsCommandIdEnabled(int command_id) const {
void HostedAppMenuModel::ExecuteCommand(int command_id, int event_flags) {
if (command_id == kUninstallAppCommandId) {
browser()->web_app_controller()->Uninstall(
extensions::UNINSTALL_REASON_USER_INITIATED,
extensions::UNINSTALL_SOURCE_HOSTED_APP_MENU);
browser()->web_app_controller()->Uninstall();
} else {
AppMenuModel::ExecuteCommand(command_id, event_flags);
}
......
......@@ -81,8 +81,7 @@ bool WebAppBrowserController::CanUninstall() const {
return false;
}
void WebAppBrowserController::Uninstall(extensions::UninstallReason reason,
extensions::UninstallSource source) {
void WebAppBrowserController::Uninstall() {
NOTREACHED();
return;
}
......
......@@ -10,9 +10,7 @@
#include "base/macros.h"
#include "base/optional.h"
#include "base/strings/string16.h"
#include "chrome/browser/extensions/extension_uninstall_dialog.h"
#include "chrome/browser/ui/tabs/tab_strip_model_observer.h"
#include "chrome/browser/ui/web_app_browser_controller.h"
#include "content/public/browser/web_contents_observer.h"
#include "third_party/skia/include/core/SkColor.h"
......@@ -78,8 +76,7 @@ class WebAppBrowserController : public content::WebContentsObserver {
virtual bool CanUninstall() const;
virtual void Uninstall(extensions::UninstallReason reason,
extensions::UninstallSource source);
virtual void Uninstall();
// Returns whether the app is installed (uninstallation may complete within
// the lifetime of HostedAppBrowserController).
......
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