Commit 313354c4 authored by tapted's avatar tapted Committed by Commit bot

MacViews: Add a CreateChromeConstrainedWindowViewsClient stub

The MacViews "chrome" compile regressed in r301203

This adds a stub that just returns
scoped_ptr<ConstrainedWindowViewsClient>(nullptr) and fixes some
NativeWindow/NativeView inconsistencies (popup_manager->GetHostView()
returns a view).

The component is compiled on MacViews, since it will eventually be
needed. At link time for `chrome`, everything except the a pure virtual
destructor call will be culled since they are unused, but this approach
keeps component usage consistent with the test targets, which do have
the whole component.

note that components_unittests ConstrainedWindowViewsTest.* all pass on
a MacViews build except for one check against a dialog size
(constrained_window_views_unittest.cc line 142).

BUG=390755, 410499

Review URL: https://codereview.chromium.org/699553002

Cr-Commit-Position: refs/heads/master@{#302552}
parent 366b0f00
......@@ -218,6 +218,7 @@ static_library("ui") {
if (toolkit_views) {
sources += rebase_path(gypi_values.chrome_browser_ui_views_sources,
".", "//chrome")
deps += [ "//components/constrained_window" ]
if (!is_chromeos) {
sources += rebase_path(
gypi_values.chrome_browser_ui_views_non_chromeos_sources,
......@@ -228,7 +229,6 @@ static_library("ui") {
gypi_values.chrome_browser_ui_views_non_mac_sources,
".", "//chrome")
deps += [
"//components/constrained_window",
"//extensions/components/native_app_window",
]
}
......
......@@ -26,7 +26,7 @@ class ChromeConstrainedWindowViewsClient
guest_view->embedder_web_contents() : initiator_web_contents;
}
web_modal::ModalDialogHost* GetModalDialogHost(
gfx::NativeWindow parent) override {
gfx::NativeView parent) override {
// Get the browser dialog management and hosting components from |parent|.
Browser* browser = chrome::FindBrowserWithWindow(parent);
if (browser) {
......
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ui/views/chrome_constrained_window_views_client.h"
scoped_ptr<ConstrainedWindowViewsClient>
CreateChromeConstrainedWindowViewsClient() {
// Mac toolkit-views doesn't use constrained windows yet.
// TODO(tapted): Delete this file when it does.
return nullptr;
}
......@@ -2229,6 +2229,7 @@
'browser/ui/views/accessibility/accessibility_event_router_views.h',
'browser/ui/views/chrome_browser_main_extra_parts_views.cc',
'browser/ui/views/chrome_browser_main_extra_parts_views.h',
'browser/ui/views/chrome_constrained_window_views_client_mac.cc',
'browser/ui/views/chrome_views_delegate.cc',
'browser/ui/views/chrome_views_delegate.h',
'browser/ui/views/find_bar_host.cc',
......@@ -2782,6 +2783,9 @@
}],
['toolkit_views==1', {
'sources': [ '<@(chrome_browser_ui_views_sources)' ],
'dependencies': [
'<(DEPTH)/components/components.gyp:constrained_window',
],
'conditions': [
['chromeos == 0 and OS!="mac"', {
'sources': [ '<@(chrome_browser_ui_views_non_chromeos_sources)' ],
......@@ -2792,7 +2796,6 @@
['OS!="mac"', {
'sources': [ '<@(chrome_browser_ui_views_non_mac_sources)' ],
'dependencies': [
'<(DEPTH)/components/components.gyp:constrained_window',
'<(DEPTH)/extensions/components/extensions_components.gyp:native_app_window',
],
}],
......
......@@ -147,13 +147,13 @@ views::Widget* CreateWebModalDialogViews(views::WidgetDelegate* dialog,
DCHECK_EQ(ui::MODAL_TYPE_CHILD, dialog->GetModalType());
web_modal::PopupManager* popup_manager =
web_modal::PopupManager::FromWebContents(web_contents);
const gfx::NativeWindow parent = popup_manager->GetHostView();
const gfx::NativeView parent = popup_manager->GetHostView();
return views::DialogDelegate::CreateDialogWidget(dialog, NULL, parent);
}
// TODO(gbillock): Replace this with PopupManager calls.
views::Widget* CreateBrowserModalDialogViews(views::DialogDelegate* dialog,
gfx::NativeWindow parent) {
gfx::NativeView parent) {
views::Widget* widget =
views::DialogDelegate::CreateDialogWidget(dialog, NULL, parent);
if (!dialog->UseNewStyleForThisDialog())
......
......@@ -51,6 +51,6 @@ views::Widget* CreateWebModalDialogViews(views::WidgetDelegate* dialog,
// Create a widget for |dialog| that is modal to the browser window |parent|.
// This places the dialog appropriately if |parent| is a valid browser window.
views::Widget* CreateBrowserModalDialogViews(views::DialogDelegate* dialog,
gfx::NativeWindow parent);
gfx::NativeView parent);
#endif // COMPONENTS_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_VIEWS_H_
......@@ -24,9 +24,9 @@ class ConstrainedWindowViewsClient {
virtual content::WebContents* GetEmbedderWebContents(
content::WebContents* initiator_web_contents) = 0;
// Returns the modal window host for the |parent| native window.
// Returns the modal window host for the |parent| native view.
virtual web_modal::ModalDialogHost* GetModalDialogHost(
gfx::NativeWindow parent) = 0;
gfx::NativeView parent) = 0;
};
#endif // COMPONENTS_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_VIEWS_CLIENT_H_
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