Commit d1f8824d authored by Mila Green's avatar Mila Green Committed by Commit Bot

Updater: Refactor: Merge the Mac and Win versions of app_install.h

Bug: 1111498
Change-Id: I7e1919657e5760354da87f5bf95e2b55596cc30b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2329945Reviewed-by: default avatarSorin Jianu <sorin@chromium.org>
Commit-Queue: Mila Green <milagreen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#793397}
parent 3511c7b9
...@@ -218,6 +218,50 @@ if (is_win || is_mac) { ...@@ -218,6 +218,50 @@ if (is_win || is_mac) {
output = "$target_gen_dir/updater_version.h" output = "$target_gen_dir/updater_version.h"
} }
# This build target is defined to minimize the impact of -Wno-missing-braces
# compiler switch. In the future it might be possible to isolate the
# dependency of ATL in the UI so ATL headers are not visible in the
# compilation units outside the UI itself.
# TODO(sorin): https://crbug.com/1014311
source_set("app_install") {
sources = [ "app/app_install.h" ]
if (is_mac) {
sources += [ "mac/setup/app_install.cc" ]
}
if (is_win) {
sources += [ "win/app_install.cc" ]
}
deps = [
":lib",
"//base",
"//chrome/updater:base",
"//chrome/updater:version_header",
]
if (is_mac) {
deps += [ "//chrome/updater/mac:updater_setup_sources" ]
}
if (is_win) {
deps += [
"//base:i18n",
"//chrome/updater/win:install_progress_observer",
"//chrome/updater/win:lib",
"//chrome/updater/win/ui",
"//components/prefs",
"//components/update_client",
]
}
allow_circular_includes_from = [ ":lib" ]
if (is_win) {
cflags_cc = [ "-Wno-missing-braces" ]
}
}
test("updater_tests") { test("updater_tests") {
testonly = true testonly = true
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// 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.
#ifndef CHROME_UPDATER_MAC_SETUP_APP_INSTALL_H_ #ifndef CHROME_UPDATER_APP_APP_INSTALL_H_
#define CHROME_UPDATER_MAC_SETUP_APP_INSTALL_H_ #define CHROME_UPDATER_APP_APP_INSTALL_H_
#include "base/memory/scoped_refptr.h" #include "base/memory/scoped_refptr.h"
...@@ -15,4 +15,4 @@ scoped_refptr<App> MakeAppInstall(); ...@@ -15,4 +15,4 @@ scoped_refptr<App> MakeAppInstall();
} // namespace updater } // namespace updater
#endif // CHROME_UPDATER_MAC_SETUP_APP_INSTALL_H_ #endif // CHROME_UPDATER_APP_APP_INSTALL_H_
...@@ -9,10 +9,10 @@ import("//chrome/updater/branding.gni") ...@@ -9,10 +9,10 @@ import("//chrome/updater/branding.gni")
group("mac") { group("mac") {
deps = [ deps = [
":app_install",
":browser_install_script", ":browser_install_script",
":updater_bundle", ":updater_bundle",
":updater_install_script", ":updater_install_script",
"//chrome/updater:app_install",
"//chrome/updater/mac/signing", "//chrome/updater/mac/signing",
] ]
} }
...@@ -59,9 +59,9 @@ mac_app_bundle("updater_bundle") { ...@@ -59,9 +59,9 @@ mac_app_bundle("updater_bundle") {
sources = [ "main.cc" ] sources = [ "main.cc" ]
deps = [ deps = [
":app_install",
":network_fetcher_sources", ":network_fetcher_sources",
":updater_setup_sources", ":updater_setup_sources",
"//chrome/updater:app_install",
"//chrome/updater:lib", "//chrome/updater:lib",
] ]
} }
...@@ -106,23 +106,6 @@ source_set("updater_setup_sources") { ...@@ -106,23 +106,6 @@ source_set("updater_setup_sources") {
] ]
} }
source_set("app_install") {
sources = [
"setup/app_install.cc",
"setup/app_install.h",
]
deps = [
":updater_setup_sources",
"//base",
"//chrome/updater:base",
"//chrome/updater:lib",
"//chrome/updater:version_header",
]
allow_circular_includes_from = [ "//chrome/updater:lib" ]
}
action("updater_install_script") { action("updater_install_script") {
script = "embed_variables.py" script = "embed_variables.py"
...@@ -181,12 +164,12 @@ source_set("updater_setup_tests") { ...@@ -181,12 +164,12 @@ source_set("updater_setup_tests") {
data = [ "//chrome/test/data/updater/updater_setup_test_dmg.dmg" ] data = [ "//chrome/test/data/updater/updater_setup_test_dmg.dmg" ]
deps = [ deps = [
":app_install",
":installer_sources", ":installer_sources",
":updater_setup_sources", ":updater_setup_sources",
"//base", "//base",
"//base/test:test_support", "//base/test:test_support",
"//chrome/common:constants", "//chrome/common:constants",
"//chrome/updater:app_install",
"//testing/gtest", "//testing/gtest",
] ]
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// 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 "chrome/updater/mac/setup/app_install.h" #include "chrome/updater/app/app_install.h"
#include "base/bind.h" #include "base/bind.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include "base/task/single_thread_task_executor.h" #include "base/task/single_thread_task_executor.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "chrome/updater/app/app.h" #include "chrome/updater/app/app.h"
#include "chrome/updater/app/app_install.h"
#include "chrome/updater/app/app_uninstall.h" #include "chrome/updater/app/app_uninstall.h"
#include "chrome/updater/app/app_wake.h" #include "chrome/updater/app/app_wake.h"
#include "chrome/updater/configurator.h" #include "chrome/updater/configurator.h"
...@@ -25,12 +26,10 @@ ...@@ -25,12 +26,10 @@
#if defined(OS_WIN) #if defined(OS_WIN)
#include "chrome/updater/app/server/win/server.h" #include "chrome/updater/app/server/win/server.h"
#include "chrome/updater/app/server/win/service_main.h" #include "chrome/updater/app/server/win/service_main.h"
#include "chrome/updater/win/app_install.h"
#endif #endif
#if defined(OS_MAC) #if defined(OS_MAC)
#include "chrome/updater/app/server/mac/server.h" #include "chrome/updater/app/server/mac/server.h"
#include "chrome/updater/mac/setup/app_install.h"
#endif #endif
// Instructions For Windows. // Instructions For Windows.
......
...@@ -25,10 +25,10 @@ executable("updater") { ...@@ -25,10 +25,10 @@ executable("updater") {
configs += [ "//build/config/win:windowed" ] configs += [ "//build/config/win:windowed" ]
deps = [ deps = [
":app_install",
":lib", ":lib",
":version_resources", ":version_resources",
"//build/win:default_exe_manifest", "//build/win:default_exe_manifest",
"//chrome/updater:app_install",
"//chrome/updater:lib", "//chrome/updater:lib",
"//chrome/updater/win/ui:ui_resources", "//chrome/updater/win/ui:ui_resources",
] ]
...@@ -134,34 +134,6 @@ source_set("install_progress_observer") { ...@@ -134,34 +134,6 @@ source_set("install_progress_observer") {
deps = [ "//base" ] deps = [ "//base" ]
} }
# This build target is defined to minimize the impact of -Wno-missing-braces
# compiler switch. In the future it might be possible to isolate the
# dependency of ATL in the UI so ATL headers are not visible in the
# compilation units outside the UI itself.
# TODO(sorin): https://crbug.com/1014311
source_set("app_install") {
sources = [
"app_install.cc",
"app_install.h",
]
deps = [
":install_progress_observer",
":lib",
"//base",
"//base:i18n",
"//chrome/updater:base",
"//chrome/updater:lib",
"//chrome/updater:version_header",
"//chrome/updater/win/ui",
"//components/prefs",
"//components/update_client",
]
allow_circular_includes_from = [ "//chrome/updater:lib" ]
cflags_cc = [ "-Wno-missing-braces" ]
}
source_set("updater_tests") { source_set("updater_tests") {
testonly = true testonly = true
...@@ -175,11 +147,11 @@ source_set("updater_tests") { ...@@ -175,11 +147,11 @@ source_set("updater_tests") {
] ]
deps = [ deps = [
":app_install",
":constants", ":constants",
":lib", ":lib",
":tag_extractor", ":tag_extractor",
"//base/test:test_support", "//base/test:test_support",
"//chrome/updater:app_install",
"//testing/gtest", "//testing/gtest",
"//url:url", "//url:url",
] ]
...@@ -209,10 +181,10 @@ test("updater_unittests") { ...@@ -209,10 +181,10 @@ test("updater_unittests") {
] ]
deps = [ deps = [
":app_install",
":lib", ":lib",
"//base", "//base",
"//base/test:test_support", "//base/test:test_support",
"//chrome/updater:app_install",
"//chrome/updater:version_header", "//chrome/updater:version_header",
"//chrome/updater/win/test:test_executables", "//chrome/updater/win/test:test_executables",
"//chrome/updater/win/test:test_strings", "//chrome/updater/win/test:test_strings",
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// 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 "chrome/updater/win/app_install.h" #include "chrome/updater/app/app_install.h"
#include <memory> #include <memory>
#include <string> #include <string>
......
// Copyright 2019 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_UPDATER_WIN_APP_INSTALL_H_
#define CHROME_UPDATER_WIN_APP_INSTALL_H_
#include <string>
#include "base/memory/scoped_refptr.h"
namespace updater {
class App;
scoped_refptr<App> MakeAppInstall();
} // namespace updater
#endif // CHROME_UPDATER_WIN_APP_INSTALL_H_
...@@ -25,8 +25,8 @@ source_set("test_common") { ...@@ -25,8 +25,8 @@ source_set("test_common") {
deps = [ deps = [
"//base", "//base",
"//chrome/updater:app_install",
"//chrome/updater:base", "//chrome/updater:base",
"//chrome/updater/win:app_install",
"//chrome/updater/win:lib", "//chrome/updater/win:lib",
] ]
} }
......
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