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

macviews: introduce polychrome

This change introduces a new command line flag, --polychrome, which causes
a mac_views_browser build to use the existing Cocoa UI instead of the new
Views browser UI. This involves:

1) Linking all of the Cocoa UI in when building the Views browser;
2) Resolving symbol and filename conflicts;
3) Introducing views_mode_controller::IsViewsBrowserCocoa();
4) Having BrowserWindowFactory choose which type of BrowserWindow to create
   based on the value of views_mode_controller::IsViewsBrowserCocoa()

This change also makes unit_tests build, but not any other targets - it is
likely that browser_tests does not build. The resulting mac_views_browser
*runs* but is unstable because of bug 804950, which is hard to address
without this CL being landed.

The current name is deliberately a bit silly, under the theory that we'll pick
a better one once the approach solidifies :)

Bug: 802257,804950
Change-Id: I30aaef7ed08dd11b66d59d5b816f57641bf2f209
Reviewed-on: https://chromium-review.googlesource.com/874730
Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-by: default avatarTrent Apted <tapted@chromium.org>
Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#533267}
parent bb2b02ac
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <vector> #include <vector>
#include "base/macros.h" #include "base/macros.h"
#include "build/build_config.h"
#include "components/infobars/core/infobar_manager.h" #include "components/infobars/core/infobar_manager.h"
#include "content/public/browser/reload_type.h" #include "content/public/browser/reload_type.h"
#include "content/public/browser/web_contents_observer.h" #include "content/public/browser/web_contents_observer.h"
...@@ -57,6 +58,11 @@ class InfoBarService : public infobars::InfoBarManager, ...@@ -57,6 +58,11 @@ class InfoBarService : public infobars::InfoBarManager,
std::unique_ptr<ConfirmInfoBarDelegate> delegate) override; std::unique_ptr<ConfirmInfoBarDelegate> delegate) override;
void OpenURL(const GURL& url, WindowOpenDisposition disposition) override; void OpenURL(const GURL& url, WindowOpenDisposition disposition) override;
#if defined(OS_MACOSX)
std::unique_ptr<infobars::InfoBar> CreateConfirmInfoBarCocoa(
std::unique_ptr<ConfirmInfoBarDelegate> delegate);
#endif
private: private:
friend class content::WebContentsUserData<InfoBarService>; friend class content::WebContentsUserData<InfoBarService>;
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <memory> #include <memory>
#include "base/callback_forward.h" #include "base/callback_forward.h"
#include "build/build_config.h"
#include "net/ssl/client_cert_identity.h" #include "net/ssl/client_cert_identity.h"
namespace content { namespace content {
...@@ -32,6 +33,14 @@ void ShowSSLClientCertificateSelector( ...@@ -32,6 +33,14 @@ void ShowSSLClientCertificateSelector(
net::ClientCertIdentityList client_certs, net::ClientCertIdentityList client_certs,
std::unique_ptr<content::ClientCertificateDelegate> delegate); std::unique_ptr<content::ClientCertificateDelegate> delegate);
#if defined(OS_MACOSX)
void ShowSSLClientCertificateSelectorCocoa(
content::WebContents* contents,
net::SSLCertRequestInfo* cert_request_info,
net::ClientCertIdentityList client_certs,
std::unique_ptr<content::ClientCertificateDelegate> delegate);
#endif
} // namespace chrome } // namespace chrome
#endif // CHROME_BROWSER_SSL_SSL_CLIENT_CERTIFICATE_SELECTOR_H_ #endif // CHROME_BROWSER_SSL_SSL_CLIENT_CERTIFICATE_SELECTOR_H_
...@@ -42,7 +42,7 @@ split_static_library("ui") { ...@@ -42,7 +42,7 @@ split_static_library("ui") {
# variable temporarily to ease the work on https://crbug.com/804950 and # variable temporarily to ease the work on https://crbug.com/804950 and
# https://crbug.com/802257. # https://crbug.com/802257.
# TODO(ellyjones): Remove this variable once 804950 and 802257 are fixed. # TODO(ellyjones): Remove this variable once 804950 and 802257 are fixed.
if (is_mac && !mac_views_browser) { if (is_mac) {
cocoa_browser_sources = [ cocoa_browser_sources = [
"cocoa/animatable_image.h", "cocoa/animatable_image.h",
"cocoa/animatable_image.mm", "cocoa/animatable_image.mm",
...@@ -2437,6 +2437,9 @@ split_static_library("ui") { ...@@ -2437,6 +2437,9 @@ split_static_library("ui") {
"webui/settings_utils_mac.mm", "webui/settings_utils_mac.mm",
"window_sizer/window_sizer_mac.mm", "window_sizer/window_sizer_mac.mm",
] ]
sources += cocoa_browser_sources
deps += [ deps += [
"//chrome/app/nibs:localizer_table", "//chrome/app/nibs:localizer_table",
"//chrome/browser/apps/app_shim", "//chrome/browser/apps/app_shim",
...@@ -2472,8 +2475,49 @@ split_static_library("ui") { ...@@ -2472,8 +2475,49 @@ split_static_library("ui") {
"views/tabs/window_finder_mac.mm", "views/tabs/window_finder_mac.mm",
] ]
deps += [ "//extensions/components/native_app_window" ] deps += [ "//extensions/components/native_app_window" ]
} else {
sources += cocoa_browser_sources # Truly cocoa-browser-specific sources. These are secondary UI pieces that
# are obsolete before mac_views_browser will ever ship, so they aren't
# linked in at all.
sources -= [
"cocoa/autofill/card_unmask_prompt_view_views.mm",
"cocoa/bookmarks/bookmark_all_tabs_controller.h",
"cocoa/bookmarks/bookmark_all_tabs_controller.mm",
"cocoa/bookmarks/bookmark_editor_base_controller.h",
"cocoa/bookmarks/bookmark_editor_base_controller.mm",
"cocoa/bookmarks/bookmark_editor_controller.h",
"cocoa/bookmarks/bookmark_editor_controller.mm",
"cocoa/confirm_bubble_views_mac.mm",
"cocoa/download/download_danger_prompt_impl.cc",
"cocoa/extensions/chooser_dialog_cocoa.h",
"cocoa/extensions/chooser_dialog_cocoa.mm",
"cocoa/extensions/chooser_dialog_cocoa_controller.h",
"cocoa/extensions/chooser_dialog_cocoa_controller.mm",
"cocoa/extensions/extension_installed_bubble_controller.h",
"cocoa/extensions/extension_installed_bubble_controller.mm",
"cocoa/extensions/extension_uninstall_dialog_cocoa.mm",
"cocoa/extensions/media_galleries_dialog_cocoa.h",
"cocoa/extensions/media_galleries_dialog_cocoa.mm",
"cocoa/global_error_bubble_controller.h",
"cocoa/global_error_bubble_controller.mm",
"cocoa/login_handler_cocoa.h",
"cocoa/login_handler_cocoa.mm",
"cocoa/page_info/page_info_bubble_controller.h",
"cocoa/page_info/page_info_bubble_controller.mm",
"cocoa/password_reuse_warning_dialog_cocoa.h",
"cocoa/password_reuse_warning_dialog_cocoa.mm",
"cocoa/password_reuse_warning_view_controller.h",
"cocoa/password_reuse_warning_view_controller.mm",
"cocoa/passwords/password_prompt_view_bridge.h",
"cocoa/passwords/password_prompt_view_bridge.mm",
"cocoa/permission_bubble/chooser_bubble_ui_views_mac.mm",
"cocoa/profiles/user_manager_mac.h",
"cocoa/profiles/user_manager_mac.mm",
"cocoa/session_crashed_bubble.mm",
"cocoa/simple_message_box_bridge_views.mm",
"cocoa/simple_message_box_cocoa.h",
"cocoa/simple_message_box_cocoa.mm",
]
} }
} else { # non-Mac. } else { # non-Mac.
sources += [ "web_contents_sizer.cc" ] sources += [ "web_contents_sizer.cc" ]
...@@ -3166,6 +3210,8 @@ split_static_library("ui") { ...@@ -3166,6 +3210,8 @@ split_static_library("ui") {
"views/translate/translate_icon_view.h", "views/translate/translate_icon_view.h",
"views/webshare/webshare_target_picker_view.cc", "views/webshare/webshare_target_picker_view.cc",
"views/webshare/webshare_target_picker_view.h", "views/webshare/webshare_target_picker_view.h",
"views_mode_controller.cc",
"views_mode_controller.h",
] ]
if (is_mac) { if (is_mac) {
......
...@@ -371,6 +371,13 @@ class BrowserWindow : public ui::BaseWindow { ...@@ -371,6 +371,13 @@ class BrowserWindow : public ui::BaseWindow {
friend class BrowserCloseManager; friend class BrowserCloseManager;
friend class BrowserView; friend class BrowserView;
virtual void DestroyBrowser() = 0; virtual void DestroyBrowser() = 0;
#if defined(OS_MACOSX)
// Creates a Cocoa browser window, in browser builds where both Views and
// Cocoa browsers windows are present.
static BrowserWindow* CreateBrowserWindowCocoa(Browser* browser,
bool user_gesture);
#endif
}; };
#endif // CHROME_BROWSER_UI_BROWSER_WINDOW_H_ #endif // CHROME_BROWSER_UI_BROWSER_WINDOW_H_
...@@ -2,16 +2,27 @@ ...@@ -2,16 +2,27 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "build/buildflag.h"
#include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/cocoa/browser_window_controller.h" #include "chrome/browser/ui/cocoa/browser_window_controller.h"
#include "ui/base/ui_features.h"
// Create the controller for the Browser, which handles loading the browser // Create the controller for the Browser, which handles loading the browser
// window from the nib. The controller takes ownership of |browser|. // window from the nib. The controller takes ownership of |browser|.
// static // static
BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser, BrowserWindow* BrowserWindow::CreateBrowserWindowCocoa(Browser* browser,
bool user_gesture) { bool user_gesture) {
BrowserWindowController* controller = BrowserWindowController* controller =
[[BrowserWindowController alloc] initWithBrowser:browser]; [[BrowserWindowController alloc] initWithBrowser:browser];
return [controller browserWindow]; return [controller browserWindow];
} }
#if !BUILDFLAG(MAC_VIEWS_BROWSER)
// Cocoa-only builds always use Cocoa browser windows.
// static
BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser,
bool user_gesture) {
return CreateBrowserWindowCocoa(browser, user_gesture);
}
#endif
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include "base/logging.h" #include "base/logging.h"
#include "base/strings/sys_string_conversions.h" #include "base/strings/sys_string_conversions.h"
#include "build/buildflag.h"
#include "chrome/browser/infobars/infobar_service.h" #include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/ui/cocoa/chrome_style.h" #include "chrome/browser/ui/cocoa/chrome_style.h"
#include "chrome/browser/ui/cocoa/infobars/infobar_cocoa.h" #include "chrome/browser/ui/cocoa/infobars/infobar_cocoa.h"
...@@ -16,6 +17,7 @@ ...@@ -16,6 +17,7 @@
#include "third_party/google_toolbox_for_mac/src/AppKit/GTMUILocalizerAndLayoutTweaker.h" #include "third_party/google_toolbox_for_mac/src/AppKit/GTMUILocalizerAndLayoutTweaker.h"
#import "ui/base/cocoa/cocoa_base_utils.h" #import "ui/base/cocoa/cocoa_base_utils.h"
#import "ui/base/cocoa/controls/hyperlink_text_view.h" #import "ui/base/cocoa/controls/hyperlink_text_view.h"
#include "ui/base/ui_features.h"
#include "ui/base/window_open_disposition.h" #include "ui/base/window_open_disposition.h"
@implementation ConfirmInfoBarController @implementation ConfirmInfoBarController
...@@ -150,7 +152,7 @@ ...@@ -150,7 +152,7 @@
@end @end
std::unique_ptr<infobars::InfoBar> InfoBarService::CreateConfirmInfoBar( std::unique_ptr<infobars::InfoBar> InfoBarService::CreateConfirmInfoBarCocoa(
std::unique_ptr<ConfirmInfoBarDelegate> delegate) { std::unique_ptr<ConfirmInfoBarDelegate> delegate) {
std::unique_ptr<InfoBarCocoa> infobar(new InfoBarCocoa(std::move(delegate))); std::unique_ptr<InfoBarCocoa> infobar(new InfoBarCocoa(std::move(delegate)));
base::scoped_nsobject<ConfirmInfoBarController> controller( base::scoped_nsobject<ConfirmInfoBarController> controller(
...@@ -158,3 +160,10 @@ std::unique_ptr<infobars::InfoBar> InfoBarService::CreateConfirmInfoBar( ...@@ -158,3 +160,10 @@ std::unique_ptr<infobars::InfoBar> InfoBarService::CreateConfirmInfoBar(
infobar->set_controller(controller); infobar->set_controller(controller);
return std::move(infobar); return std::move(infobar);
} }
#if !BUILDFLAG(MAC_VIEWS_BROWSER)
std::unique_ptr<infobars::InfoBar> InfoBarService::CreateConfirmInfoBar(
std::unique_ptr<ConfirmInfoBarDelegate> delegate) {
return CreateConfirmInfoBarCocoa(std::move(delegate));
}
#endif
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include "base/strings/sys_string_conversions.h" #include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/threading/thread_task_runner_handle.h" #include "base/threading/thread_task_runner_handle.h"
#include "build/buildflag.h"
#include "chrome/browser/ssl/ssl_client_auth_observer.h" #include "chrome/browser/ssl/ssl_client_auth_observer.h"
#import "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h" #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h"
#include "chrome/grit/generated_resources.h" #include "chrome/grit/generated_resources.h"
...@@ -30,6 +31,7 @@ ...@@ -30,6 +31,7 @@
#include "net/ssl/ssl_platform_key_mac.h" #include "net/ssl/ssl_platform_key_mac.h"
#include "ui/base/cocoa/window_size_constants.h" #include "ui/base/cocoa/window_size_constants.h"
#include "ui/base/l10n/l10n_util_mac.h" #include "ui/base/l10n/l10n_util_mac.h"
#include "ui/base/ui_features.h"
using content::BrowserThread; using content::BrowserThread;
...@@ -79,7 +81,7 @@ class SSLClientAuthObserverCocoaBridge : public SSLClientAuthObserver, ...@@ -79,7 +81,7 @@ class SSLClientAuthObserverCocoaBridge : public SSLClientAuthObserver,
namespace chrome { namespace chrome {
void ShowSSLClientCertificateSelector( void ShowSSLClientCertificateSelectorCocoa(
content::WebContents* contents, content::WebContents* contents,
net::SSLCertRequestInfo* cert_request_info, net::SSLCertRequestInfo* cert_request_info,
net::ClientCertIdentityList client_certs, net::ClientCertIdentityList client_certs,
...@@ -106,6 +108,18 @@ void ShowSSLClientCertificateSelector( ...@@ -106,6 +108,18 @@ void ShowSSLClientCertificateSelector(
[selector displayForWebContents:contents clientCerts:std::move(client_certs)]; [selector displayForWebContents:contents clientCerts:std::move(client_certs)];
} }
#if !BUILDFLAG(MAC_VIEWS_BROWSER)
void ShowSSLClientCertificateSelector(
content::WebContents* contents,
net::SSLCertRequestInfo* cert_request_info,
net::ClientCertIdentityList client_certs,
std::unique_ptr<content::ClientCertificateDelegate> delegate) {
return ShowSSLClientCertificateSelectorCocoa(contents, cert_request_info,
std::move(client_certs),
std::move(delegate));
}
#endif
} // namespace chrome } // namespace chrome
namespace { namespace {
......
...@@ -61,10 +61,3 @@ class CertificateAnchorWidgetDelegate : public views::WidgetDelegateView { ...@@ -61,10 +61,3 @@ class CertificateAnchorWidgetDelegate : public views::WidgetDelegateView {
} }
@end @end
void ShowCertificateViewer(content::WebContents* web_contents,
gfx::NativeWindow parent,
net::X509Certificate* cert) {
// Shows a new widget, which owns the delegate.
new CertificateAnchorWidgetDelegate(web_contents, cert);
}
...@@ -2,9 +2,11 @@ ...@@ -2,9 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "build/build_config.h"
#include "chrome/browser/ui/views/frame/browser_frame.h" #include "chrome/browser/ui/views/frame/browser_frame.h"
#include "chrome/browser/ui/views/frame/browser_view.h" #include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/frame/native_browser_frame_factory.h" #include "chrome/browser/ui/views/frame/native_browser_frame_factory.h"
#include "chrome/browser/ui/views_mode_controller.h"
#include "chrome/grit/chromium_strings.h" #include "chrome/grit/chromium_strings.h"
#if defined(USE_AURA) #if defined(USE_AURA)
#include "ui/aura/client/aura_constants.h" #include "ui/aura/client/aura_constants.h"
...@@ -16,6 +18,10 @@ ...@@ -16,6 +18,10 @@
// static // static
BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser, BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser,
bool user_gesture) { bool user_gesture) {
#if defined(OS_MACOSX)
if (views_mode_controller::IsViewsBrowserCocoa())
return BrowserWindow::CreateBrowserWindowCocoa(browser, user_gesture);
#endif
// Create the view and the frame. The frame will attach itself via the view // Create the view and the frame. The frame will attach itself via the view
// so we don't need to do anything with the pointer. // so we don't need to do anything with the pointer.
BrowserView* view = new BrowserView(); BrowserView* view = new BrowserView();
......
...@@ -8,9 +8,11 @@ ...@@ -8,9 +8,11 @@
#include <utility> #include <utility>
#include "base/logging.h" #include "base/logging.h"
#include "build/build_config.h"
#include "chrome/browser/infobars/infobar_service.h" #include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/ui/views/elevation_icon_setter.h" #include "chrome/browser/ui/views/elevation_icon_setter.h"
#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" #include "chrome/browser/ui/views/harmony/chrome_layout_provider.h"
#include "chrome/browser/ui/views_mode_controller.h"
#include "ui/base/material_design/material_design_controller.h" #include "ui/base/material_design/material_design_controller.h"
#include "ui/base/window_open_disposition.h" #include "ui/base/window_open_disposition.h"
#include "ui/native_theme/native_theme.h" #include "ui/native_theme/native_theme.h"
...@@ -24,6 +26,10 @@ ...@@ -24,6 +26,10 @@
std::unique_ptr<infobars::InfoBar> InfoBarService::CreateConfirmInfoBar( std::unique_ptr<infobars::InfoBar> InfoBarService::CreateConfirmInfoBar(
std::unique_ptr<ConfirmInfoBarDelegate> delegate) { std::unique_ptr<ConfirmInfoBarDelegate> delegate) {
#if defined(OS_MACOSX)
if (views_mode_controller::IsViewsBrowserCocoa())
return InfoBarService::CreateConfirmInfoBarCocoa(std::move(delegate));
#endif
return std::make_unique<ConfirmInfoBar>(std::move(delegate)); return std::make_unique<ConfirmInfoBar>(std::move(delegate));
} }
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include "build/build_config.h" #include "build/build_config.h"
#include "chrome/browser/ssl/ssl_client_auth_observer.h" #include "chrome/browser/ssl/ssl_client_auth_observer.h"
#include "chrome/browser/ui/browser_dialogs.h" #include "chrome/browser/ui/browser_dialogs.h"
#include "chrome/browser/ui/views_mode_controller.h"
#include "chrome/grit/generated_resources.h" #include "chrome/grit/generated_resources.h"
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
#include "content/public/browser/client_certificate_delegate.h" #include "content/public/browser/client_certificate_delegate.h"
...@@ -140,6 +141,15 @@ void ShowSSLClientCertificateSelector( ...@@ -140,6 +141,15 @@ void ShowSSLClientCertificateSelector(
net::SSLCertRequestInfo* cert_request_info, net::SSLCertRequestInfo* cert_request_info,
net::ClientCertIdentityList client_certs, net::ClientCertIdentityList client_certs,
std::unique_ptr<content::ClientCertificateDelegate> delegate) { std::unique_ptr<content::ClientCertificateDelegate> delegate) {
#if defined(OS_MACOSX)
// TODO(ellyjones): Always use the Cocoa cert selector, even in Views builds.
// See also https://crbug.com/804950.
if (views_mode_controller::IsViewsBrowserCocoa()) {
return ShowSSLClientCertificateSelectorCocoa(contents, cert_request_info,
std::move(client_certs),
std::move(delegate));
}
#endif
DCHECK_CURRENTLY_ON(content::BrowserThread::UI); DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
// Not all WebContentses can show modal dialogs. // Not all WebContentses can show modal dialogs.
......
// Copyright 2018 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_mode_controller.h"
#include "chrome/common/chrome_features.h"
#if defined(OS_MACOSX) && BUILDFLAG(MAC_VIEWS_BROWSER)
namespace views_mode_controller {
bool IsViewsBrowserCocoa() {
return !base::FeatureList::IsEnabled(features::kViewsBrowserWindows);
}
} // namespace views_mode_controller
#endif
// Copyright 2018 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.
#ifndef CHROME_BROWSER_UI_VIEWS_MODE_CONTROLLER_H_
#define CHROME_BROWSER_UI_VIEWS_MODE_CONTROLLER_H_
#include "build/build_config.h"
#include "build/buildflag.h"
#include "ui/base/ui_features.h"
#if defined(OS_MACOSX) && BUILDFLAG(MAC_VIEWS_BROWSER)
namespace views_mode_controller {
// Returns whether a Views-capable browser build should use the Cocoa browser
// UI.
bool IsViewsBrowserCocoa();
} // namespace views_mode_controller
#endif
#endif // CHROME_BROWSER_UI_VIEWS_MODE_CONTROLLER_H_
...@@ -37,6 +37,13 @@ const base::Feature kShow10_9ObsoleteInfobar{"Show109ObsoleteInfobar", ...@@ -37,6 +37,13 @@ const base::Feature kShow10_9ObsoleteInfobar{"Show109ObsoleteInfobar",
const base::Feature kFullscreenToolbarReveal{"FullscreenToolbarReveal", const base::Feature kFullscreenToolbarReveal{"FullscreenToolbarReveal",
base::FEATURE_DISABLED_BY_DEFAULT}; base::FEATURE_DISABLED_BY_DEFAULT};
#if BUILDFLAG(MAC_VIEWS_BROWSER)
// Causes Views browser builds to use Views browser windows by default rather
// than Cocoa browser windows.
const base::Feature kViewsBrowserWindows{"ViewsBrowserWindows",
base::FEATURE_DISABLED_BY_DEFAULT};
#endif
// Use toolkit-views for profile chooser menu. // Use toolkit-views for profile chooser menu.
const base::Feature kViewsProfileChooser{"ViewsProfileChooser", const base::Feature kViewsProfileChooser{"ViewsProfileChooser",
base::FEATURE_ENABLED_BY_DEFAULT}; base::FEATURE_ENABLED_BY_DEFAULT};
......
...@@ -10,11 +10,13 @@ ...@@ -10,11 +10,13 @@
#include "base/feature_list.h" #include "base/feature_list.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "build/buildflag.h"
#include "chrome/common/features.h" #include "chrome/common/features.h"
#include "device/vr/features/features.h" #include "device/vr/features/features.h"
#include "extensions/features/features.h" #include "extensions/features/features.h"
#include "ppapi/features/features.h" #include "ppapi/features/features.h"
#include "printing/features/features.h" #include "printing/features/features.h"
#include "ui/base/ui_features.h"
namespace features { namespace features {
...@@ -30,6 +32,9 @@ extern const base::Feature kAllowAutoplayUnmutedInWebappManifestScope; ...@@ -30,6 +32,9 @@ extern const base::Feature kAllowAutoplayUnmutedInWebappManifestScope;
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
extern const base::Feature kAppleScriptExecuteJavaScriptMenuItem; extern const base::Feature kAppleScriptExecuteJavaScriptMenuItem;
extern const base::Feature kShow10_9ObsoleteInfobar; extern const base::Feature kShow10_9ObsoleteInfobar;
#if BUILDFLAG(MAC_VIEWS_BROWSER)
extern const base::Feature kViewsBrowserWindows;
#endif
extern const base::Feature kViewsProfileChooser; extern const base::Feature kViewsProfileChooser;
extern const base::Feature kViewsTaskManager; extern const base::Feature kViewsTaskManager;
#endif // defined(OS_MACOSX) #endif // defined(OS_MACOSX)
......
...@@ -3821,7 +3821,10 @@ test("unit_tests") { ...@@ -3821,7 +3821,10 @@ test("unit_tests") {
sources += sources +=
[ "../browser/ui/cocoa/applescript/apple_event_util_unittest.mm" ] [ "../browser/ui/cocoa/applescript/apple_event_util_unittest.mm" ]
if (!mac_views_browser) { # TODO(ellyjones): remove this needless if (true). These files are
# test sources for the cocoa code; this block should be moved back inline at
# the place this variable is used below.
if (true) {
cocoa_test_sources = [ cocoa_test_sources = [
"../browser/ui/cocoa/accelerators_cocoa_unittest.mm", "../browser/ui/cocoa/accelerators_cocoa_unittest.mm",
"../browser/ui/cocoa/animatable_image_unittest.mm", "../browser/ui/cocoa/animatable_image_unittest.mm",
...@@ -4005,10 +4008,18 @@ test("unit_tests") { ...@@ -4005,10 +4008,18 @@ test("unit_tests") {
] ]
} }
sources += cocoa_test_sources
if (mac_views_browser) { if (mac_views_browser) {
# TODO(tapted): Add chrome_unit_tests_views_non_mac_sources. sources -= [
} else { "../browser/ui/cocoa/bookmarks/bookmark_all_tabs_controller_unittest.mm",
sources += cocoa_test_sources "../browser/ui/cocoa/bookmarks/bookmark_editor_base_controller_unittest.mm",
"../browser/ui/cocoa/bookmarks/bookmark_editor_controller_unittest.mm",
"../browser/ui/cocoa/extensions/chooser_dialog_cocoa_controller_unittest.mm",
"../browser/ui/cocoa/extensions/extension_installed_bubble_controller_unittest.mm",
"../browser/ui/cocoa/extensions/media_galleries_dialog_cocoa_unittest.mm",
"../browser/ui/cocoa/page_info/page_info_bubble_controller_unittest.mm",
]
} }
# TODO(mark): We really want this for all non-static library targets, # TODO(mark): We really want this for all non-static library targets,
......
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