Commit 05eee3ed authored by Daniel Libby's avatar Daniel Libby Committed by Commit Bot

Revert "Create BUILD.gn in ui/base/idle"

This reverts commit 3e4749d2.

Reason for revert: This change is no longer needed - we are no longer
planning on removing the dependency from ui/base to ui/events

Original change's description:
> Create BUILD.gn in ui/base/idle
>
> This one step in a series of clean up refactoring changes
> that will result in ui/base no longer having dependencies on
> ui/events. This will allow ui/base to be treated more as the lowest
> layer of the ui/ components.
>
> This change adds a BUILD.gn to ui/base/idle to create a new
> component. This is in preparation of doing the same for
> ui/base/user_activity which has a dependency on ui/events
> (and on which ui/base/idle has a dependency).
>
> Bug: 921723
> Change-Id: I1b98d33ce8dfd78309fd532cbfc2bb013453c83f
> Reviewed-on: https://chromium-review.googlesource.com/c/1428563
> Commit-Queue: Daniel Libby <dlibby@microsoft.com>
> Reviewed-by: Scott Violet <sky@chromium.org>
> Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#627720}

TBR=sadrul@chromium.org,sky@chromium.org,dcheng@chromium.org,dlibby@microsoft.com

Bug: 921723
Change-Id: I80080945da2f2726ce79b477644b65e82b0e2ff2
Reviewed-on: https://chromium-review.googlesource.com/c/1478252Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Daniel Libby <dlibby@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#633859}
parent 88b22fe6
...@@ -2068,7 +2068,6 @@ jumbo_split_static_library("browser") { ...@@ -2068,7 +2068,6 @@ jumbo_split_static_library("browser") {
"//ui/accessibility", "//ui/accessibility",
"//ui/base", "//ui/base",
"//ui/base:ui_data_pack", "//ui/base:ui_data_pack",
"//ui/base/idle",
"//ui/base/ime", "//ui/base/ime",
"//ui/events:events_base", "//ui/events:events_base",
"//ui/gfx", "//ui/gfx",
......
...@@ -227,7 +227,6 @@ source_set("chromeos") { ...@@ -227,7 +227,6 @@ source_set("chromeos") {
"//ui/accessibility", "//ui/accessibility",
"//ui/aura", "//ui/aura",
"//ui/base", "//ui/base",
"//ui/base/idle",
"//ui/chromeos", "//ui/chromeos",
"//ui/chromeos/events", "//ui/chromeos/events",
"//ui/compositor", "//ui/compositor",
......
...@@ -198,7 +198,6 @@ jumbo_source_set("browser") { ...@@ -198,7 +198,6 @@ jumbo_source_set("browser") {
"//ui/base", "//ui/base",
"//ui/base:buildflags", "//ui/base:buildflags",
"//ui/base/clipboard", "//ui/base/clipboard",
"//ui/base/idle",
"//ui/base/ime", "//ui/base/ime",
"//ui/display", "//ui/display",
"//ui/display/types", "//ui/display/types",
......
...@@ -21,7 +21,6 @@ source_set("idle") { ...@@ -21,7 +21,6 @@ source_set("idle") {
deps = [ deps = [
"//extensions/common/api", "//extensions/common/api",
"//ui/base/idle",
] ]
public_deps = [ public_deps = [
......
...@@ -317,6 +317,13 @@ jumbo_component("base") { ...@@ -317,6 +317,13 @@ jumbo_component("base") {
"dragdrop/file_info.cc", "dragdrop/file_info.cc",
"dragdrop/file_info.h", "dragdrop/file_info.h",
"emoji/emoji_panel_helper.h", "emoji/emoji_panel_helper.h",
"idle/idle.cc",
"idle/idle.h",
"idle/idle_android.cc",
"idle/idle_chromeos.cc",
"idle/idle_linux.cc",
"idle/idle_mac.mm",
"idle/idle_win.cc",
"pointer/pointer_device.h", "pointer/pointer_device.h",
"pointer/pointer_device_util.cc", "pointer/pointer_device_util.cc",
"pointer/touch_editing_controller.cc", "pointer/touch_editing_controller.cc",
...@@ -365,6 +372,7 @@ jumbo_component("base") { ...@@ -365,6 +372,7 @@ jumbo_component("base") {
if (is_fuchsia) { if (is_fuchsia) {
sources += [ sources += [
"idle/idle_fuchsia.cc",
"l10n/l10n_util_posix.cc", "l10n/l10n_util_posix.cc",
"resource/resource_bundle_fuchsia.cc", "resource/resource_bundle_fuchsia.cc",
] ]
...@@ -425,6 +433,17 @@ jumbo_component("base") { ...@@ -425,6 +433,17 @@ jumbo_component("base") {
if (use_x11) { if (use_x11) {
public_deps += [ "//ui/base/x" ] public_deps += [ "//ui/base/x" ]
configs += [ "//build/config/linux:x11" ] configs += [ "//build/config/linux:x11" ]
if (!is_chromeos) {
sources += [
"idle/idle_query_x11.cc",
"idle/idle_query_x11.h",
"idle/screensaver_window_finder_x11.cc",
"idle/screensaver_window_finder_x11.h",
]
configs += [ "//build/config/linux:xscrnsaver" ]
deps += [ "//ui/gfx/x" ]
}
} }
if (use_x11 && use_aura) { if (use_x11 && use_aura) {
...@@ -475,6 +494,14 @@ jumbo_component("base") { ...@@ -475,6 +494,14 @@ jumbo_component("base") {
] ]
} }
if (is_chromeos) {
deps += [
"//chromeos",
"//chromeos/dbus",
]
sources -= [ "idle/idle_linux.cc" ]
}
if (is_chromeos || (use_aura && is_linux && !use_x11)) { if (is_chromeos || (use_aura && is_linux && !use_x11)) {
sources += [ sources += [
"dragdrop/os_exchange_data_provider_aura.cc", "dragdrop/os_exchange_data_provider_aura.cc",
...@@ -572,6 +599,7 @@ jumbo_component("base") { ...@@ -572,6 +599,7 @@ jumbo_component("base") {
sources -= [ sources -= [
"cursor/cursor_android.cc", "cursor/cursor_android.cc",
"default_theme_provider.cc", "default_theme_provider.cc",
"idle/idle.cc",
"l10n/l10n_font_util.cc", "l10n/l10n_font_util.cc",
"models/button_menu_item_model.cc", "models/button_menu_item_model.cc",
"pointer/touch_editing_controller.cc", "pointer/touch_editing_controller.cc",
......
# 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.
import("//build/config/jumbo.gni")
import("//build/config/ui.gni")
import("//testing/test.gni")
if (is_android) {
import("//build/config/android/rules.gni")
} else if (is_mac) {
import("//build/config/mac/rules.gni")
}
jumbo_component("idle") {
output_name = "ui_base_idle"
defines = [ "IS_UI_BASE_IDLE_IMPL" ]
sources = [
"idle.cc",
"idle.h",
"idle_android.cc",
"idle_chromeos.cc",
"idle_linux.cc",
"idle_mac.mm",
"idle_win.cc",
]
deps = [
"//ui/base",
]
public_deps = []
libs = []
if (is_fuchsia) {
sources += [ "idle_fuchsia.cc" ]
}
if (use_x11) {
public_deps += [ "//ui/base/x" ]
deps += [ "//ui/gfx/x" ]
configs += [
"//build/config/linux:x11",
"//build/config/linux:xscrnsaver",
]
sources += [
"idle_query_x11.cc",
"idle_query_x11.h",
"screensaver_window_finder_x11.cc",
"screensaver_window_finder_x11.h",
]
}
if (is_chromeos) {
deps += [
"//chromeos",
"//chromeos/dbus",
]
sources -= [ "idle_linux.cc" ]
}
if (is_android) {
sources -= [ "idle.cc" ]
deps += [ "//ui/base:ui_base_jni_headers" ]
}
if (is_mac) {
libs += [
"Carbon.framework",
"Foundation.framework",
]
}
}
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
#ifndef UI_BASE_IDLE_IDLE_H_ #ifndef UI_BASE_IDLE_IDLE_H_
#define UI_BASE_IDLE_IDLE_H_ #define UI_BASE_IDLE_IDLE_H_
#include "base/component_export.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "ui/base/ui_base_export.h"
namespace ui { namespace ui {
...@@ -20,18 +20,18 @@ enum IdleState { ...@@ -20,18 +20,18 @@ enum IdleState {
// For MacOSX, InitIdleMonitor needs to be called first to setup the monitor. // For MacOSX, InitIdleMonitor needs to be called first to setup the monitor.
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
COMPONENT_EXPORT(UI_BASE_IDLE) void InitIdleMonitor(); UI_BASE_EXPORT void InitIdleMonitor();
#endif #endif
// Calculate the Idle state. |idle_threshold| is the amount of time (in seconds) // Calculate the Idle state. |idle_threshold| is the amount of time (in seconds)
// before the user is considered idle. // before the user is considered idle.
COMPONENT_EXPORT(UI_BASE_IDLE) IdleState CalculateIdleState(int idle_threshold); UI_BASE_EXPORT IdleState CalculateIdleState(int idle_threshold);
// Calculate Idle time in seconds. // Calculate Idle time in seconds.
COMPONENT_EXPORT(UI_BASE_IDLE) int CalculateIdleTime(); UI_BASE_EXPORT int CalculateIdleTime();
// Checks synchronously if Idle state is IDLE_STATE_LOCKED. // Checks synchronously if Idle state is IDLE_STATE_LOCKED.
COMPONENT_EXPORT(UI_BASE_IDLE) bool CheckIdleStateIsLocked(); UI_BASE_EXPORT bool CheckIdleStateIsLocked();
} // namespace ui } // namespace ui
......
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