Skip to content
This repository has been archived by the owner on Jan 4, 2019. It is now read-only.

Commit

Permalink
fix broken build from disabling mac_views_browser
Browse files Browse the repository at this point in the history
  • Loading branch information
bridiver authored and darkdh committed Sep 17, 2018
1 parent 6c2f235 commit ff90369
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 11 deletions.
9 changes: 0 additions & 9 deletions atom/browser/atom_browser_main_parts.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@

#if defined(OS_MACOSX)
#include <Security/Security.h>
#include "ui/base/ui_base_features.h"
#endif // defined(OS_MACOSX)

#if defined(OS_LINUX)
Expand Down Expand Up @@ -245,14 +244,6 @@ int AtomBrowserMainParts::PreCreateThreads() {
media::kUnifiedAutoplay.name,
base::FeatureList::OVERRIDE_DISABLE_FEATURE, field_trial);

#if defined(OS_MACOSX)
field_trial = feature_list->GetFieldTrial(
features::kViewsBrowserWindows);
feature_list->RegisterFieldTrialOverride(
features::kViewsBrowserWindows.name,
base::FeatureList::OVERRIDE_ENABLE_FEATURE, field_trial);
#endif

fake_browser_process_->PreCreateThreads(
*base::CommandLine::ForCurrentProcess());

Expand Down
1 change: 1 addition & 0 deletions chromium_src/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -1263,6 +1263,7 @@ source_set("tab_manager") {
"//chrome/browser/ui/tab_contents/tab_contents_iterator.h",
"//chrome/browser/ui/tab_ui_helper.cc",
"//chrome/browser/ui/tab_ui_helper.h",
"ui/base/ui_base_features_mac_views_browser.cc",
]

deps = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@

namespace safe_browsing {

#if !defined(OS_MACOSX) || BUILDFLAG(MAC_VIEWS_BROWSER)
void ShowPasswordReuseModalWarningDialog(
content::WebContents* web_contents,
ChromePasswordProtectionService* service,
ReusedPasswordType password_type,
OnWarningDone done_callback) {
std::move(done_callback).Run(PasswordProtectionService::IGNORE_WARNING);
}
#endif // !OS_MACOSX || MAC_VIEWS_BROWSER

} // namespace safe_browsing
23 changes: 23 additions & 0 deletions chromium_src/chrome/browser/ui/views_mode_controller.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright 2017 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__MAC_VIEWS_BROWSER_H_
#define CHROME_BROWSER_UI_VIEWS_MODE_CONTROLLER__MAC_VIEWS_BROWSER_H_

#include "../../../chrome/browser/ui/views_mode_controller.h"

#include "ui/base/ui_base_features.h"

#if defined(OS_MACOSX) && !BUILDFLAG(MAC_VIEWS_BROWSER)
namespace features {
UI_BASE_EXPORT extern const base::Feature kViewsBrowserWindows;
UI_BASE_EXPORT bool IsViewsBrowserCocoa();
} // namespace features

namespace views_mode_controller {
bool IsViewsBrowserCocoa();
} // namespace views_mode_controller
#endif // !BUILDFLAG(MAC_VIEWS_BROWSER)

#endif // CHROME_BROWSER_UI_VIEWS_MODE_CONTROLLER__MAC_VIEWS_BROWSER_H_
21 changes: 21 additions & 0 deletions chromium_src/ui/base/ui_base_features.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright 2017 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 UI_BASE_UI_BASE_FEATURES_MAC_VIEWS_BROWSER_H_
#define UI_BASE_UI_BASE_FEATURES_MAC_VIEWS_BROWSER_H_

#include "../../../../ui/base/ui_base_features.h"

#if defined(OS_MACOSX) && !BUILDFLAG(MAC_VIEWS_BROWSER)
namespace features {
UI_BASE_EXPORT extern const base::Feature kViewsBrowserWindows;
UI_BASE_EXPORT bool IsViewsBrowserCocoa();
} // namespace features

namespace views_mode_controller {
bool IsViewsBrowserCocoa();
} // namespace views_mode_controller
#endif // !BUILDFLAG(MAC_VIEWS_BROWSER)

#endif // UI_BASE_UI_BASE_FEATURES_MAC_VIEWS_BROWSER_H_
23 changes: 23 additions & 0 deletions chromium_src/ui/base/ui_base_features_mac_views_browser.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include "ui/base/ui_base_features.h"

#include "ui/base/ui_base_switches_util.h"

#if defined(OS_MACOSX) && !BUILDFLAG(MAC_VIEWS_BROWSER)

namespace features {

bool IsViewsBrowserCocoa() {
return false;
}

} // namespace features

namespace views_mode_controller {

bool IsViewsBrowserCocoa() {
return features::IsViewsBrowserCocoa();
}

} // namespace views_mode_controller

#endif

1 comment on commit ff90369

@bsclifton
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++

Please sign in to comment.