Commit b607d7be authored by Yuta Hijikata's avatar Yuta Hijikata Committed by Commit Bot

LaCrOS: Replace defined(OS_CHROMEOS) with BUILDFLAG(IS_CHROMEOS_ASH)

The change is mostly mechanical replacing defined(OS_CHROMEOS) with
BUILDFLAG(IS_CHROMEOS_ASH) and GN variable is_chromeos with is_ash
with some special cases (For those cases please refer to
http://go/lacros-macros).

The patch is made in preparation to switching lacros build from
target_os=linux to target_os=chromeos. This will prevent lacros from
changing behaviour after the switch.

Bug: 1052397
Change-Id: Ib9e67a3cccd20549836019db36c507d71db70aa2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2494202
Commit-Queue: Yuta Hijikata <ythjkt@chromium.org>
Reviewed-by: default avatarCharlie Reis <creis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#825709}
parent eacdde4e
...@@ -2,6 +2,7 @@ ...@@ -2,6 +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.
import("//build/config/chromeos/ui_mode.gni")
import("//build/config/features.gni") import("//build/config/features.gni")
import("//build/config/ui.gni") import("//build/config/ui.gni")
import("//extensions/buildflags/buildflags.gni") import("//extensions/buildflags/buildflags.gni")
...@@ -38,6 +39,7 @@ static_library("apps") { ...@@ -38,6 +39,7 @@ static_library("apps") {
deps = [ deps = [
"//base/util/values:values_util", "//base/util/values:values_util",
"//build:chromeos_buildflags",
"//components/keyed_service/content", "//components/keyed_service/content",
"//content/public/browser", "//content/public/browser",
"//content/public/common", "//content/public/common",
...@@ -46,7 +48,7 @@ static_library("apps") { ...@@ -46,7 +48,7 @@ static_library("apps") {
"//extensions/common/api", "//extensions/common/api",
] ]
if (is_chromeos) { if (is_chromeos_ash) {
deps += [ "//components/user_manager" ] deps += [ "//components/user_manager" ]
} }
} }
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include "apps/app_restore_service_factory.h" #include "apps/app_restore_service_factory.h"
#include "apps/launcher.h" #include "apps/launcher.h"
#include "apps/saved_files_service.h" #include "apps/saved_files_service.h"
#include "build/chromeos_buildflags.h"
#include "content/public/browser/browser_context.h" #include "content/public/browser/browser_context.h"
#include "extensions/browser/app_window/app_window.h" #include "extensions/browser/app_window/app_window.h"
#include "extensions/browser/extension_host.h" #include "extensions/browser/extension_host.h"
...@@ -26,7 +27,7 @@ namespace apps { ...@@ -26,7 +27,7 @@ namespace apps {
// static // static
bool AppRestoreService::ShouldRestoreApps(bool is_browser_restart) { bool AppRestoreService::ShouldRestoreApps(bool is_browser_restart) {
bool should_restore_apps = is_browser_restart; bool should_restore_apps = is_browser_restart;
#if defined(OS_CHROMEOS) #if BUILDFLAG(IS_CHROMEOS_ASH)
// Chromeos always restarts apps, even if it was a regular shutdown. // Chromeos always restarts apps, even if it was a regular shutdown.
should_restore_apps = true; should_restore_apps = true;
#endif #endif
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/task/task_traits.h" #include "base/task/task_traits.h"
#include "base/task/thread_pool.h" #include "base/task/thread_pool.h"
#include "build/chromeos_buildflags.h"
#include "components/services/app_service/public/cpp/file_handler_info.h" #include "components/services/app_service/public/cpp/file_handler_info.h"
#include "content/public/browser/browser_context.h" #include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_task_traits.h"
...@@ -47,7 +48,7 @@ ...@@ -47,7 +48,7 @@
#include "net/base/filename_util.h" #include "net/base/filename_util.h"
#include "url/gurl.h" #include "url/gurl.h"
#if defined(OS_CHROMEOS) #if BUILDFLAG(IS_CHROMEOS_ASH)
#include "components/user_manager/user_manager.h" #include "components/user_manager/user_manager.h"
#endif #endif
...@@ -385,7 +386,7 @@ void LaunchPlatformAppWithCommandLineAndLaunchId( ...@@ -385,7 +386,7 @@ void LaunchPlatformAppWithCommandLineAndLaunchId(
// check in case this scenario does occur. // check in case this scenario does occur.
if (extensions::KioskModeInfo::IsKioskOnly(app)) { if (extensions::KioskModeInfo::IsKioskOnly(app)) {
bool in_kiosk_mode = false; bool in_kiosk_mode = false;
#if defined(OS_CHROMEOS) #if BUILDFLAG(IS_CHROMEOS_ASH)
user_manager::UserManager* user_manager = user_manager::UserManager::Get(); user_manager::UserManager* user_manager = user_manager::UserManager::Get();
in_kiosk_mode = user_manager && user_manager->IsLoggedInAsKioskApp(); in_kiosk_mode = user_manager && user_manager->IsLoggedInAsKioskApp();
#endif #endif
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include "apps/saved_files_service_factory.h" #include "apps/saved_files_service_factory.h"
#include "base/util/values/values_util.h" #include "base/util/values/values_util.h"
#include "build/chromeos_buildflags.h"
#include "content/public/browser/browser_context.h" #include "content/public/browser/browser_context.h"
#include "content/public/browser/notification_service.h" #include "content/public/browser/notification_service.h"
#include "extensions/browser/api/file_system/saved_file_entry.h" #include "extensions/browser/api/file_system/saved_file_entry.h"
...@@ -310,7 +311,7 @@ void SavedFilesService::SavedFiles::EnqueueFileEntry(const std::string& id) { ...@@ -310,7 +311,7 @@ void SavedFilesService::SavedFiles::EnqueueFileEntry(const std::string& id) {
SavedFileEntry* file_entry = it->second.get(); SavedFileEntry* file_entry = it->second.get();
int old_sequence_number = file_entry->sequence_number; int old_sequence_number = file_entry->sequence_number;
#if defined(OS_CHROMEOS) #if BUILDFLAG(IS_CHROMEOS_ASH)
// crbug.com/983844 Convert path from legacy Download/ to MyFiles/Downloads/ // crbug.com/983844 Convert path from legacy Download/ to MyFiles/Downloads/
// so entries saved before MyFiles don't fail. TODO(lucmult): Remove this // so entries saved before MyFiles don't fail. TODO(lucmult): Remove this
// after M-83. // after M-83.
......
...@@ -14,6 +14,7 @@ source_set("views") { ...@@ -14,6 +14,7 @@ source_set("views") {
] ]
deps = [ deps = [
"//build:chromeos_buildflags",
"//cc/paint", "//cc/paint",
"//chrome/app/theme:theme_resources", "//chrome/app/theme:theme_resources",
"//extensions/browser", "//extensions/browser",
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <utility> #include <utility>
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "build/chromeos_buildflags.h"
#include "cc/paint/paint_flags.h" #include "cc/paint/paint_flags.h"
#include "chrome/grit/theme_resources.h" #include "chrome/grit/theme_resources.h"
#include "extensions/browser/app_window/native_app_window.h" #include "extensions/browser/app_window/native_app_window.h"
...@@ -136,7 +137,9 @@ gfx::Rect AppWindowFrameView::GetBoundsForClientView() const { ...@@ -136,7 +137,9 @@ gfx::Rect AppWindowFrameView::GetBoundsForClientView() const {
gfx::Rect AppWindowFrameView::GetWindowBoundsForClientBounds( gfx::Rect AppWindowFrameView::GetWindowBoundsForClientBounds(
const gfx::Rect& client_bounds) const { const gfx::Rect& client_bounds) const {
gfx::Rect window_bounds = client_bounds; gfx::Rect window_bounds = client_bounds;
#if defined(OS_LINUX) && !defined(OS_CHROMEOS) // TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is
// complete.
#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
// Get the difference between the widget's client area bounds and window // Get the difference between the widget's client area bounds and window
// bounds, and grow |window_bounds| by that amount. // bounds, and grow |window_bounds| by that amount.
gfx::Insets native_frame_insets = gfx::Insets native_frame_insets =
......
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