Commit db72f518 authored by Elly Fong-Jones's avatar Elly Fong-Jones Committed by Commit Bot

views: remove some browser dialogs abstractions

These were added during the MacViews port to support Mac code like this:

  if (IsUsingViewsDialogs())
    ShowThingViews();
  else
    ShowThingCocoa();

without the Mac code directly linking the Views code, but that build config is
now long dead.

A followup CL will also remove CreateLoginHandlerViews, but that will be more
involved.

Bug: None
Change-Id: Ifef442e159317763bd6f6f8e652e56495cc195f5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1752066
Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
Auto-Submit: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-by: default avatarRouslan Solomakhin <rouslan@chromium.org>
Reviewed-by: default avatarRobert Liao <robliao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#686497}
parent 879fc233
include_rules = [
"+third_party/libaddressinput",
]
specific_include_rules = {
"chrome_payment_request_delegate\.cc": [
# This delegate is hardcoded to construct a Views dialog right now, since it
# is only used on Views platforms.
"+chrome/browser/ui/views",
],
}
......@@ -18,9 +18,9 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/signin/identity_manager_factory.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_dialogs.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/views/payments/payment_request_dialog_view.h"
#include "chrome/browser/web_data_service_factory.h"
#include "components/autofill/core/browser/address_normalizer_impl.h"
#include "components/autofill/core/browser/geo/region_data_loader_impl.h"
......@@ -64,7 +64,7 @@ ChromePaymentRequestDelegate::~ChromePaymentRequestDelegate() {}
void ChromePaymentRequestDelegate::ShowDialog(PaymentRequest* request) {
DCHECK_EQ(nullptr, shown_dialog_);
shown_dialog_ = chrome::CreatePaymentRequestDialog(request);
shown_dialog_ = new payments::PaymentRequestDialogView(request, nullptr);
shown_dialog_->ShowDialog();
}
......
......@@ -43,11 +43,6 @@ namespace net {
class AuthChallengeInfo;
}
namespace payments {
class PaymentRequest;
class PaymentRequestDialog;
} // namespace payments
namespace safe_browsing {
class ChromeCleanerController;
class ChromeCleanerDialogController;
......@@ -139,9 +134,6 @@ void SetAutoAcceptPWAInstallConfirmationForTesting(bool auto_accept);
task_manager::TaskManagerTableModel* ShowTaskManagerViews(Browser* browser);
void HideTaskManagerViews();
// Show the Views "Chrome Update" dialog.
void ShowUpdateChromeDialogViews(gfx::NativeWindow parent);
#endif // OS_MACOSX
#if defined(TOOLKIT_VIEWS)
......@@ -152,15 +144,6 @@ std::unique_ptr<LoginHandler> CreateLoginHandlerViews(
content::WebContents* web_contents,
LoginAuthRequiredCallback auth_required_callback);
// Shows the toolkit-views based BookmarkEditor.
void ShowBookmarkEditorViews(gfx::NativeWindow parent_window,
Profile* profile,
const BookmarkEditor::EditDetails& details,
BookmarkEditor::Configuration configuration);
payments::PaymentRequestDialog* CreatePaymentRequestDialog(
payments::PaymentRequest* request);
#endif // TOOLKIT_VIEWS
// Values used in the Dialog.Creation UMA metric. Each value represents a
......
......@@ -639,17 +639,3 @@ void BookmarkEditorView::EditorTreeModel::SetTitle(
if (!title.empty())
ui::TreeNodeModel<EditorNode>::SetTitle(node, title);
}
namespace chrome {
void ShowBookmarkEditorViews(gfx::NativeWindow parent_window,
Profile* profile,
const BookmarkEditor::EditDetails& details,
BookmarkEditor::Configuration configuration) {
DCHECK(profile);
BookmarkEditorView* editor = new BookmarkEditorView(
profile, details.parent_node, details, configuration);
editor->Show(parent_window);
}
} // namespace chrome
......@@ -12,6 +12,7 @@
#include "chrome/browser/extensions/chrome_extension_chooser_dialog.h"
#include "chrome/browser/extensions/extension_install_prompt.h"
#include "chrome/browser/ui/login/login_handler.h"
#include "chrome/browser/ui/views/bookmarks/bookmark_editor_view.h"
#include "chrome/browser/ui/views/task_manager_view.h"
// This file provides definitions of desktop browser dialog-creation methods for
......@@ -30,8 +31,10 @@ void BookmarkEditor::Show(gfx::NativeWindow parent_window,
Profile* profile,
const EditDetails& details,
Configuration configuration) {
chrome::ShowBookmarkEditorViews(parent_window, profile, details,
configuration);
auto editor = std::make_unique<BookmarkEditorView>(
profile, details.parent_node, details, configuration);
editor->Show(parent_window);
editor.release(); // BookmarkEditorView is self-deleting
}
void ChromeDevicePermissionsPrompt::ShowDialog() {
......
......@@ -37,16 +37,6 @@
#include "ui/views/layout/fill_layout.h"
#include "ui/views/layout/grid_layout.h"
namespace chrome {
payments::PaymentRequestDialog* CreatePaymentRequestDialog(
payments::PaymentRequest* request) {
return new payments::PaymentRequestDialogView(request,
/* no observer */ nullptr);
}
} // namespace chrome
namespace payments {
namespace {
......
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