0

Migrate "base::TimeDelta::FromX" to "base:X".

All changes were done automatically with git grep, sed, xargs, etc.

No-Presubmit: true
No-Try: true
Bug: 1243777
Change-Id: I7cc197e9027f7837cd36afc67a209079f85ec364
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3198824
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Owners-Override: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Peter Boström <pbos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#927512}
This commit is contained in:
Peter Kasting
2021-10-02 03:06:35 +00:00
committed by Chromium LUCI CQ
parent 1931425875
commit e5a38eddbd
5638 changed files with 27000 additions and 33422 deletions
android_webview
ash
accelerators
accelerometer
accessibility
ambient
app_list
assistant
capture_mode
clipboard
components
constants
controls
display
drag_drop
fast_ink
frame
frame_throttler
highlighter
hud_display
ime
in_session_auth
keyboard
lock_screen_action
login
media
metrics
multi_user
policy
projector
public
quick_pair
rotator
services
session
shelf
shortcut_viewer
system
accessibility
bluetooth
holding_space
machine_learning
media
message_center
model
nearby_share
network
night_light
overview
palette
phonehub
power
privacy_screen
session
status_area_widget.cc
time
toast
tray
unified
touch
utility
wallpaper
webui
wm
desks
gestures
immersive_fullscreen_controller_unittest.cclock_state_controller.cc
overview
pip
resize_shadow.ccresize_shadow_and_cursor_unittest.ccsession_state_animator.cc
splitview
tablet_mode
toplevel_window_event_handler_unittest.ccvideo_detector.ccwindow_animations.ccwindow_animations_unittest.cc
window_cycle
window_dimmer.ccwindow_positioner.cc
window_restore
window_state.ccwindow_state.hwindow_state_unittest.cc
workspace
workspace_controller.cc
base
cc
animation
base
benchmarks
debug
input
layers
metrics
paint
raster
resources
scheduler
test
tiles
trees
chrome
app_shim
browser
accessibility
after_startup_task_utils.cc
android
apps
ash
accessibility
account_manager
android_sms
app_mode
app_restore
arc
attestation
authpolicy
bluetooth
borealis
camera_mic
cert_provisioning
certificate_provider
child_accounts
crosapi
crostini
customization
device_name
drive
file_system_provider
first_run
guest_os
hats
input_method
kerberos
lock_screen_apps
login
app_mode
challenge_response_auth_keys_loader.ccchrome_restart_request.cc
demo_mode
easy_unlock
enrollment
enterprise_user_session_metrics.ccenterprise_user_session_metrics_unittest.ccerror_screen_browsertest.ccerror_screens_histogram_helper.ccerror_screens_histogram_helper_unittest.ccexisting_user_controller.ccexisting_user_controller_browsertest.ccexisting_user_controller_forced_online_auth_unittest.cc
lock
login_constants.honboarding_user_activity_counter.cconboarding_user_activity_counter_unittest.cc
quick_unlock
reset_browsertest.cc
saml
screens
security_token_session_controller.cc
session
signin
test
ui
user_online_signin_notifier_unittest.cc
users
version_updater
wizard_controller.ccwizard_controller_browsertest.cc
mobile
nearby
net
night_light
notifications
policy
active_directory
core
dlp
enrollment
handlers
invalidation
off_hours
remote_commands
reporting
rsu
scheduled_task_handler
server_backed_state
status_collector
uploading
power
printing
secure_channel
settings
smb_client
system
tether
web_applications
wilco_dtc_supportd
autocomplete
autofill
availability
background
background_sync
badging
bitmap_fetcher
bookmarks
browser_process_impl.ccbrowser_process_platform_part_chromeos.cc
browser_switcher
browsing_data
captive_portal
cart
chrome_browser_main.ccchrome_browser_main_android.ccchrome_browser_main_win.ccchrome_content_browser_client.ccchrome_content_browser_client_browsertest.ccchrome_web_platform_security_metrics_browsertest.cc
chromeos
client_hints
commerce
component_updater
content_settings
custom_handlers
data_reduction_proxy
data_saver
dbus_memory_pressure_evaluator_linux.cc
device_api
device_reauth
devtools
dom_distiller
download
endpoint_fetcher
engagement
enterprise
error_reporting
extensions
activity_log
api
api_binding_perf_browsertest.ccextension_browsertest_browsertest.ccextension_garbage_collector.ccextension_message_bubble_controller_unittest.ccextension_service.cc
forced_extensions
test_extension_prefs.cc
updater
webstore_installer.ccwindow_open_apitest.cczipfile_installer_unittest.cc
favicon
federated_learning
feedback
system_logs
file_system_access
google
history_clusters
idle
importer
interest_group
internal_auth_unittest.ccintranet_redirect_detector.cc
lacros
lifetime
lite_video
local_discovery
lookalikes
mac
media
android
cast_mirroring_performance_browsertest.cccdm_document_service_impl_test.cc
history
media_engagement_browsertest.ccmedia_engagement_contents_observer.ccmedia_engagement_contents_observer_unittest.ccmedia_engagement_score_unittest.ccmedia_engagement_service_unittest.ccmedia_engagement_session_unittest.ccoffscreen_tab.cc
router
webrtc
media_galleries
memory
metrics
navigation_predictor
nearby_sharing
net
new_tab_page
no_best_effort_tasks_browsertest.cc
notifications
offline_pages
optimization_guide
page_load_metrics
paint_preview
password_manager
performance_manager
performance_monitor
permissions
policy
portal
predictors
prefetch
printing
privacy_sandbox
process_singleton_posix.ccprocess_singleton_win_unittest.cc
profile_resetter
profiles
profiling_host
push_messaging
reading_list
renderer_context_menu
renderer_host
reputation
resource_coordinator
safe_browsing
search
segmentation_platform
service_process
sessions
share
sharing
shell_integration_win.cc
signin
site_isolation
speech
ssl
storage
storage_access_api
subresource_filter
subresource_redirect
supervised_user
sync
sync_file_system
task_manager
themes
thumbnail
touch_to_fill
tracing
translate
ui
android
app_list
apps
ash
autofill
blocked_content
bookmarks
browser.ccbrowser_focus_uitest.cc
cocoa
exclusive_access
global_media_controls
hats
hung_plugin_tab_helper.cc
media_router
omnibox
passwords
profile_picker.ccprofile_picker_unittest.ccrecently_audible_helper.hrecently_audible_helper_unittest.cc
search
signin_reauth_view_controller_browsertest.cc
startup
tabs
task_manager
thumbnails
toolbar
user_education
views
accessibility
apps
autofill
bookmarks
bubble
content_test_utils.cccritical_notification_bubble_view.cc
crostini
desktop_capture
download
exclusive_access_bubble_views.cc
extensions
eye_dropper
flying_indicator.cc
frame
fullscreen_control
hats
keyboard_access_browsertest.cc
location_bar
media_router
omnibox
overlay
page_action
page_info
passwords
payments
profiles
read_later
relaunch_notification
send_tab_to_self
status_bubble_views.ccstatus_bubble_views_browsertest.cc
tab_sharing
tabs
toolbar
user_education
web_apps
webauthn
web_applications
webauthn
webui
autofill_and_password_manager_internals
certificate_provisioning_ui_handler.cccertificate_provisioning_ui_handler_unittest.cc
chromeos
constrained_web_dialog_ui_browsertest.cc
download_shelf
downloads
history_clusters
identity_internals_ui_browsertest.cc
internals
interstitials
management
metrics_handler.cc
net_internals
new_tab_page
read_later
realbox
settings
signin
tab_search
tab_strip
webui_load_timer.cc
upgrade_detector
video_tutorials
visibility_timer_tab_helper_unittest.cc
vr
web_applications
webshare
win
chrome_cleaner
chrome_elf
common
credential_provider
installer
renderer
service
services
test
updater
utility
safe_browsing
chromecast
base
browser
cast_core
crash
device
external_mojo
external_service_support
graphics
media
audio
base
cma
common
service
metrics
net
renderer
ui
chromeos
assistant
test_support
attestation
components
crosapi
dbus
disks
geolocation
memory
metrics
network
policy
printing
services
assistant
cellular_setup
cros_healthd
device_sync
libassistant
multidevice_setup
network_config
secure_channel
tts
system
timezone
tpm
ui
cloud_print/virtual_driver/win/port_monitor
codelabs/cpp101
components
accuracy_tips
app_restore
arc
assist_ranker
autofill
content
core
browser
address_normalizer_impl.ccautocomplete_history_manager_unittest.ccautofill_ablation_study.ccautofill_ablation_study_unittest.ccautofill_download_manager.ccautofill_download_manager_unittest.ccautofill_manager.ccautofill_metrics.ccautofill_metrics_unittest.ccautofill_profile_import_process_unittest.ccautofill_profile_save_strike_database.ccautofill_profile_save_strike_database_unittest.ccautofill_profile_update_strike_database.ccautofill_profile_validator.ccautofill_suggestion_generator_unittest.ccautofill_test_utils.ccbrowser_autofill_manager.ccbrowser_autofill_manager_unittest.cc
data_model
geo
metrics
payments
personal_data_manager_unittest.ccstrike_database_integrator_base.ccstrike_database_integrator_test_strike_database.hstrike_database_integrator_test_strike_database_unittest.cctest_autofill_profile_validator_delayed.cctest_event_waiter.h
ui
webdata
common
ios
autofill_assistant
background_sync
blocked_content
blocklist
bookmarks
breadcrumbs
browser_sync
browsing_data
captive_portal
cast_certificate
cast_channel
cast_streaming
certificate_transparency
client_hints
component_updater
content_capture
content_settings
crash
cronet
data_reduction_proxy
data_use_measurement
desks_storage
device_event_log
discardable_memory
dom_distiller
domain_reliability
download
drive
embedder_support
enterprise
error_page
exo
favicon
feature_engagement
federated_learning
features
feed
feedback
fullscreen_control
gcm_driver
guest_os
gwp_asan
heap_profiling
heavy_ad_intervention
history
history_clusters
image_fetcher
invalidation
javascript_dialogs
language
leveldb_proto
live_caption
media_message_center
media_router
memory_pressure
metal_util
metrics
mirroring
nacl
navigation_interception
net_log
network_hints
network_session_configurator
network_time
no_state_prefetch
ntp_snippets
ntp_tiles
offline_items_collection
offline_pages
omnibox
open_from_clipboard
openscreen_platform
optimization_guide
page_image_annotation
page_info
page_load_metrics
paint_preview
password_manager
payments
performance_manager
permissions
policy
power_scheduler
prefs
query_tiles
quirks
reading_list
remote_cocoa
reporting
rlz
safe_browsing
safe_search_api
safety_check
scheduling_metrics
schema_org
common
search
search_engines
search_provider_logos
security_interstitials
security_state
segmentation_platform
send_tab_to_self
services
sessions
shared_highlighting
signin
site_engagement
site_isolation
soda
spellcheck
ssl_errors
storage_monitor
subresource_filter
subresource_redirect
sync
sync_bookmarks
sync_device_info
sync_sessions
system_media_controls
translate
ui_devtools
ukm
update_client
user_manager
variations
viz
common
demo
host
service
test
web_cache
web_resource
webapps
webrtc_logging
wifi
content
app
browser
accessibility
aggregation_service
android
appcache
attribution_reporting
audio
back_forward_cache_browsertest.cc
background_sync
blob_storage
bluetooth
browser_process_io_thread.cc
browsing_data
cache_storage
child_process_launcher.ccchild_process_security_policy_impl.ccchild_process_security_policy_impl.h
client_hints
code_cache
compute_pressure
content_index
data_decoder_browsertest.cc
device_sensors
devtools
download
gpu
host_zoom_map_impl_unittest.cc
idle
indexed_db
interest_group
loader
media
memory
metrics
net
net_info_browsertest.ccnetwork_service_browsertest.cc
notifications
portal
prerender
push_messaging
quota
renderer_host
back_forward_cache_impl.ccback_forward_cache_metrics.ccback_forward_cache_metrics_browsertest.ccback_forward_cache_metrics_unittest.ccclipboard_host_impl.ccclipboard_host_impl_unittest.cccompositor_dependencies_android.cccompositor_impl_android_browsertest.ccdebug_urls.ccdwrite_font_lookup_table_builder_win.ccdwrite_font_lookup_table_builder_win_unittest.cc
input
media
navigation_controller_impl.ccnavigation_controller_impl_browsertest.ccnavigation_controller_impl_unittest.ccnavigation_request.ccoverscroll_configuration.ccoverscroll_controller.ccoverscroll_controller_unittest.ccpage_lifecycle_state_manager.ccplugin_registry_impl.ccrecently_destroyed_hosts.ccrecently_destroyed_hosts.hrecently_destroyed_hosts_unittest.ccrender_frame_host_impl.ccrender_frame_host_impl_browsertest.ccrender_frame_host_manager_browsertest.ccrender_process_host_browsertest.ccrender_process_host_impl.ccrender_view_host_impl.hrender_widget_host_browsertest.ccrender_widget_host_impl.ccrender_widget_host_unittest.ccrender_widget_host_view_android.ccrender_widget_host_view_aura.ccrender_widget_host_view_aura_browsertest.ccrender_widget_host_view_aura_unittest.ccrender_widget_host_view_browsertest.ccrender_widget_host_view_child_frame.ccrender_widget_host_view_mac_unittest.mmrender_widget_targeter.cctext_input_client_mac.htext_input_client_mac_unittest.mm
scheduler
service_process_host_browsertest.cc
service_worker
site_per_process_browsertest.ccsite_per_process_scroll_browsertest.ccsite_per_process_unload_browsertest.ccstarscan_load_observer.ccstartup_task_runner_unittest.ccstorage_partition_impl.ccstorage_partition_impl_unittest.ccstorage_service_restart_browsertest.ccstorage_service_sandbox_browsertest.cc
tracing
video_capture_service.cc
web_contents
web_database
web_package
webauth
webrtc
webui
xr
child
common
ppapi_plugin
public
renderer
services
shell
test
web_test
dbus
device
docs
extensions
fuchsia
gin
gpu
headless
ios
chrome
app
browser
app_launcher
autofill
browser_state
browsing_data
crash_report
external_files
infobars
install_time_util_unittest.mmios_chrome_main_parts.mmios_thread_profiler.cc
link_to_text
metrics
notification_promo.ccnotification_promo_unittest.cc
ntp
omaha
optimization_guide
overscroll_actions
passwords
policy
prerender
reading_list
safe_browsing
sessions
share_extension
snapshots
ssl
translate
ui
web
test
net
public
provider
testing
web
ipc
jingle
media
audio
base
capabilities
capture
cast
cdm
ffmpeg
filters
formats
fuchsia
gpu
midi
mojo
muxers
remoting
renderers
test
video
webrtc
mojo
net
android
base
cert
cert_net
cookies
der
disk_cache
dns
extras
http
log
network_error_logging
nqe
proxy_resolution
quic
reporting
socket
spdy
ssl
test
tools
stress_cache
url_request
websockets
pdf
ppapi
printing/backend
remoting
base
client
codec
host
audio_capturer_win.ccbackoff_timer_unittest.ccbasic_desktop_environment.cc
chromeos
clipboard_mac.mmclipboard_win.ccconfig_file_watcher.cccontinue_window.ccdaemon_process.ccdaemon_process_unittest.ccdesktop_session_agent.ccdesktop_session_agent_unittest.ccdesktop_session_win.ccdisconnect_window_win.ccftl_signaling_connector.ccheartbeat_sender.ccheartbeat_sender_unittest.ccinput_injector_mac.ccinput_injector_x11.cc
it2me
keyboard_layout_monitor_chromeos.cckeyboard_layout_monitor_win.cc
linux
mac
mojo_ipc
mouse_shape_pump.ccprocess_stats_sender_unittest.cc
remote_open_url
remoting_me2me_host.ccremoting_register_support_host_request.ccremoting_register_support_host_request_unittest.ccresizing_host_observer.ccresizing_host_observer_unittest.cc
security_key
setup
token_validator_base_unittest.cc
win
xmpp_register_support_host_request.ccxmpp_register_support_host_request_unittest.cczombie_host_detector.hzombie_host_detector_unittest.cc
ios
protocol
signaling
test
rlz/lib
sandbox
services
audio
cert_verifier
data_decoder
device
image_annotation
media_session
network
cookie_manager_unittest.cccookie_settings_unittest.cc
cors
host_resolver_unittest.cchttp_cache_data_counter_unittest.ccmdns_responder.ccmdns_responder.hmdns_responder_unittest.ccnet_log_proxy_sink_unittest.ccnetwork_context_unittest.ccnetwork_quality_estimator_manager_unittest.ccnetwork_service.ccnetwork_service_proxy_delegate_unittest.cc
p2p
public
resource_scheduler
sct_auditing
session_cleanup_cookie_store_unittest.cc
throttling
trust_tokens
upload_progress_tracker.ccupload_progress_tracker_unittest.ccurl_loader_factory.ccurl_loader_unittest.ccwebsocket_throttler.ccwebsocket_throttler_unittest.cc
proxy_resolver
resource_coordinator
service_manager
tests
tracing
video_capture
viz
sql
storage/browser
testing/perf
third_party
blink
common
public
renderer
bindings
controller
core
animation
content_capture
css
document_transition
dom
editing
exported
fileapi
frame
html
input
inspector
intersection_observer
layout
loader
mobile_metrics
origin_trials
page
paint
scheduler_integration_tests
scroll
svg
testing
timing
web_test
workers
xmlhttprequest
modules
ad_auction
animationworklet
background_fetch
breakout_box
canvas
content_index
credentialmanager
device_orientation
document_metadata
eventsource
filesystem
gamepad
geolocation
handwriting
idle
media
media_controls
mediacapturefromelement
mediarecorder
mediasession
mediasource
mediastream
notifications
payments
peerconnection
scheduler
sensor
service_worker
speech
vibration
video_rvfc
webaudio
webcodecs
webgl
webmidi
webrtc
websockets
webtransport
platform
animation
audio
bindings
blob
fonts
graphics
image-decoders
instrumentation
loader
media
mediastream
network
peerconnection
scheduler
testing
timer_test.cc
video_capture
widget
wtf
leveldatabase
libaddressinput
webrtc_overrides
zlib
tools
android
io_benchmark
ipc_fuzzer
message_replay
mac
ui
accelerated_widget_mac
android
aura
base
compositor
compositor_extra
display
events
gfx
gl
gtk
latency
lottie
message_center
native_theme
ozone
platform_window
shell_dialogs
snapshot
touch_selection
views
wm
weblayer

@ -1146,8 +1146,7 @@ void AwContents::OnComputeScroll(JNIEnv* env,
jlong animation_time_millis) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
browser_view_renderer_.OnComputeScroll(
base::TimeTicks() +
base::TimeDelta::FromMilliseconds(animation_time_millis));
base::TimeTicks() + base::Milliseconds(animation_time_millis));
}
jlong AwContents::ReleasePopupAwContents(JNIEnv* env,
@ -1263,9 +1262,8 @@ void AwContents::SmoothScroll(JNIEnv* env,
scale *= browser_view_renderer_.dip_scale();
DCHECK_GE(duration_ms, 0);
render_view_host_ext_->SmoothScroll(
target_x / scale, target_y / scale,
base::TimeDelta::FromMilliseconds(duration_ms));
render_view_host_ext_->SmoothScroll(target_x / scale, target_y / scale,
base::Milliseconds(duration_ms));
}
void AwContents::OnWebLayoutPageScaleFactorChanged(float page_scale_factor) {

@ -189,9 +189,8 @@ void AwAppsPackageNamesAllowlistComponentLoaderPolicy::ComponentLoaded(
return;
}
base::Time expiry_date =
base::Time::UnixEpoch() +
base::TimeDelta::FromMillisecondsD(expiry_date_ms.value_or(0.0));
base::Time expiry_date = base::Time::UnixEpoch() +
base::Milliseconds(expiry_date_ms.value_or(0.0));
if (expiry_date <= base::Time::Now()) {
RecordAndReportResult(std::move(lookup_callback_),
{AllowlistPraseStatus::kExpiredAllowlist});

@ -51,9 +51,9 @@ std::unique_ptr<base::Value> BuildTestManifest() {
auto manifest = std::make_unique<base::Value>(base::Value::Type::DICTIONARY);
manifest->SetKey(kBloomFilterNumHashKey, base::Value(kNumHash));
manifest->SetKey(kBloomFilterNumBitsKey, base::Value(3 * kNumBitsPerEntry));
manifest->SetKey(kExpiryDateKey,
base::Value(MillisFromUnixEpoch(
base::Time::Now() + base::TimeDelta::FromDays(1))));
manifest->SetKey(
kExpiryDateKey,
base::Value(MillisFromUnixEpoch(base::Time::Now() + base::Days(1))));
return manifest;
}
@ -116,8 +116,7 @@ TEST_F(AwAppsPackageNamesAllowlistComponentLoaderPolicyTest,
base::flat_map<std::string, base::ScopedFD> fd_map;
fd_map[kAllowlistBloomFilterFileName] = OpenAndGetAllowlistFd();
std::unique_ptr<base::Value> manifest = BuildTestManifest();
base::Time one_day_from_now =
base::Time::Now() + base::TimeDelta::FromDays(1);
base::Time one_day_from_now = base::Time::Now() + base::Days(1);
manifest->SetDoubleKey(kExpiryDateKey, MillisFromUnixEpoch(one_day_from_now));
base::Version new_version(kTestAllowlistVersion);
@ -148,8 +147,7 @@ TEST_F(AwAppsPackageNamesAllowlistComponentLoaderPolicyTest,
TestSameVersionAsCache) {
base::flat_map<std::string, base::ScopedFD> fd_map;
std::unique_ptr<base::Value> manifest = BuildTestManifest();
base::Time one_day_from_now =
base::Time::Now() + base::TimeDelta::FromDays(1);
base::Time one_day_from_now = base::Time::Now() + base::Days(1);
base::Version version(kTestAllowlistVersion);
AppPackageNameLoggingRule expected_record(version, one_day_from_now);
@ -304,9 +302,9 @@ TEST_F(AwAppsPackageNamesAllowlistComponentLoaderPolicyTest,
base::flat_map<std::string, base::ScopedFD> fd_map;
fd_map[kAllowlistBloomFilterFileName] = OpenAndGetAllowlistFd();
std::unique_ptr<base::Value> manifest = BuildTestManifest();
manifest->SetKey(kExpiryDateKey,
base::Value(MillisFromUnixEpoch(
base::Time::Now() - base::TimeDelta::FromDays(1))));
manifest->SetKey(
kExpiryDateKey,
base::Value(MillisFromUnixEpoch(base::Time::Now() - base::Days(1))));
auto policy =
std::make_unique<AwAppsPackageNamesAllowlistComponentLoaderPolicy>(

@ -71,7 +71,7 @@ class VizClient : public viz::mojom::CompositorFrameSinkClient {
int max_pending_frames,
int frame_rate)
: max_pending_frames_(max_pending_frames),
frame_interval_(base::TimeDelta::FromSeconds(1) / frame_rate) {
frame_interval_(base::Seconds(1) / frame_rate) {
support_ = std::make_unique<viz::CompositorFrameSinkSupport>(
this,
VizCompositorThreadRunnerWebView::GetInstance()->GetFrameSinkManager(),

@ -242,7 +242,7 @@ void JNI_AwMetricsServiceClient_SetUploadIntervalForTesting(
JNIEnv* env,
jlong upload_interval_ms) {
AwMetricsServiceClient::GetInstance()->SetUploadIntervalForTesting(
base::TimeDelta::FromMilliseconds(upload_interval_ms));
base::Milliseconds(upload_interval_ms));
}
// static
@ -263,8 +263,7 @@ void JNI_AwMetricsServiceClient_SetAppPackageNameLoggingRuleForTesting(
AwMetricsServiceClient::GetInstance()->SetAppPackageNameLoggingRule(
AppPackageNameLoggingRule(
base::Version(base::android::ConvertJavaStringToUTF8(env, version)),
base::Time::UnixEpoch() +
base::TimeDelta::FromMilliseconds(expiry_date_ms)));
base::Time::UnixEpoch() + base::Milliseconds(expiry_date_ms)));
}
} // namespace android_webview

@ -91,7 +91,7 @@ TEST_F(AwMetricsServiceClientTest, TestShouldRecordPackageName_WithCache) {
AwMetricsServiceClient* client = GetClient();
TestingPrefServiceSimple* prefs = GetPrefs();
auto one_day_from_now = base::Time::Now() + base::TimeDelta::FromDays(1);
auto one_day_from_now = base::Time::Now() + base::Days(1);
AppPackageNameLoggingRule expected_record(
base::Version(kTestAllowlistVersion), one_day_from_now);
prefs->Set(prefs::kMetricsAppPackageNameLoggingRule,
@ -146,7 +146,7 @@ TEST_F(AwMetricsServiceClientTest,
scoped_list.InitAndEnableFeature(
android_webview::features::kWebViewAppsPackageNamesAllowlist);
auto one_day_from_now = base::Time::Now() + base::TimeDelta::FromDays(1);
auto one_day_from_now = base::Time::Now() + base::Days(1);
AwMetricsServiceClient* client = GetClient();
AppPackageNameLoggingRule expected_record(
@ -175,7 +175,7 @@ TEST_F(AwMetricsServiceClientTest,
scoped_list.InitAndEnableFeature(
android_webview::features::kWebViewAppsPackageNamesAllowlist);
auto one_day_from_now = base::Time::Now() + base::TimeDelta::FromDays(1);
auto one_day_from_now = base::Time::Now() + base::Days(1);
AwMetricsServiceClient* client = GetClient();
AppPackageNameLoggingRule expected_record(
@ -229,9 +229,8 @@ TEST_F(AwMetricsServiceClientTest, TestShouldRecordPackageName_SameAsCache) {
AwMetricsServiceClient* client = GetClient();
TestingPrefServiceSimple* prefs = GetPrefs();
AppPackageNameLoggingRule record(
base::Version(kTestAllowlistVersion),
base::Time::Now() + base::TimeDelta::FromDays(1));
AppPackageNameLoggingRule record(base::Version(kTestAllowlistVersion),
base::Time::Now() + base::Days(1));
prefs->Set(prefs::kMetricsAppPackageNameLoggingRule, record.ToDictionary());
client->SetAppPackageNameLoggingRule(record);

@ -222,20 +222,20 @@ void VisibilityMetricsLogger::RecordVisibilityMetrics() {
any_webview_visible_seconds =
visible_duration_tracker_.any_webview_tracked_duration_.InSeconds();
visible_duration_tracker_.any_webview_tracked_duration_ -=
base::TimeDelta::FromSeconds(any_webview_visible_seconds);
base::Seconds(any_webview_visible_seconds);
no_webview_visible_seconds =
visible_duration_tracker_.no_webview_tracked_duration_.InSeconds();
visible_duration_tracker_.no_webview_tracked_duration_ -=
base::TimeDelta::FromSeconds(no_webview_visible_seconds);
base::Seconds(no_webview_visible_seconds);
total_webview_visible_seconds =
visible_duration_tracker_.per_webview_duration_.InSeconds();
visible_duration_tracker_.per_webview_duration_ -=
base::TimeDelta::FromSeconds(total_webview_visible_seconds);
base::Seconds(total_webview_visible_seconds);
total_no_webview_visible_seconds =
visible_duration_tracker_.per_webview_untracked_duration_.InSeconds();
visible_duration_tracker_.per_webview_untracked_duration_ -=
base::TimeDelta::FromSeconds(total_no_webview_visible_seconds);
base::Seconds(total_no_webview_visible_seconds);
if (any_webview_visible_seconds) {
GetGlobalVisibilityHistogram()->AddCount(
@ -266,20 +266,20 @@ void VisibilityMetricsLogger::RecordOpenWebDisplayMetrics() {
any_webcontent_visible_seconds =
webcontent_visible_tracker_.any_webview_tracked_duration_.InSeconds();
webcontent_visible_tracker_.any_webview_tracked_duration_ -=
base::TimeDelta::FromSeconds(any_webcontent_visible_seconds);
base::Seconds(any_webcontent_visible_seconds);
no_webcontent_visible_seconds =
webcontent_visible_tracker_.no_webview_tracked_duration_.InSeconds();
webcontent_visible_tracker_.no_webview_tracked_duration_ -=
base::TimeDelta::FromSeconds(no_webcontent_visible_seconds);
base::Seconds(no_webcontent_visible_seconds);
total_webcontent_isible_seconds =
webcontent_visible_tracker_.per_webview_duration_.InSeconds();
webcontent_visible_tracker_.per_webview_duration_ -=
base::TimeDelta::FromSeconds(total_webcontent_isible_seconds);
base::Seconds(total_webcontent_isible_seconds);
total_not_webcontent_or_not_visible_seconds =
webcontent_visible_tracker_.per_webview_untracked_duration_.InSeconds();
webcontent_visible_tracker_.per_webview_untracked_duration_ -=
base::TimeDelta::FromSeconds(total_not_webcontent_or_not_visible_seconds);
base::Seconds(total_not_webcontent_or_not_visible_seconds);
if (any_webcontent_visible_seconds) {
GetGlobalOpenWebVisibilityHistogram()->AddCount(
@ -313,7 +313,7 @@ void VisibilityMetricsLogger::RecordScreenPortionMetrics() {
continue;
open_web_screen_portion_tracked_duration_[i] -=
base::TimeDelta::FromSeconds(elapsed_seconds);
base::Seconds(elapsed_seconds);
GetOpenWebVisibileScreenPortionHistogram()->AddCount(i, elapsed_seconds);
}
}

@ -116,17 +116,14 @@ class VisibilityMetricsLogger {
struct WebViewDurationTracker {
// Duration any WebView meets the tracking criteria
base::TimeDelta any_webview_tracked_duration_ =
base::TimeDelta::FromSeconds(0);
base::TimeDelta any_webview_tracked_duration_ = base::Seconds(0);
// Duration no WebViews meet the tracking criteria
base::TimeDelta no_webview_tracked_duration_ =
base::TimeDelta::FromSeconds(0);
base::TimeDelta no_webview_tracked_duration_ = base::Seconds(0);
// Total duration that WebViews meet the tracking criteria (i.e. if
// 2x WebViews meet the criteria for 1 second then increment by 2 seconds)
base::TimeDelta per_webview_duration_ = base::TimeDelta::FromSeconds(0);
base::TimeDelta per_webview_duration_ = base::Seconds(0);
// Total duration that WebViews exist but do not meet the tracking criteria
base::TimeDelta per_webview_untracked_duration_ =
base::TimeDelta::FromSeconds(0);
base::TimeDelta per_webview_untracked_duration_ = base::Seconds(0);
};
WebViewDurationTracker visible_duration_tracker_;

@ -89,14 +89,14 @@ TEST_F(VisibilityMetricsLoggerTest, TestFractionalSecondAccumulation) {
client->SetViewAttached(true);
client->SetWindowVisible(true);
task_environment().FastForwardBy(base::TimeDelta::FromMilliseconds(500));
task_environment().FastForwardBy(base::Milliseconds(500));
logger()->RecordMetrics();
histogram_tester.ExpectBucketCount(
"Android.WebView.Visibility.Global",
VisibilityMetricsLogger::Visibility::kVisible, 0);
task_environment().FastForwardBy(base::TimeDelta::FromMilliseconds(500));
task_environment().FastForwardBy(base::Milliseconds(500));
logger()->RecordMetrics();
histogram_tester.ExpectBucketCount(
@ -109,16 +109,16 @@ TEST_F(VisibilityMetricsLoggerTest, TestFractionalSecondAccumulation) {
TEST_F(VisibilityMetricsLoggerTest, TestSingleVisibleClient) {
base::HistogramTester histogram_tester;
task_environment().FastForwardBy(base::TimeDelta::FromSeconds(10));
task_environment().FastForwardBy(base::Seconds(10));
std::unique_ptr<TestClient> client = std::make_unique<TestClient>(logger());
task_environment().FastForwardBy(base::TimeDelta::FromSeconds(30));
task_environment().FastForwardBy(base::Seconds(30));
client->SetViewVisible(true);
client->SetViewAttached(true);
client->SetWindowVisible(true);
client->SetSchemeHttpOrHttps(true);
task_environment().FastForwardBy(base::TimeDelta::FromSeconds(10));
task_environment().FastForwardBy(base::Seconds(10));
client->SetWindowVisible(false);
logger()->RecordMetrics();
@ -143,7 +143,7 @@ TEST_F(VisibilityMetricsLoggerTest, TestSingleVisibleClient) {
client->SetViewAttached(true);
client->SetWindowVisible(true);
client->SetSchemeHttpOrHttps(false);
task_environment().FastForwardBy(base::TimeDelta::FromSeconds(90));
task_environment().FastForwardBy(base::Seconds(90));
logger()->RecordMetrics();
histogram_tester.ExpectBucketCount(
@ -170,20 +170,20 @@ TEST_F(VisibilityMetricsLoggerTest, TestLongDurationVisibleClient) {
std::unique_ptr<TestClient> client1 = std::make_unique<TestClient>(logger());
std::unique_ptr<TestClient> client2 = std::make_unique<TestClient>(logger());
task_environment().FastForwardBy(base::TimeDelta::FromSeconds(300));
task_environment().FastForwardBy(base::Seconds(300));
client1->SetViewVisible(true);
client1->SetViewAttached(true);
client1->SetWindowVisible(true);
task_environment().FastForwardBy(base::TimeDelta::FromSeconds(50));
task_environment().FastForwardBy(base::Seconds(50));
client2->SetViewVisible(true);
client2->SetViewAttached(true);
client2->SetWindowVisible(true);
task_environment().FastForwardBy(base::TimeDelta::FromSeconds(50));
task_environment().FastForwardBy(base::Seconds(50));
client2.reset();
task_environment().FastForwardBy(base::TimeDelta::FromSeconds(50));
task_environment().FastForwardBy(base::Seconds(50));
client1.reset();
logger()->RecordMetrics();
@ -217,32 +217,32 @@ TEST_F(VisibilityMetricsLoggerTest, TestTwoVisibleClients) {
base::HistogramTester histogram_tester;
std::unique_ptr<TestClient> client1 = std::make_unique<TestClient>(logger());
task_environment().FastForwardBy(base::TimeDelta::FromSeconds(10));
task_environment().FastForwardBy(base::Seconds(10));
std::unique_ptr<TestClient> client2 = std::make_unique<TestClient>(logger());
task_environment().FastForwardBy(base::TimeDelta::FromSeconds(30));
task_environment().FastForwardBy(base::Seconds(30));
// This queues delayed recording after 60 seconds (test-defined)
client1->SetViewVisible(true);
client1->SetViewAttached(true);
client1->SetWindowVisible(true);
task_environment().FastForwardBy(base::TimeDelta::FromSeconds(10));
task_environment().FastForwardBy(base::Seconds(10));
// No additional task is queued
client2->SetViewVisible(true);
client2->SetViewAttached(true);
client2->SetWindowVisible(true);
task_environment().FastForwardBy(base::TimeDelta::FromSeconds(10));
task_environment().FastForwardBy(base::Seconds(10));
// This does not cause metrics to be recorded because one client remains
// visible.
client1->SetWindowVisible(false);
task_environment().FastForwardBy(base::TimeDelta::FromSeconds(10));
task_environment().FastForwardBy(base::Seconds(10));
// The last client becoming invisible triggers immediate recording and the
// cancellation of the queued task.
client2->SetWindowVisible(false);
task_environment().FastForwardBy(base::TimeDelta::FromSeconds(30));
task_environment().FastForwardBy(base::Seconds(30));
client1.reset();
client2.reset();
@ -284,36 +284,36 @@ TEST_F(VisibilityMetricsLoggerTest, TestTwoVisibleWebContentClients) {
base::HistogramTester histogram_tester;
std::unique_ptr<TestClient> client1 = std::make_unique<TestClient>(logger());
task_environment().FastForwardBy(base::TimeDelta::FromSeconds(10));
task_environment().FastForwardBy(base::Seconds(10));
std::unique_ptr<TestClient> client2 = std::make_unique<TestClient>(logger());
task_environment().FastForwardBy(base::TimeDelta::FromSeconds(30));
task_environment().FastForwardBy(base::Seconds(30));
// This queues delayed recording after 60 seconds (test-defined)
client1->SetViewVisible(true);
client1->SetViewAttached(true);
client1->SetWindowVisible(true);
task_environment().FastForwardBy(base::TimeDelta::FromSeconds(10));
task_environment().FastForwardBy(base::Seconds(10));
// No additional task is queued
client1->SetSchemeHttpOrHttps(true);
task_environment().FastForwardBy(base::TimeDelta::FromSeconds(10));
task_environment().FastForwardBy(base::Seconds(10));
// No additional task is queued
client2->SetViewVisible(true);
client2->SetViewAttached(true);
client2->SetWindowVisible(true);
task_environment().FastForwardBy(base::TimeDelta::FromSeconds(10));
task_environment().FastForwardBy(base::Seconds(10));
// This does not cause metrics to be recorded because one client remains
// visible.
client1->SetWindowVisible(false);
task_environment().FastForwardBy(base::TimeDelta::FromSeconds(10));
task_environment().FastForwardBy(base::Seconds(10));
// The last client becoming invisible triggers immediate recording and the
// cancellation of the queued task.
client2->SetWindowVisible(false);
task_environment().FastForwardBy(base::TimeDelta::FromSeconds(20));
task_environment().FastForwardBy(base::Seconds(20));
client1.reset();
client2.reset();

@ -72,10 +72,10 @@ net::NetworkChangeNotifier::NetworkChangeCalculatorParams
AwNetworkChangeNotifier::DefaultNetworkChangeCalculatorParams() {
net::NetworkChangeNotifier::NetworkChangeCalculatorParams params;
// Use defaults as in network_change_notifier_android.cc
params.ip_address_offline_delay_ = base::TimeDelta::FromSeconds(1);
params.ip_address_online_delay_ = base::TimeDelta::FromSeconds(1);
params.connection_type_offline_delay_ = base::TimeDelta::FromSeconds(0);
params.connection_type_online_delay_ = base::TimeDelta::FromSeconds(0);
params.ip_address_offline_delay_ = base::Seconds(1);
params.ip_address_online_delay_ = base::Seconds(1);
params.connection_type_offline_delay_ = base::Seconds(0);
params.connection_type_online_delay_ = base::Seconds(0);
return params;
}

@ -246,9 +246,9 @@ TEST_F(AndroidWebViewStateSerializerTest,
EXPECT_EQ(base_url_for_data_url, copy->GetBaseURLForDataURL());
EXPECT_FALSE(copy->GetDataURLAsString());
EXPECT_EQ(is_overriding_user_agent, copy->GetIsOverridingUserAgent());
EXPECT_EQ(base::Time::FromDeltaSinceWindowsEpoch(
base::TimeDelta::FromMicroseconds(timestamp)),
copy->GetTimestamp());
EXPECT_EQ(
base::Time::FromDeltaSinceWindowsEpoch(base::Microseconds(timestamp)),
copy->GetTimestamp());
EXPECT_EQ(http_status_code, copy->GetHttpStatusCode());
}

@ -29,8 +29,7 @@ class AppPackageNameLoggingRuleTest : public testing::Test {
TEST_F(AppPackageNameLoggingRuleTest, TestFromDictionary) {
base::Version version(kTestAllowlistVersion);
base::Time one_day_from_now =
base::Time::Now() + base::TimeDelta::FromDays(1);
base::Time one_day_from_now = base::Time::Now() + base::Days(1);
{
AppPackageNameLoggingRule expected_record(version, one_day_from_now);
absl::optional<AppPackageNameLoggingRule> record =

@ -55,7 +55,7 @@ void AwRenderThreadObserver::EnableIdleThrottling(int32_t policy,
float min_cputime_ratio) {
power_scheduler::SchedulingPolicyParams params{
(power_scheduler::SchedulingPolicy)policy,
base::TimeDelta::FromMilliseconds(min_time_ms), min_cputime_ratio};
base::Milliseconds(min_time_ms), min_cputime_ratio};
power_scheduler::PowerScheduler::GetInstance()->SetPolicy(params);
}

@ -141,8 +141,7 @@ constexpr char kSideVolumeButtonLocationFilePath[] =
"/usr/share/chromeos-assets/side_volume_button/location.json";
// The interval between two volume control actions within one volume adjust.
constexpr base::TimeDelta kVolumeAdjustTimeout =
base::TimeDelta::FromSeconds(2);
constexpr base::TimeDelta kVolumeAdjustTimeout = base::Seconds(2);
// These values are written to logs. New enum values can be added, but existing
// enums must never be renumbered or deleted and reused.

@ -127,8 +127,7 @@ void ExitWarningHandler::TimerAction() {
void ExitWarningHandler::StartTimer() {
if (stub_timer_for_test_)
return;
timer_.Start(FROM_HERE,
base::TimeDelta::FromMilliseconds(kTimeOutMilliseconds), this,
timer_.Start(FROM_HERE, base::Milliseconds(kTimeOutMilliseconds), this,
&ExitWarningHandler::TimerAction);
}

@ -95,16 +95,14 @@ constexpr size_t kDataSize = 2;
constexpr int kSizeOfReading = kDataSize * kNumberOfAxes;
// The time to wait between reading the accelerometer.
constexpr base::TimeDelta kDelayBetweenReads =
base::TimeDelta::FromMilliseconds(100);
constexpr base::TimeDelta kDelayBetweenReads = base::Milliseconds(100);
// The TimeDelta before giving up on initialization. This is needed because the
// sensor hub might not be online when the Initialize function is called.
constexpr base::TimeDelta kInitializeTimeout = base::TimeDelta::FromSeconds(5);
constexpr base::TimeDelta kInitializeTimeout = base::Seconds(5);
// The time between initialization checks.
constexpr base::TimeDelta kDelayBetweenInitChecks =
base::TimeDelta::FromMilliseconds(500);
constexpr base::TimeDelta kDelayBetweenInitChecks = base::Milliseconds(500);
// Reads |path| to the unsigned int pointed to by |value|. Returns true on
// success or false on failure.

@ -22,12 +22,10 @@ namespace ash {
namespace {
// Delay of the reconnection to Sensor Hal Dispatcher.
constexpr base::TimeDelta kDelayReconnect =
base::TimeDelta::FromMilliseconds(1000);
constexpr base::TimeDelta kDelayReconnect = base::Milliseconds(1000);
// Timeout for the late-present devices: 10 seconds.
constexpr base::TimeDelta kNewDevicesTimeout =
base::TimeDelta::FromMilliseconds(10000);
constexpr base::TimeDelta kNewDevicesTimeout = base::Milliseconds(10000);
} // namespace

@ -1610,7 +1610,7 @@ void AccessibilityControllerImpl::ObservePrefs(PrefService* prefs) {
void AccessibilityControllerImpl::UpdateAutoclickDelayFromPref() {
DCHECK(active_user_prefs_);
base::TimeDelta autoclick_delay = base::TimeDelta::FromMilliseconds(int64_t{
base::TimeDelta autoclick_delay = base::Milliseconds(int64_t{
active_user_prefs_->GetInteger(prefs::kAccessibilityAutoclickDelayMs)});
if (autoclick_delay_ == autoclick_delay)

@ -69,7 +69,7 @@ views::Widget::InitParams CreateAutoclickOverlayWidgetParams(
// static.
base::TimeDelta AutoclickController::GetDefaultAutoclickDelay() {
return base::TimeDelta::FromMilliseconds(int64_t{kDefaultAutoclickDelayMs});
return base::Milliseconds(int64_t{kDefaultAutoclickDelayMs});
}
AutoclickController::AutoclickController()

@ -43,8 +43,8 @@ class AutoclickScrollPositionHandler : public gfx::AnimationDelegate {
void SetScrollPointCenterInScreen(const gfx::Point& scroll_point_center);
private:
static constexpr auto kOpaqueTime = base::TimeDelta::FromMilliseconds(500);
static constexpr auto kFadeTime = base::TimeDelta::FromMilliseconds(500);
static constexpr auto kOpaqueTime = base::Milliseconds(500);
static constexpr auto kFadeTime = base::Milliseconds(500);
// gfx::AnimationDelegate:
void AnimationProgressed(const gfx::Animation* animation) override;

@ -145,8 +145,7 @@ class AutoclickTest : public AshTestBase {
}
void FastForwardBy(int milliseconds) {
task_environment()->FastForwardBy(
base::TimeDelta::FromMilliseconds(milliseconds));
task_environment()->FastForwardBy(base::Milliseconds(milliseconds));
}
AutoclickController* GetAutoclickController() {
@ -159,8 +158,7 @@ class AutoclickTest : public AshTestBase {
float ratio =
GetAutoclickController()->GetStartGestureDelayRatioForTesting();
int full_delay = ceil(1.0 / ratio) * animation_delay;
GetAutoclickController()->SetAutoclickDelay(
base::TimeDelta::FromMilliseconds(full_delay));
GetAutoclickController()->SetAutoclickDelay(base::Milliseconds(full_delay));
return full_delay;
}
@ -486,16 +484,14 @@ TEST_F(AutoclickTest, UserInputCancelsAutoclick) {
// Test another gesture.
GetEventGenerator()->MoveMouseTo(100, 100);
GetEventGenerator()->GestureScrollSequence(
gfx::Point(100, 100), gfx::Point(200, 200),
base::TimeDelta::FromMilliseconds(200), 3);
gfx::Point(100, 100), gfx::Point(200, 200), base::Milliseconds(200), 3);
events = WaitForMouseEvents();
EXPECT_EQ(0u, events.size());
// Test scroll events.
GetEventGenerator()->MoveMouseTo(200, 200);
GetEventGenerator()->ScrollSequence(gfx::Point(100, 100),
base::TimeDelta::FromMilliseconds(200), 0,
100, 3, 2);
base::Milliseconds(200), 0, 100, 3, 2);
events = WaitForMouseEvents();
EXPECT_EQ(0u, events.size());

@ -43,7 +43,7 @@ class KeyAccessibilityEnablerTest : public AshTestBase,
void WaitForAccessibilityStatusChanged() {
run_loop_ = std::make_unique<base::RunLoop>();
clock_.Advance(base::TimeDelta::FromMilliseconds(5000));
clock_.Advance(base::Milliseconds(5000));
run_loop_->Run();
}

@ -14,7 +14,7 @@ namespace ash {
namespace {
// Delay between timer callbacks. Each one plays a tick sound.
constexpr base::TimeDelta kTimerDelay = base::TimeDelta::FromMilliseconds(500);
constexpr base::TimeDelta kTimerDelay = base::Milliseconds(500);
// The number of ticks of the timer before the first sound is generated.
constexpr int kTimerTicksOfFirstSoundFeedback = 6;

@ -25,7 +25,7 @@ namespace ash {
namespace {
// Delay between timer callbacks. Each one plays a tick sound.
constexpr auto kTimerDelay = base::TimeDelta::FromMilliseconds(500);
constexpr auto kTimerDelay = base::Milliseconds(500);
// The number of ticks of the timer before the first sound is generated.
constexpr int kTimerTicksOfFirstSoundFeedback = 6;

@ -75,7 +75,7 @@ class TouchAccessibilityEnablerTest : public aura::test::AuraTestBase {
generator_ = std::make_unique<ui::test::EventGenerator>(root_window());
// Tests fail if time is ever 0.
simulated_clock_.Advance(base::TimeDelta::FromMilliseconds(10));
simulated_clock_.Advance(base::Milliseconds(10));
ui::SetEventTickClockForTesting(&simulated_clock_);
enabler_ =
@ -119,7 +119,7 @@ TEST_F(TouchAccessibilityEnablerTest, InteractsWithTouchExplorationController) {
generator_->set_current_screen_location(gfx::Point(11, 12));
generator_->PressTouchId(1);
simulated_clock_.Advance(base::TimeDelta::FromMilliseconds(500));
simulated_clock_.Advance(base::Milliseconds(500));
generator_->set_current_screen_location(gfx::Point(22, 34));
generator_->PressTouchId(2);
@ -168,7 +168,7 @@ TEST_F(TouchAccessibilityEnablerTest, PlaysProgressSound) {
enabler_->TriggerOnTimerForTesting();
EXPECT_EQ(0U, delegate_.feedback_progress_sound_count());
simulated_clock_.Advance(base::TimeDelta::FromMilliseconds(3000));
simulated_clock_.Advance(base::Milliseconds(3000));
enabler_->TriggerOnTimerForTesting();
EXPECT_EQ(1U, delegate_.feedback_progress_sound_count());
}
@ -189,7 +189,7 @@ TEST_F(TouchAccessibilityEnablerTest, TogglesSpokenFeedback) {
enabler_->TriggerOnTimerForTesting();
EXPECT_FALSE(delegate_.toggle_spoken_feedback());
simulated_clock_.Advance(base::TimeDelta::FromMilliseconds(5000));
simulated_clock_.Advance(base::Milliseconds(5000));
enabler_->TriggerOnTimerForTesting();
EXPECT_TRUE(delegate_.toggle_spoken_feedback());
EXPECT_TRUE(delegate_.started());

@ -46,7 +46,7 @@ const int kSoundDelayInMS = 150;
// How long the user must stay in the same anchor point in touch exploration
// before a right-click is triggered.
const base::TimeDelta kLongPressTimerDelay = base::TimeDelta::FromSeconds(5);
const base::TimeDelta kLongPressTimerDelay = base::Seconds(5);
void SetTouchAccessibilityFlag(ui::Event* event) {
// This flag is used to identify mouse move events that were generated from
@ -711,8 +711,7 @@ ui::EventDispatchDetails TouchExplorationController::InSlideGesture(
// This can occur if the user leaves the screen edge and then returns to it to
// continue adjusting the sound.
if (!sound_timer_.IsRunning()) {
sound_timer_.Start(FROM_HERE,
base::TimeDelta::FromMilliseconds(kSoundDelayInMS), this,
sound_timer_.Start(FROM_HERE, base::Milliseconds(kSoundDelayInMS), this,
&TouchExplorationController::PlaySoundForTimer);
delegate_->PlayVolumeAdjustEarcon();
}

@ -183,7 +183,7 @@ class TouchExplorationTest : public aura::test::AuraTestBase {
generator_ = std::make_unique<ui::test::EventGenerator>(root_window());
// Tests fail if time is ever 0.
simulated_clock_.Advance(base::TimeDelta::FromMilliseconds(10));
simulated_clock_.Advance(base::Milliseconds(10));
// ui takes ownership of the tick clock.
ui::SetEventTickClockForTesting(&simulated_clock_);
@ -250,17 +250,17 @@ class TouchExplorationTest : public aura::test::AuraTestBase {
void AdvanceSimulatedTimePastTapDelay() {
simulated_clock_.Advance(gesture_detector_config_.double_tap_timeout);
simulated_clock_.Advance(base::TimeDelta::FromMilliseconds(1));
simulated_clock_.Advance(base::Milliseconds(1));
touch_exploration_controller_->CallTapTimerNowForTesting();
}
void AdvanceSimulatedTimePastPotentialTapDelay() {
simulated_clock_.Advance(base::TimeDelta::FromMilliseconds(1000));
simulated_clock_.Advance(base::Milliseconds(1000));
touch_exploration_controller_->CallTapTimerNowIfRunningForTesting();
}
void AdvanceSimulatedTimePastLongPressDelay() {
simulated_clock_.Advance(base::TimeDelta::FromMilliseconds(5000));
simulated_clock_.Advance(base::Milliseconds(5000));
touch_exploration_controller_->CallLongPressTimerNowIfRunningForTesting();
}
@ -570,7 +570,7 @@ TEST_F(TouchExplorationTest, TimerFiresLateDuringTouchExploration) {
// Send a press, then add another finger after the double-tap timeout.
generator_->PressTouchId(1);
simulated_clock_.Advance(base::TimeDelta::FromMilliseconds(1000));
simulated_clock_.Advance(base::Milliseconds(1000));
generator_->PressTouchId(2);
std::vector<ui::LocatedEvent*> events =
GetCapturedLocatedEventsOfType(ui::ET_MOUSE_MOVED);
@ -600,7 +600,7 @@ TEST_F(TouchExplorationTest, TimerFiresLateAfterTap) {
// timer fires.
gfx::Point location1(33, 34);
generator_->set_current_screen_location(location1);
simulated_clock_.Advance(base::TimeDelta::FromMilliseconds(301));
simulated_clock_.Advance(base::Milliseconds(301));
generator_->PressTouch();
generator_->ReleaseTouch();
AdvanceSimulatedTimePastTapDelay();
@ -649,9 +649,9 @@ TEST_F(TouchExplorationTest, DoubleTapTiming) {
generator_->PressTouch();
generator_->ReleaseTouch();
simulated_clock_.Advance(gesture_detector_config_.double_tap_timeout -
base::TimeDelta::FromMilliseconds(25));
base::Milliseconds(25));
generator_->PressTouch();
simulated_clock_.Advance(base::TimeDelta::FromMilliseconds(50));
simulated_clock_.Advance(base::Milliseconds(50));
generator_->ReleaseTouch();
std::vector<ui::LocatedEvent*> captured_events = GetCapturedLocatedEvents();
@ -823,7 +823,7 @@ TEST_F(TouchExplorationTest, SingleTap) {
// tapping again.
gfx::Point final_location(33, 34);
generator_->set_current_screen_location(final_location);
simulated_clock_.Advance(base::TimeDelta::FromMilliseconds(250));
simulated_clock_.Advance(base::Milliseconds(250));
generator_->PressTouch();
generator_->ReleaseTouch();
@ -1093,13 +1093,13 @@ TEST_F(TouchExplorationTest, EnterGestureInProgressState) {
gfx::Point touch_exploration_location(20, 21);
generator_->Dispatch(&first_press);
simulated_clock_.Advance(base::TimeDelta::FromMilliseconds(10));
simulated_clock_.Advance(base::Milliseconds(10));
// Since we are not out of the touch slop yet, we should not be in gesture in
// progress.
generator_->MoveTouch(second_location);
EXPECT_FALSE(IsInTouchToMouseMode());
EXPECT_FALSE(IsInGestureInProgressState());
simulated_clock_.Advance(base::TimeDelta::FromMilliseconds(10));
simulated_clock_.Advance(base::Milliseconds(10));
// Once we are out of slop, we should be in GestureInProgress.
generator_->MoveTouch(third_location);
@ -1377,7 +1377,7 @@ TEST_F(TouchExplorationTest, GestureAddedFinger) {
ui::ET_TOUCH_PRESSED, gfx::Point(100, 200), Now(),
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
generator_->Dispatch(&first_press);
simulated_clock_.Advance(base::TimeDelta::FromMilliseconds(10));
simulated_clock_.Advance(base::Milliseconds(10));
gfx::Point second_location(100 + distance, 200);
generator_->MoveTouch(second_location);
EXPECT_TRUE(IsInGestureInProgressState());
@ -1412,14 +1412,14 @@ TEST_F(TouchExplorationTest, EnterSlideGestureState) {
gfx::Point fourth_location(window_right, 35);
generator_->Dispatch(&first_press);
simulated_clock_.Advance(base::TimeDelta::FromMilliseconds(10));
simulated_clock_.Advance(base::Milliseconds(10));
// Since we haven't moved past slop yet, we should not be in slide gesture.
generator_->MoveTouch(second_location);
EXPECT_FALSE(IsInTouchToMouseMode());
EXPECT_FALSE(IsInGestureInProgressState());
EXPECT_FALSE(IsInSlideGestureState());
simulated_clock_.Advance(base::TimeDelta::FromMilliseconds(10));
simulated_clock_.Advance(base::Milliseconds(10));
// Once we are out of slop, we should be in slide gesture since we are along
// the edge of the screen.
@ -1472,13 +1472,13 @@ TEST_F(TouchExplorationTest, AvoidEnteringSlideGesture) {
gfx::Point into_boundaries(window.right() - GetMaxDistanceFromEdge() / 2, 1);
generator_->Dispatch(&first_press);
simulated_clock_.Advance(base::TimeDelta::FromMilliseconds(10));
simulated_clock_.Advance(base::Milliseconds(10));
generator_->MoveTouch(out_of_slop);
EXPECT_FALSE(IsInTouchToMouseMode());
EXPECT_TRUE(IsInGestureInProgressState());
EXPECT_FALSE(IsInSlideGestureState());
simulated_clock_.Advance(base::TimeDelta::FromMilliseconds(10));
simulated_clock_.Advance(base::Milliseconds(10));
// Since we did not start moving while in the boundaries, we should not be in
// slide gestures.
@ -1509,7 +1509,7 @@ TEST_F(TouchExplorationTest, TestingBoundaries) {
ui::ET_TOUCH_PRESSED, initial_press, Now(),
ui::PointerDetails(ui::EventPointerType::kTouch, 0));
generator_->Dispatch(&first_press);
simulated_clock_.Advance(base::TimeDelta::FromMilliseconds(10));
simulated_clock_.Advance(base::Milliseconds(10));
EXPECT_FALSE(IsInGestureInProgressState());
EXPECT_FALSE(IsInSlideGestureState());
EXPECT_FALSE(IsInTouchToMouseMode());
@ -1523,7 +1523,7 @@ TEST_F(TouchExplorationTest, TestingBoundaries) {
EXPECT_FALSE(IsInGestureInProgressState());
EXPECT_TRUE(IsInSlideGestureState());
EXPECT_FALSE(IsInTouchToMouseMode());
simulated_clock_.Advance(base::TimeDelta::FromMilliseconds(10));
simulated_clock_.Advance(base::Milliseconds(10));
// Move the touch into slop boundaries. It should still be in slide gestures
// and adjust the volume.
@ -1535,7 +1535,7 @@ TEST_F(TouchExplorationTest, TestingBoundaries) {
EXPECT_FALSE(IsInTouchToMouseMode());
// The sound is rate limiting so it only activates every 150ms.
simulated_clock_.Advance(base::TimeDelta::FromMilliseconds(200));
simulated_clock_.Advance(base::Milliseconds(200));
size_t num_adjust_sounds = delegate_.NumAdjustSounds();
ASSERT_EQ(1U, num_adjust_sounds);
@ -1548,7 +1548,7 @@ TEST_F(TouchExplorationTest, TestingBoundaries) {
EXPECT_TRUE(IsInSlideGestureState());
EXPECT_FALSE(IsInTouchToMouseMode());
simulated_clock_.Advance(base::TimeDelta::FromMilliseconds(200));
simulated_clock_.Advance(base::Milliseconds(200));
num_adjust_sounds = delegate_.NumAdjustSounds();
ASSERT_EQ(1U, num_adjust_sounds);
ASSERT_EQ(1U, delegate_.VolumeChanges().size());
@ -1563,7 +1563,7 @@ TEST_F(TouchExplorationTest, TestingBoundaries) {
generator_->MoveTouch(
gfx::Point(into_slop_boundaries.x() + gesture_detector_config_.touch_slop,
into_slop_boundaries.y()));
simulated_clock_.Advance(base::TimeDelta::FromMilliseconds(200));
simulated_clock_.Advance(base::Milliseconds(200));
num_adjust_sounds = delegate_.NumAdjustSounds();
ASSERT_EQ(2U, num_adjust_sounds);

@ -224,7 +224,7 @@ void DockedMagnifierController::CenterOnPoint(
// point of interest due to input caret bounds changes ... etc.).
ui::ScopedLayerAnimationSettings settings(
viewport_magnifier_layer_->GetAnimator());
settings.SetTransitionDuration(base::TimeDelta::FromMilliseconds(0));
settings.SetTransitionDuration(base::Milliseconds(0));
settings.SetTweenType(gfx::Tween::ZERO);
settings.SetPreemptionStrategy(ui::LayerAnimator::IMMEDIATELY_SET_NEW_TARGET);
viewport_magnifier_layer_->SetTransform(transform);

@ -529,8 +529,7 @@ bool FullscreenMagnifierController::RedrawDIP(
const ui::LayerAnimator::PreemptionStrategy strategy =
ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET;
const base::TimeDelta duration =
base::TimeDelta::FromMilliseconds(duration_in_ms);
const base::TimeDelta duration = base::Milliseconds(duration_in_ms);
ui::ScopedLayerAnimationSettings root_layer_settings(
root_window_->layer()->GetAnimator());

@ -35,8 +35,7 @@ constexpr int kLeftEdgeContextPadding = 32;
// (~16ms assuming 60hz screen updates), however most importantly keep it short,
// so e.g. when user focuses an element, and then starts typing, the viewport
// quickly moves to the caret position.
constexpr base::TimeDelta kPauseCaretUpdateDuration =
base::TimeDelta::FromMilliseconds(15);
constexpr base::TimeDelta kPauseCaretUpdateDuration = base::Milliseconds(15);
// Calculates the new scale if it were to be adjusted exponentially by the
// given |linear_offset|. This allows linear changes in scroll offset

@ -252,8 +252,7 @@ void StickyKeysOverlay::Show(bool visible) {
settings.SetPreemptionStrategy(
ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET);
settings.SetTweenType(visible ? gfx::Tween::EASE_OUT : gfx::Tween::EASE_IN);
settings.SetTransitionDuration(
base::TimeDelta::FromMilliseconds(kSlideAnimationDurationMs));
settings.SetTransitionDuration(base::Milliseconds(kSlideAnimationDurationMs));
overlay_widget_->GetLayer()->SetTransform(gfx::Transform());
}

@ -5,7 +5,7 @@
#include "ash/accessibility/switch_access/point_scan_layer_animation_info.h"
namespace {
constexpr base::TimeDelta kLingerDelay = base::TimeDelta::FromMilliseconds(250);
constexpr base::TimeDelta kLingerDelay = base::Milliseconds(250);
}
namespace ash {

@ -29,7 +29,7 @@ class TestAccessibilityControllerClient : public AccessibilityControllerClient {
~TestAccessibilityControllerClient();
static constexpr base::TimeDelta kShutdownSoundDuration =
base::TimeDelta::FromMilliseconds(1000);
base::Milliseconds(1000);
// AccessibilityControllerClient:
void TriggerAccessibilityAlert(AccessibilityAlert alert) override;

@ -45,13 +45,13 @@ constexpr float kHighlightOpacity = 0.3f;
AccessibilityFocusRingControllerImpl::AccessibilityFocusRingControllerImpl() {
cursor_animation_info_.fade_in_time =
base::TimeDelta::FromMilliseconds(kCursorFadeInTimeMilliseconds);
base::Milliseconds(kCursorFadeInTimeMilliseconds);
cursor_animation_info_.fade_out_time =
base::TimeDelta::FromMilliseconds(kCursorFadeOutTimeMilliseconds);
base::Milliseconds(kCursorFadeOutTimeMilliseconds);
caret_animation_info_.fade_in_time =
base::TimeDelta::FromMilliseconds(kCaretFadeInTimeMilliseconds);
base::Milliseconds(kCaretFadeInTimeMilliseconds);
caret_animation_info_.fade_out_time =
base::TimeDelta::FromMilliseconds(kCaretFadeOutTimeMilliseconds);
base::Milliseconds(kCaretFadeOutTimeMilliseconds);
}
AccessibilityFocusRingControllerImpl::~AccessibilityFocusRingControllerImpl() =
@ -156,13 +156,12 @@ void AccessibilityFocusRingControllerImpl::SetNoFadeForTesting() {
++iter) {
iter->second->set_no_fade_for_testing();
iter->second->focus_animation_info()->fade_in_time = base::TimeDelta();
iter->second->focus_animation_info()->fade_out_time =
base::TimeDelta::FromHours(1);
iter->second->focus_animation_info()->fade_out_time = base::Hours(1);
}
cursor_animation_info_.fade_in_time = base::TimeDelta();
cursor_animation_info_.fade_out_time = base::TimeDelta::FromHours(1);
cursor_animation_info_.fade_out_time = base::Hours(1);
caret_animation_info_.fade_in_time = base::TimeDelta();
caret_animation_info_.fade_out_time = base::TimeDelta::FromHours(1);
caret_animation_info_.fade_out_time = base::Hours(1);
}
const AccessibilityFocusRingGroup*

@ -47,9 +47,9 @@ struct Region {
AccessibilityFocusRingGroup::AccessibilityFocusRingGroup() {
focus_animation_info_.fade_in_time =
base::TimeDelta::FromMilliseconds(kFocusFadeInTimeMilliseconds);
base::Milliseconds(kFocusFadeInTimeMilliseconds);
focus_animation_info_.fade_out_time =
base::TimeDelta::FromMilliseconds(kFocusFadeOutTimeMilliseconds);
base::Milliseconds(kFocusFadeOutTimeMilliseconds);
}
AccessibilityFocusRingGroup::~AccessibilityFocusRingGroup() {}
@ -113,7 +113,7 @@ bool AccessibilityFocusRingGroup::AnimateFocusRings(base::TimeTicks timestamp) {
if (focus_ring_info_->behavior == FocusRingBehavior::PERSIST) {
base::TimeDelta delta = timestamp - focus_animation_info_.change_time;
base::TimeDelta transition_time =
base::TimeDelta::FromMilliseconds(kTransitionTimeMilliseconds);
base::Milliseconds(kTransitionTimeMilliseconds);
if (delta >= transition_time) {
focus_layers_[0]->Set(focus_rings_[0]);
return true;

@ -11,22 +11,18 @@ namespace ash {
// Duration of the slide show animation. Also used as |delay| in posted task to
// download images.
constexpr base::TimeDelta kAnimationDuration =
base::TimeDelta::FromMilliseconds(500);
constexpr base::TimeDelta kAnimationDuration = base::Milliseconds(500);
// Topic related numbers.
// The default interval to fetch Topics.
constexpr base::TimeDelta kTopicFetchInterval =
base::TimeDelta::FromSeconds(30);
constexpr base::TimeDelta kTopicFetchInterval = base::Seconds(30);
// The default interval to fetch backup cache photos.
constexpr base::TimeDelta kBackupPhotoRefreshDelay =
base::TimeDelta::FromMinutes(5);
constexpr base::TimeDelta kBackupPhotoRefreshDelay = base::Minutes(5);
// The default interval to refresh weather.
constexpr base::TimeDelta kWeatherRefreshInterval =
base::TimeDelta::FromMinutes(5);
constexpr base::TimeDelta kWeatherRefreshInterval = base::Minutes(5);
// The batch size of topics to fetch in one request.
constexpr int kTopicsBatchSize = 100;
@ -52,8 +48,7 @@ constexpr char kAmbientModeCacheDirectoryName[] = "cache";
constexpr char kAmbientModeBackupCacheDirectoryName[] = "backup";
// The buffer time to use the access token.
constexpr base::TimeDelta kTokenUsageTimeBuffer =
base::TimeDelta::FromMinutes(10);
constexpr base::TimeDelta kTokenUsageTimeBuffer = base::Minutes(10);
// PhotoView related constants.
// Spacing between two portrait images.

@ -611,7 +611,7 @@ void AmbientController::OnLockScreenInactivityTimeoutPrefChanged() {
return;
ambient_ui_model_.SetLockScreenInactivityTimeout(
base::TimeDelta::FromSeconds(pref_service->GetInteger(
base::Seconds(pref_service->GetInteger(
ambient::prefs::kAmbientModeLockScreenInactivityTimeoutSeconds)));
}
@ -621,7 +621,7 @@ void AmbientController::OnLockScreenBackgroundTimeoutPrefChanged() {
return;
ambient_ui_model_.SetBackgroundLockScreenTimeout(
base::TimeDelta::FromSeconds(pref_service->GetInteger(
base::Seconds(pref_service->GetInteger(
ambient::prefs::kAmbientModeLockScreenBackgroundTimeoutSeconds)));
}
@ -631,7 +631,7 @@ void AmbientController::OnPhotoRefreshIntervalPrefChanged() {
return;
ambient_ui_model_.SetPhotoRefreshInterval(
base::TimeDelta::FromSeconds(pref_service->GetInteger(
base::Seconds(pref_service->GetInteger(
ambient::prefs::kAmbientModePhotoRefreshIntervalSeconds)));
}

@ -318,8 +318,7 @@ TEST_F(AmbientControllerTest, ShouldReturnEmptyAccessToken) {
base::RunLoop run_loop_2;
// When token expired, another token request will get empty token.
constexpr base::TimeDelta kTokenRefreshDelay =
base::TimeDelta::FromSeconds(60);
constexpr base::TimeDelta kTokenRefreshDelay = base::Seconds(60);
task_environment()->FastForwardBy(kTokenRefreshDelay);
closure = base::MakeExpectedRunClosure(FROM_HERE);

@ -30,7 +30,7 @@ TEST_F(AutotestAmbientApiTest,
base::RunLoop run_loop;
AutotestAmbientApi test_api;
test_api.WaitForPhotoTransitionAnimationCompleted(
/*num_completions=*/10, /*timeout=*/base::TimeDelta::FromSeconds(30),
/*num_completions=*/10, /*timeout=*/base::Seconds(30),
/*on_complete=*/run_loop.QuitClosure(),
/*on_timeout=*/base::BindOnce([]() { NOTREACHED(); }));
run_loop.Run();
@ -47,7 +47,7 @@ TEST_F(AutotestAmbientApiTest,
base::RunLoop run_loop;
AutotestAmbientApi test_api;
test_api.WaitForPhotoTransitionAnimationCompleted(
/*num_completions=*/10, /*timeout=*/base::TimeDelta::FromSeconds(5),
/*num_completions=*/10, /*timeout=*/base::Seconds(5),
/*on_complete=*/base::BindOnce([]() { NOTREACHED(); }),
/*on_timeout=*/run_loop.QuitClosure());
run_loop.Run();

@ -167,7 +167,7 @@ TEST_F(AmbientBackendModelTest, ShouldReturnExpectedPhotoRefreshInterval) {
EXPECT_EQ(GetPhotoRefreshInterval(), kPhotoRefreshInterval);
// Change the photo refresh interval.
const base::TimeDelta interval = base::TimeDelta::FromMinutes(1);
const base::TimeDelta interval = base::Minutes(1);
SetPhotoRefreshInterval(interval);
// The refresh interval will be the set value.
EXPECT_EQ(GetPhotoRefreshInterval(), interval);

@ -66,7 +66,7 @@ class TestAmbientPhotoCacheImpl : public AmbientPhotoCache {
// Pretend to respond asynchronously.
base::SequencedTaskRunnerHandle::Get()->PostDelayedTask(
FROM_HERE, base::BindOnce(std::move(callback), std::move(data)),
base::TimeDelta::FromMilliseconds(1));
base::Milliseconds(1));
}
void DownloadPhotoToFile(const std::string& url,
@ -174,8 +174,7 @@ void AmbientAshTestBase::SetUp() {
ambient_controller()->set_backend_controller_for_testing(nullptr);
ambient_controller()->set_backend_controller_for_testing(
std::make_unique<FakeAmbientBackendControllerImpl>());
token_controller()->SetTokenUsageBufferForTesting(
base::TimeDelta::FromSeconds(30));
token_controller()->SetTokenUsageBufferForTesting(base::Seconds(30));
SetAmbientModeEnabled(true);
base::RunLoop().RunUntilIdle();
}
@ -352,7 +351,7 @@ void AmbientAshTestBase::FastForwardToNextImage() {
void AmbientAshTestBase::FastForwardTiny() {
// `TestAmbientURLLoaderImpl` has a small delay (1ms) to fake download delay,
// here we fake plenty of time to download the image.
task_environment()->FastForwardBy(base::TimeDelta::FromMilliseconds(10));
task_environment()->FastForwardBy(base::Milliseconds(10));
}
void AmbientAshTestBase::FastForwardToBackgroundLockScreenTimeout() {

@ -18,8 +18,7 @@ namespace {
const char* kTestGaiaId = "0123456789";
constexpr base::TimeDelta kDefaultTokenExpirationDelay =
base::TimeDelta::FromSeconds(60);
constexpr base::TimeDelta kDefaultTokenExpirationDelay = base::Seconds(60);
// A simple SharedURLLoaderFactory implementation for tests.
class FakeSharedURLLoaderFactory : public network::SharedURLLoaderFactory {

@ -331,8 +331,7 @@ void MediaStringView::StartScrolling(bool is_initial) {
const int end_x = -(text_width + shadow_width) / 2;
const int transform_distance = start_x - end_x;
const base::TimeDelta kScrollingDuration =
base::TimeDelta::FromSeconds(10) * transform_distance /
kMediaStringMaxWidthDip;
base::Seconds(10) * transform_distance / kMediaStringMaxWidthDip;
ui::ScopedLayerAnimationSettings animation(text_layer->GetAnimator());
animation.SetTransitionDuration(kScrollingDuration);

@ -106,7 +106,7 @@ TEST_F(MediaStringViewTest, HasNoAnimationWithShortText) {
EXPECT_FALSE(
GetMediaStringViewTextLabel()->layer()->GetAnimator()->is_animating());
task_environment()->FastForwardBy(base::TimeDelta::FromMilliseconds(100));
task_environment()->FastForwardBy(base::Milliseconds(100));
EXPECT_FALSE(
GetMediaStringViewTextLabel()->layer()->GetAnimator()->is_animating());
}
@ -131,7 +131,7 @@ TEST_F(MediaStringViewTest, HasAnimationWithLongText) {
EXPECT_FALSE(
GetMediaStringViewTextLabel()->layer()->GetAnimator()->is_animating());
task_environment()->FastForwardBy(base::TimeDelta::FromMilliseconds(100));
task_environment()->FastForwardBy(base::Milliseconds(100));
EXPECT_TRUE(
GetMediaStringViewTextLabel()->layer()->GetAnimator()->is_animating());
}
@ -156,7 +156,7 @@ TEST_F(MediaStringViewTest, ShouldStopAndStartAnimationWhenTextChanges) {
EXPECT_FALSE(
GetMediaStringViewTextLabel()->layer()->GetAnimator()->is_animating());
task_environment()->FastForwardBy(base::TimeDelta::FromMilliseconds(100));
task_environment()->FastForwardBy(base::Milliseconds(100));
EXPECT_TRUE(
GetMediaStringViewTextLabel()->layer()->GetAnimator()->is_animating());
@ -170,7 +170,7 @@ TEST_F(MediaStringViewTest, ShouldStopAndStartAnimationWhenTextChanges) {
EXPECT_FALSE(
GetMediaStringViewTextLabel()->layer()->GetAnimator()->is_animating());
task_environment()->FastForwardBy(base::TimeDelta::FromMilliseconds(100));
task_environment()->FastForwardBy(base::Milliseconds(100));
EXPECT_TRUE(
GetMediaStringViewTextLabel()->layer()->GetAnimator()->is_animating());
}
@ -195,7 +195,7 @@ TEST_F(MediaStringViewTest, ShouldStartAndStopAnimationWhenTextChanges) {
EXPECT_FALSE(
GetMediaStringViewTextLabel()->layer()->GetAnimator()->is_animating());
task_environment()->FastForwardBy(base::TimeDelta::FromMilliseconds(100));
task_environment()->FastForwardBy(base::Milliseconds(100));
EXPECT_FALSE(
GetMediaStringViewTextLabel()->layer()->GetAnimator()->is_animating());
@ -209,7 +209,7 @@ TEST_F(MediaStringViewTest, ShouldStartAndStopAnimationWhenTextChanges) {
EXPECT_FALSE(
GetMediaStringViewTextLabel()->layer()->GetAnimator()->is_animating());
task_environment()->FastForwardBy(base::TimeDelta::FromMilliseconds(100));
task_environment()->FastForwardBy(base::Milliseconds(100));
EXPECT_TRUE(
GetMediaStringViewTextLabel()->layer()->GetAnimator()->is_animating());
@ -223,7 +223,7 @@ TEST_F(MediaStringViewTest, ShouldStartAndStopAnimationWhenTextChanges) {
EXPECT_FALSE(
GetMediaStringViewTextLabel()->layer()->GetAnimator()->is_animating());
task_environment()->FastForwardBy(base::TimeDelta::FromMilliseconds(100));
task_environment()->FastForwardBy(base::Milliseconds(100));
EXPECT_FALSE(
GetMediaStringViewTextLabel()->layer()->GetAnimator()->is_animating());
}
@ -248,7 +248,7 @@ TEST_F(MediaStringViewTest, PauseMediaWillNotStopAnimationWithLongText) {
EXPECT_FALSE(
GetMediaStringViewTextLabel()->layer()->GetAnimator()->is_animating());
task_environment()->FastForwardBy(base::TimeDelta::FromMilliseconds(100));
task_environment()->FastForwardBy(base::Milliseconds(100));
EXPECT_TRUE(
GetMediaStringViewTextLabel()->layer()->GetAnimator()->is_animating());

@ -96,7 +96,7 @@ constexpr float kOverviewFadeAnimationScale = 0.92f;
// The home launcher animation duration for transitions that accompany overview
// fading transitions.
constexpr base::TimeDelta kOverviewFadeAnimationDuration =
base::TimeDelta::FromMilliseconds(350);
base::Milliseconds(350);
// Update layer animation settings for launcher scale and opacity animation that
// runs on overview mode change.

@ -539,8 +539,8 @@ TEST_F(AppListControllerImplTest, MAYBE_CloseNotificationWithAppListShown) {
// Swipe away notification by gesture. Verifies that AppListView still shows.
ui::test::EventGenerator* event_generator = GetEventGenerator();
event_generator->GestureScrollSequence(
drag_start, drag_end, base::TimeDelta::FromMicroseconds(500), 10);
event_generator->GestureScrollSequence(drag_start, drag_end,
base::Microseconds(500), 10);
base::RunLoop().RunUntilIdle();
EXPECT_TRUE(GetAppListView());
EXPECT_EQ(
@ -599,7 +599,7 @@ TEST_F(AppListControllerImplTest,
// launcher to finish. Note that the launcher does not exist before toggling
// the home button.
PressHomeButton();
const base::TimeDelta delta = base::TimeDelta::FromMilliseconds(200);
const base::TimeDelta delta = base::Milliseconds(200);
do {
base::RunLoop run_loop;
base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
@ -1261,7 +1261,7 @@ TEST_F(AppListControllerImplMetricsTest,
display::Screen::GetScreen()->GetPrimaryDisplay().bounds().CenterPoint();
ui::test::EventGenerator* generator = GetEventGenerator();
generator->GestureScrollSequence(shelf_center, target_point,
base::TimeDelta::FromMicroseconds(500), 1);
base::Microseconds(500), 1);
EXPECT_EQ(AppListViewState::kFullscreenAllApps,
GetAppListView()->app_list_state());
histogram_tester_.ExpectTotalCount(

@ -136,7 +136,7 @@ void FlingUpOrDown(ui::test::EventGenerator* generator,
target_point.Offset(0, offset);
generator->GestureScrollSequence(start_point, target_point,
base::TimeDelta::FromMilliseconds(10), 2);
base::Milliseconds(10), 2);
}
std::unique_ptr<TestSearchResult> CreateOmniboxSuggestionResult(
@ -2001,8 +2001,8 @@ TEST_P(AppListPresenterTest, SideShelfAlignmentDragDisabled) {
// result in no state change.
ui::test::EventGenerator* generator = GetEventGenerator();
generator->GestureScrollSequence(GetPointOutsideSearchbox(),
gfx::Point(10, 900),
base::TimeDelta::FromMilliseconds(100), 10);
gfx::Point(10, 900), base::Milliseconds(100),
10);
GetAppListTestHelper()->WaitUntilIdle();
GetAppListTestHelper()->CheckState(AppListViewState::kFullscreenAllApps);
@ -2136,13 +2136,13 @@ TEST_P(AppListPresenterTest, AppListViewDragHandler) {
GetAppListView()->GetWidget()->GetWindowBoundsInScreen().y();
generator->GestureScrollSequence(gfx::Point(0, top_of_app_list + 20),
gfx::Point(0, top_of_app_list - 20),
base::TimeDelta::FromMilliseconds(500), 50);
base::Milliseconds(500), 50);
GetAppListTestHelper()->CheckState(AppListViewState::kPeeking);
// Execute a long upwards drag, this should transition the app list.
generator->GestureScrollSequence(gfx::Point(10, top_of_app_list + 20),
gfx::Point(10, 10),
base::TimeDelta::FromMilliseconds(100), 10);
gfx::Point(10, 10), base::Milliseconds(100),
10);
GetAppListTestHelper()->CheckState(AppListViewState::kFullscreenAllApps);
// Execute a short downward drag, this should fail to transition the app list.
@ -2165,8 +2165,8 @@ TEST_P(AppListPresenterTest, AppListViewDragHandler) {
// Transition to fullscreen.
generator->GestureScrollSequence(gfx::Point(10, top_of_app_list + 20),
gfx::Point(10, 10),
base::TimeDelta::FromMilliseconds(100), 10);
gfx::Point(10, 10), base::Milliseconds(100),
10);
GetAppListTestHelper()->CheckState(AppListViewState::kFullscreenAllApps);
// Enter text to transition to |FULLSCREEN_SEARCH|.
@ -2184,7 +2184,7 @@ TEST_P(AppListPresenterTest, AppListViewDragHandler) {
// Execute a long downward drag, this should close the app list.
generator->GestureScrollSequence(gfx::Point(10, 10), gfx::Point(10, 900),
base::TimeDelta::FromMilliseconds(100), 10);
base::Milliseconds(100), 10);
GetAppListTestHelper()->WaitUntilIdle();
GetAppListTestHelper()->CheckState(AppListViewState::kClosed);
GetAppListTestHelper()->CheckVisibility(false);
@ -2500,8 +2500,8 @@ TEST_P(AppListPresenterTest,
const int top_of_app_list =
app_list_view->GetWidget()->GetWindowBoundsInScreen().y();
generator->GestureScrollSequence(gfx::Point(10, top_of_app_list + 20),
gfx::Point(10, 10),
base::TimeDelta::FromMilliseconds(100), 10);
gfx::Point(10, 10), base::Milliseconds(100),
10);
GetAppListTestHelper()->WaitUntilIdle();
GetAppListTestHelper()->CheckState(AppListViewState::kFullscreenAllApps);
@ -2846,8 +2846,8 @@ TEST_P(AppListPresenterTest, DragToBezelClosesAppListFromFullscreenAndPeeking) {
.bottom();
generator->GestureScrollSequence(
gfx::Point(0, bezel_y - (kAppListBezelMargin + 100)),
gfx::Point(0, bezel_y - (kAppListBezelMargin)),
base::TimeDelta::FromMilliseconds(1500), 100);
gfx::Point(0, bezel_y - (kAppListBezelMargin)), base::Milliseconds(1500),
100);
GetAppListTestHelper()->WaitUntilIdle();
GetAppListTestHelper()->CheckState(AppListViewState::kClosed);
@ -2886,7 +2886,7 @@ TEST_P(AppListPresenterTest,
GetEventGenerator()->GestureScrollSequence(
gfx::Point(drag_x, bezel_y - (kAppListBezelMargin + 100)),
gfx::Point(drag_x, bezel_y - (kAppListBezelMargin)),
base::TimeDelta::FromMilliseconds(1500), 100);
base::Milliseconds(1500), 100);
GetAppListTestHelper()->WaitUntilIdle();
SCOPED_TRACE("Closed");

@ -232,8 +232,7 @@ TEST_F(AppDragIconProxyTest,
{
ui::ScopedLayerAnimationSettings animation_settings(
drag_icon_proxy->GetImageLayerForTesting()->GetAnimator());
animation_settings.SetTransitionDuration(
base::TimeDelta::FromMilliseconds(300));
animation_settings.SetTransitionDuration(base::Milliseconds(300));
gfx::Transform transform;
transform.Translate(100, 100);
drag_icon_proxy->GetImageLayerForTesting()->SetTransform(transform);

@ -78,8 +78,7 @@ constexpr gfx::Insets kVerticalScrollInsets(kTileSpacingInFolder, 0, 1, 1);
// Duration for fading in the target page when opening
// or closing a folder, and the duration for the top folder icon animation
// for flying in or out the folder.
constexpr base::TimeDelta kFolderTransitionDuration =
base::TimeDelta::FromMilliseconds(250);
constexpr base::TimeDelta kFolderTransitionDuration = base::Milliseconds(250);
// Transit from the background of the folder item's icon to the opened
// folder's background when opening the folder. Transit the other way when

@ -210,7 +210,7 @@ class AppListItemView::IconImageView : public views::ImageView {
if (animate) {
settings.emplace(layer()->GetAnimator());
settings->SetTweenType(gfx::Tween::EASE_IN);
settings->SetTransitionDuration(base::TimeDelta::FromMilliseconds(125));
settings->SetTransitionDuration(base::Milliseconds(125));
}
extended_ = extended;
@ -431,7 +431,7 @@ void AppListItemView::ScaleAppIcon(bool scale_up) {
ui::ScopedLayerAnimationSettings settings(layer()->GetAnimator());
settings.SetTransitionDuration(
base::TimeDelta::FromMilliseconds((kDragDropAppIconScaleTransitionInMs)));
base::Milliseconds((kDragDropAppIconScaleTransitionInMs)));
settings.SetTweenType(gfx::Tween::EASE_OUT_2);
if (scale_up) {
if (is_folder_) {
@ -736,9 +736,8 @@ bool AppListItemView::OnMousePressed(const ui::MouseEvent& event) {
if (!InitiateDrag(event.location(), event.root_location()))
return true;
mouse_drag_timer_.Start(
FROM_HERE, base::TimeDelta::FromMilliseconds(kMouseDragUIDelayInMs), this,
&AppListItemView::OnMouseDragTimer);
mouse_drag_timer_.Start(FROM_HERE, base::Milliseconds(kMouseDragUIDelayInMs),
this, &AppListItemView::OnMouseDragTimer);
return true;
}
@ -860,8 +859,7 @@ void AppListItemView::OnGestureEvent(ui::GestureEvent* event) {
if (GetState() != STATE_DISABLED) {
SetState(STATE_PRESSED);
touch_drag_timer_.Start(
FROM_HERE,
base::TimeDelta::FromMilliseconds(kTouchLongpressDelayInMs),
FROM_HERE, base::Milliseconds(kTouchLongpressDelayInMs),
base::BindOnce(&AppListItemView::OnTouchDragTimer,
base::Unretained(this), event->location(),
event->root_location()));
@ -1128,8 +1126,7 @@ void AppListItemView::CreateDraggedViewHoverAnimation() {
dragged_view_hover_animation_ = std::make_unique<gfx::SlideAnimation>(this);
dragged_view_hover_animation_->SetTweenType(gfx::Tween::EASE_IN);
dragged_view_hover_animation_->SetSlideDuration(
base::TimeDelta::FromMilliseconds(250));
dragged_view_hover_animation_->SetSlideDuration(base::Milliseconds(250));
}
void AppListItemView::AdaptBoundsForSelectionHighlight(gfx::Rect* bounds) {

@ -978,10 +978,9 @@ void AppListView::UpdatePageResetTimer(bool app_list_visibility) {
page_reset_timer_.Stop();
return;
}
page_reset_timer_.Start(
FROM_HERE,
base::TimeDelta::FromMinutes(kAppListPageResetTimeLimitMinutes), this,
&AppListView::SelectInitialAppsPage);
page_reset_timer_.Start(FROM_HERE,
base::Minutes(kAppListPageResetTimeLimitMinutes),
this, &AppListView::SelectInitialAppsPage);
if (skip_page_reset_timer_for_testing)
page_reset_timer_.FireNow();
@ -1833,19 +1832,17 @@ base::TimeDelta AppListView::GetStateTransitionAnimationDuration(
if (ShortAnimationsForTesting() || is_side_shelf_ ||
(target_state == AppListViewState::kClosed &&
delegate_->ShouldDismissImmediately())) {
return base::TimeDelta::FromMilliseconds(
kAppListAnimationDurationImmediateMs);
return base::Milliseconds(kAppListAnimationDurationImmediateMs);
}
if (is_fullscreen() || target_state == AppListViewState::kFullscreenAllApps ||
target_state == AppListViewState::kFullscreenSearch) {
// Animate over more time to or from a fullscreen state, to maintain a
// similar speed.
return base::TimeDelta::FromMilliseconds(
kAppListAnimationDurationFromFullscreenMs);
return base::Milliseconds(kAppListAnimationDurationFromFullscreenMs);
}
return base::TimeDelta::FromMilliseconds(kAppListAnimationDurationMs);
return base::Milliseconds(kAppListAnimationDurationMs);
}
void AppListView::StartAnimationForState(AppListViewState target_state) {

@ -2194,7 +2194,7 @@ TEST_F(AppListViewTest, SearchBoxCornerRadiusDuringDragging) {
"Apps.StateTransition.Drag.PresentationTime.ClamshellMode", 0);
// Drag down the launcher.
timestamp += base::TimeDelta::FromMilliseconds(25);
timestamp += base::Milliseconds(25);
delta_y += 10;
start.Offset(0, 1);
ui::GestureEvent update_event = ui::GestureEvent(
@ -2221,7 +2221,7 @@ TEST_F(AppListViewTest, SearchBoxCornerRadiusDuringDragging) {
// Ends to drag the launcher.
EXPECT_TRUE(SetAppListState(ash::AppListState::kStateApps));
timestamp += base::TimeDelta::FromMilliseconds(25);
timestamp += base::Milliseconds(25);
start.Offset(0, 1);
ui::GestureEvent end_event =
ui::GestureEvent(start.x(), start.y() + delta_y, ui::EF_NONE, timestamp,

@ -82,8 +82,7 @@ constexpr int kDragBufferPx = 20;
// Time delay before shelf starts to handle icon drag operation,
// such as shelf icons re-layout.
constexpr base::TimeDelta kShelfHandleIconDragDelay =
base::TimeDelta::FromMilliseconds(500);
constexpr base::TimeDelta kShelfHandleIconDragDelay = base::Milliseconds(500);
// The drag and drop proxy should get scaled by this factor.
constexpr float kDragAndDropProxyScale = 1.2f;
@ -573,15 +572,13 @@ void AppsGridView::UpdateDrag(Pointer pointer, const gfx::Point& point) {
// the item
if (last_drop_target_region == BETWEEN_ITEMS)
reorder_timer_.Stop();
reorder_timer_.Start(FROM_HERE,
base::TimeDelta::FromMilliseconds(kReorderDelay * 5),
reorder_timer_.Start(FROM_HERE, base::Milliseconds(kReorderDelay * 5),
this, &AppsGridView::OnReorderTimer);
} else if (drop_target_region_ != NO_TARGET) {
// If none of the above cases evaluated true, then all of the possible
// drop regions should result in a fast reorder.
reorder_timer_.Start(FROM_HERE,
base::TimeDelta::FromMilliseconds(kReorderDelay),
this, &AppsGridView::OnReorderTimer);
reorder_timer_.Start(FROM_HERE, base::Milliseconds(kReorderDelay), this,
&AppsGridView::OnReorderTimer);
}
}
}
@ -1385,8 +1382,7 @@ void AppsGridView::UpdateDragStateInsideFolder(Pointer pointer,
if (is_item_dragged_out_of_folder) {
if (!drag_out_of_folder_container_) {
folder_item_reparent_timer_.Start(
FROM_HERE,
base::TimeDelta::FromMilliseconds(kFolderItemReparentDelay), this,
FROM_HERE, base::Milliseconds(kFolderItemReparentDelay), this,
&AppsGridView::OnFolderItemReparentTimer);
drag_out_of_folder_container_ = true;
}

@ -323,11 +323,9 @@ class AppsGridViewTest : public AshTestBase {
}
void SetPageFlipDurationForTest(PagedAppsGridView* apps_grid_view) {
apps_grid_view->set_page_flip_delay_for_testing(
base::TimeDelta::FromMilliseconds(3));
apps_grid_view->set_page_flip_delay_for_testing(base::Milliseconds(3));
apps_grid_view->pagination_model()->SetTransitionDurations(
base::TimeDelta::FromMilliseconds(2),
base::TimeDelta::FromMilliseconds(1));
base::Milliseconds(2), base::Milliseconds(1));
}
bool HasPendingPageFlip(PagedAppsGridView* apps_grid_view) {

@ -51,14 +51,11 @@ constexpr int kPaddingHorizontalDip = 16;
constexpr int kPaddingTopDip = 12;
// Animation.
constexpr base::TimeDelta kAnimationFadeInDelay =
base::TimeDelta::FromMilliseconds(83);
constexpr base::TimeDelta kAnimationFadeInDuration =
base::TimeDelta::FromMilliseconds(100);
constexpr base::TimeDelta kAnimationFadeOutDuration =
base::TimeDelta::FromMilliseconds(83);
constexpr base::TimeDelta kAnimationFadeInDelay = base::Milliseconds(83);
constexpr base::TimeDelta kAnimationFadeInDuration = base::Milliseconds(100);
constexpr base::TimeDelta kAnimationFadeOutDuration = base::Milliseconds(83);
constexpr base::TimeDelta kAnimationTransformInDuration =
base::TimeDelta::FromMilliseconds(333);
base::Milliseconds(333);
constexpr int kAnimationTranslationDip = 30;
using keyboard::KeyboardUIController;

@ -54,28 +54,28 @@ constexpr int kSeparatorWidthDip = 64;
// Footer entry animation.
constexpr base::TimeDelta kFooterEntryAnimationFadeInDelay =
base::TimeDelta::FromMilliseconds(283);
base::Milliseconds(283);
constexpr base::TimeDelta kFooterEntryAnimationFadeInDuration =
base::TimeDelta::FromMilliseconds(167);
base::Milliseconds(167);
// Divider animation.
constexpr base::TimeDelta kDividerAnimationFadeInDelay =
base::TimeDelta::FromMilliseconds(233);
base::Milliseconds(233);
constexpr base::TimeDelta kDividerAnimationFadeInDuration =
base::TimeDelta::FromMilliseconds(167);
base::Milliseconds(167);
constexpr base::TimeDelta kDividerAnimationFadeOutDuration =
base::TimeDelta::FromMilliseconds(83);
base::Milliseconds(83);
// Zero state animation.
constexpr base::TimeDelta kZeroStateAnimationFadeOutDuration =
base::TimeDelta::FromMilliseconds(83);
base::Milliseconds(83);
constexpr int kZeroStateAnimationTranslationDip = 115;
constexpr base::TimeDelta kZeroStateAnimationFadeInDelay =
base::TimeDelta::FromMilliseconds(33);
base::Milliseconds(33);
constexpr base::TimeDelta kZeroStateAnimationFadeInDuration =
base::TimeDelta::FromMilliseconds(167);
base::Milliseconds(167);
constexpr base::TimeDelta kZeroStateAnimationTranslateUpDuration =
base::TimeDelta::FromMilliseconds(250);
base::Milliseconds(250);
// Helpers ---------------------------------------------------------------------
@ -377,7 +377,7 @@ void AppListAssistantMainStage::OnPendingQueryChanged(
// Animate the opacity to 100% with delay equal to |zero_state_view_| fade out
// animation duration to avoid the two views displaying at the same time.
constexpr base::TimeDelta kQueryAnimationFadeInDuration =
base::TimeDelta::FromMilliseconds(433);
base::Milliseconds(433);
query_view_->layer()->SetOpacity(0.f);
query_view_->layer()->GetAnimator()->StartAnimation(
CreateLayerAnimationSequence(

@ -28,9 +28,9 @@ namespace {
// Dialog plate animation.
constexpr base::TimeDelta kDialogPlateAnimationFadeInDelay =
base::TimeDelta::FromMilliseconds(283);
base::Milliseconds(283);
constexpr base::TimeDelta kDialogPlateAnimationFadeInDuration =
base::TimeDelta::FromMilliseconds(167);
base::Milliseconds(167);
} // namespace

@ -570,10 +570,9 @@ TEST_P(AssistantPageClamshellTest,
TEST_P(AssistantPageClamshellTest, ShouldShowOnboardingForNewUsers) {
// A user is considered new if they haven't had an Assistant interaction in
// the past 28 days.
const base::Time new_user_cutoff =
base::Time::Now() - base::TimeDelta::FromDays(28);
const base::Time new_user_cutoff = base::Time::Now() - base::Days(28);
SetTimeOfLastInteraction(new_user_cutoff + base::TimeDelta::FromMinutes(1));
SetTimeOfLastInteraction(new_user_cutoff + base::Minutes(1));
ShowAssistantUi();
// This user *has* interacted with Assistant more recently than 28 days ago so
@ -591,7 +590,7 @@ TEST_P(AssistantPageClamshellTest, ShouldShowOnboardingForNewUsers) {
}
TEST_P(AssistantPageClamshellTest, ShouldShowOnboardingUntilInteractionOccurs) {
SetTimeOfLastInteraction(base::Time::Now() - base::TimeDelta::FromDays(28));
SetTimeOfLastInteraction(base::Time::Now() - base::Days(28));
ShowAssistantUi();
// This user has *not* interacted with Assistant more recently than 28 days

@ -77,12 +77,11 @@ constexpr float kSearchBoxOpacityStartProgress = 0.11f;
constexpr float kSearchBoxOpacityEndProgress = 1.0f;
// Duration for page transition.
constexpr base::TimeDelta kPageTransitionDuration =
base::TimeDelta::FromMilliseconds(250);
constexpr base::TimeDelta kPageTransitionDuration = base::Milliseconds(250);
// Duration for overscroll page transition.
constexpr base::TimeDelta kOverscrollPageTransitionDuration =
base::TimeDelta::FromMilliseconds(50);
base::Milliseconds(50);
// Calculates opacity value for the current app list progress.
// |progress| - The target app list view progress - a value in [0.0, 2.0]

@ -74,8 +74,8 @@ constexpr float kPulseMinOpacity = 0.f;
constexpr float kPulseMaxOpacity = 0.3f;
constexpr int kAnimationInitialWaitTimeInSec = 3;
constexpr int kAnimationIntervalInSec = 10;
constexpr auto kCycleDuration = base::TimeDelta::FromMilliseconds(1000);
constexpr auto kCycleInterval = base::TimeDelta::FromMilliseconds(500);
constexpr auto kCycleDuration = base::Milliseconds(1000);
constexpr auto kCycleInterval = base::Milliseconds(500);
constexpr int kFocusRingWidth = 2;
@ -302,14 +302,10 @@ void ExpandArrowView::AnimationProgressed(const gfx::Animation* animation) {
}
// Update pulse opacity.
constexpr auto kPulseOpacityShowBeginTime =
base::TimeDelta::FromMilliseconds(100);
constexpr auto kPulseOpacityShowEndTime =
base::TimeDelta::FromMilliseconds(200);
constexpr auto kPulseOpacityHideBeginTime =
base::TimeDelta::FromMilliseconds(800);
constexpr auto kPulseOpacityHideEndTime =
base::TimeDelta::FromMilliseconds(1000);
constexpr auto kPulseOpacityShowBeginTime = base::Milliseconds(100);
constexpr auto kPulseOpacityShowEndTime = base::Milliseconds(200);
constexpr auto kPulseOpacityHideBeginTime = base::Milliseconds(800);
constexpr auto kPulseOpacityHideEndTime = base::Milliseconds(1000);
if (time > kPulseOpacityShowBeginTime && time <= kPulseOpacityShowEndTime) {
pulse_opacity_ =
kPulseMinOpacity +
@ -332,11 +328,10 @@ void ExpandArrowView::AnimationProgressed(const gfx::Animation* animation) {
time / kCycleDuration));
// Update y position offset of the arrow.
constexpr auto kArrowMoveOutBeginTime =
base::TimeDelta::FromMilliseconds(100);
constexpr auto kArrowMoveOutEndTime = base::TimeDelta::FromMilliseconds(500);
constexpr auto kArrowMoveInBeginTime = base::TimeDelta::FromMilliseconds(500);
constexpr auto kArrowMoveInEndTime = base::TimeDelta::FromMilliseconds(900);
constexpr auto kArrowMoveOutBeginTime = base::Milliseconds(100);
constexpr auto kArrowMoveOutEndTime = base::Milliseconds(500);
constexpr auto kArrowMoveInBeginTime = base::Milliseconds(500);
constexpr auto kArrowMoveInEndTime = base::Milliseconds(900);
if (time > kArrowMoveOutBeginTime && time <= kArrowMoveOutEndTime) {
const double progress = (time - kArrowMoveOutBeginTime) /
(kArrowMoveOutEndTime - kArrowMoveOutBeginTime);
@ -408,9 +403,8 @@ void ExpandArrowView::ScheduleHintingAnimation(bool is_first_time) {
int delay_in_sec = kAnimationIntervalInSec;
if (is_first_time)
delay_in_sec = kAnimationInitialWaitTimeInSec;
hinting_animation_timer_.Start(FROM_HERE,
base::TimeDelta::FromSeconds(delay_in_sec),
this, &ExpandArrowView::StartHintingAnimation);
hinting_animation_timer_.Start(FROM_HERE, base::Seconds(delay_in_sec), this,
&ExpandArrowView::StartHintingAnimation);
}
void ExpandArrowView::StartHintingAnimation() {

@ -25,8 +25,7 @@ constexpr int kGhostCircleStrokeWidth = 2;
constexpr int kGhostColorOpacity = 0x4D; // 30% opacity.
constexpr int kRootGridGhostColor = gfx::kGoogleGrey200;
constexpr int kInFolderGhostColor = gfx::kGoogleGrey700;
constexpr base::TimeDelta kGhostFadeInOutLength =
base::TimeDelta::FromMilliseconds(180);
constexpr base::TimeDelta kGhostFadeInOutLength = base::Milliseconds(180);
constexpr gfx::Tween::Type kGhostTween = gfx::Tween::FAST_OUT_SLOW_IN;
} // namespace

@ -66,12 +66,10 @@ constexpr char kPageDragScrollInTabletMaxLatencyHistogram[] =
"TabletMode";
// Delay in milliseconds to do the page flip in fullscreen app list.
constexpr base::TimeDelta kPageFlipDelay =
base::TimeDelta::FromMilliseconds(500);
constexpr base::TimeDelta kPageFlipDelay = base::Milliseconds(500);
// Duration for page transition.
constexpr base::TimeDelta kPageTransitionDuration =
base::TimeDelta::FromMilliseconds(250);
constexpr base::TimeDelta kPageTransitionDuration = base::Milliseconds(250);
// The size of the zone within which app list item drag events will trigger a
// page flip.
@ -82,7 +80,7 @@ constexpr int kDefaultFadeoutMaskHeight = 16;
// Duration for overscroll page transition.
constexpr base::TimeDelta kOverscrollPageTransitionDuration =
base::TimeDelta::FromMilliseconds(50);
base::Milliseconds(50);
// Vertical padding between the apps grid pages.
constexpr int kPaddingBetweenPages = 48;
@ -1170,7 +1168,7 @@ void PagedAppsGridView::AnimateCardifiedState() {
animator.SetTweenType(kCardifiedStateTweenType);
if (!cardified_state_) {
animator.SetTransitionDuration(
base::TimeDelta::FromMilliseconds(kDefaultAnimationDuration));
base::Milliseconds(kDefaultAnimationDuration));
}
// When the animations are done, discard the layer and reset view to
// proper scale.
@ -1191,7 +1189,7 @@ void PagedAppsGridView::AnimateCardifiedState() {
ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET);
if (!cardified_state_) {
animator.SetTransitionDuration(
base::TimeDelta::FromMilliseconds(kDefaultAnimationDuration));
base::Milliseconds(kDefaultAnimationDuration));
}
animator.AddObserver(this);
ui::AnimationThroughputReporter reporter(

@ -166,7 +166,7 @@ TEST_F(PagedAppsGridViewTest, DragItemToNextPage) {
// Drag the item at page 1 slot 0 to the next page and hold it there.
StartDragOnItemViewAtVisualIndex(1, 0);
GetEventGenerator()->MoveMouseTo(next_page_point);
task_environment()->FastForwardBy(base::TimeDelta::FromSeconds(2));
task_environment()->FastForwardBy(base::Seconds(2));
GetEventGenerator()->ReleaseLeftButton();
// With the drag complete, check that page 1 is still selected, because a new

@ -40,16 +40,14 @@ void SchedulePulsingAnimation(ui::Layer* layer) {
views::AnimationBuilder builder;
views::AnimationSequenceBlock block = builder.Repeatedly();
for (size_t i = 0; i < base::size(kAnimationOpacity); ++i) {
block = block
.SetDuration(
base::TimeDelta::FromMilliseconds(kAnimationDurationInMs))
block = block.SetDuration(base::Milliseconds(kAnimationDurationInMs))
.SetOpacity(layer, kAnimationOpacity[i])
.SetTransform(layer,
gfx::GetScaleTransform(local_bounds.CenterPoint(),
kAnimationScale[i]))
.Then();
}
block.SetDuration(base::TimeDelta::FromMilliseconds(kAnimationDurationInMs));
block.SetDuration(base::Milliseconds(kAnimationDurationInMs));
}
} // namespace
@ -62,8 +60,8 @@ PulsingBlockView::PulsingBlockView(const gfx::Size& size, bool start_delay) {
const int max_delay = kAnimationDurationInMs * base::size(kAnimationOpacity);
const int delay = start_delay ? base::RandInt(0, max_delay) : 0;
start_delay_timer_.Start(FROM_HERE, base::TimeDelta::FromMilliseconds(delay),
this, &PulsingBlockView::OnStartDelayTimer);
start_delay_timer_.Start(FROM_HERE, base::Milliseconds(delay), this,
&PulsingBlockView::OnStartDelayTimer);
}
PulsingBlockView::~PulsingBlockView() {}

@ -34,7 +34,7 @@ const int kVerticalTilePadding = 8;
constexpr int kAutoScrollMargin = 32;
// How often to auto-scroll when the mouse is held in the auto-scroll margin.
constexpr base::TimeDelta kAutoScrollInterval = base::TimeDelta::FromHz(60.0);
constexpr base::TimeDelta kAutoScrollInterval = base::Hertz(60.0);
// How much to auto-scroll the view per second. Empirically chosen.
const int kAutoScrollDipsPerSecond = 400;

@ -305,7 +305,7 @@ TEST_F(ScrollableAppsGridViewTest, AutoScrollDown) {
EXPECT_FALSE(apps_grid_view_->reorder_timer_for_test()->IsRunning());
// Holding the mouse in place for a while scrolls down more.
task_environment()->FastForwardBy(base::TimeDelta::FromMilliseconds(100));
task_environment()->FastForwardBy(base::Milliseconds(100));
const int scroll_offset2 = scroll_view_->GetVisibleRect().y();
EXPECT_GT(scroll_offset2, scroll_offset1);
@ -330,7 +330,7 @@ TEST_F(ScrollableAppsGridViewTest, DoesNotAutoScrollUpWhenAtTop) {
StartDragOnItemViewAt(0);
GetEventGenerator()->MoveMouseTo(
scroll_view_->GetBoundsInScreen().top_center());
task_environment()->FastForwardBy(base::TimeDelta::FromMilliseconds(500));
task_environment()->FastForwardBy(base::Milliseconds(500));
// View did not scroll.
int scroll_offset = scroll_view_->GetVisibleRect().y();
@ -351,7 +351,7 @@ TEST_F(ScrollableAppsGridViewTest, DoesNotAutoScrollDownWhenAtBottom) {
StartDragOnItemViewAt(29);
GetEventGenerator()->MoveMouseTo(
scroll_view_->GetBoundsInScreen().bottom_center());
task_environment()->FastForwardBy(base::TimeDelta::FromMilliseconds(500));
task_environment()->FastForwardBy(base::Milliseconds(500));
// View did not scroll.
int scroll_offset = scroll_view_->GetVisibleRect().y();
@ -369,7 +369,7 @@ TEST_F(ScrollableAppsGridViewTest, DoesNotAutoScrollWhenDraggedToTheRight) {
gfx::Point point = scroll_view_->GetBoundsInScreen().bottom_right();
point.Offset(10, 10);
GetEventGenerator()->MoveMouseTo(point);
task_environment()->FastForwardBy(base::TimeDelta::FromMilliseconds(500));
task_environment()->FastForwardBy(base::Milliseconds(500));
// View did not scroll.
int scroll_offset = scroll_view_->GetVisibleRect().y();

@ -48,8 +48,7 @@ constexpr int kPreferredTitleHorizontalMargins = 16;
constexpr int kPreferredTitleTopMargins = 12;
constexpr int kPreferredTitleBottomMargins = 4;
constexpr base::TimeDelta kImpressionThreshold =
base::TimeDelta::FromSeconds(3);
constexpr base::TimeDelta kImpressionThreshold = base::Seconds(3);
// TODO(crbug.com/1199206): Move this into SharedAppListConfig once the UI for
// categories is more developed.

@ -75,8 +75,7 @@ constexpr int kSearchBoxSearchResultShadowElevation = 12;
// The amount of time by which notifications to accessibility framework about
// result page changes are delayed.
constexpr base::TimeDelta kNotifyA11yDelay =
base::TimeDelta::FromMilliseconds(1500);
constexpr base::TimeDelta kNotifyA11yDelay = base::Milliseconds(1500);
// A container view that ensures the card background and the shadow are painted
// in the correct order.

@ -199,8 +199,7 @@ int SearchResultTileItemListView::DoUpdate() {
recent_playstore_query_ = user_typed_query;
playstore_impression_timer_.Stop();
playstore_impression_timer_.Start(
FROM_HERE,
base::TimeDelta::FromMilliseconds(kPlayStoreImpressionDelayInMs), this,
FROM_HERE, base::Milliseconds(kPlayStoreImpressionDelayInMs), this,
&SearchResultTileItemListView::OnPlayStoreImpressionTimer);
// Set the starting time in result view for play store results.
base::TimeTicks result_display_start = base::TimeTicks::Now();

@ -192,13 +192,13 @@ std::vector<AssistantNotificationButton> CreateTimerNotificationButtons(
/*remove_notification_on_click=*/true});
// "ADD 1 MIN" button.
buttons.push_back({l10n_util::GetStringUTF8(
IDS_ASSISTANT_TIMER_NOTIFICATION_ADD_1_MIN_BUTTON),
assistant::util::CreateAlarmTimerDeepLink(
AlarmTimerAction::kAddTimeToTimer, timer.id,
base::TimeDelta::FromMinutes(1))
.value(),
/*remove_notification_on_click=*/false});
buttons.push_back(
{l10n_util::GetStringUTF8(
IDS_ASSISTANT_TIMER_NOTIFICATION_ADD_1_MIN_BUTTON),
assistant::util::CreateAlarmTimerDeepLink(
AlarmTimerAction::kAddTimeToTimer, timer.id, base::Minutes(1))
.value(),
/*remove_notification_on_click=*/false});
} else {
// "CANCEL" button.
buttons.push_back({l10n_util::GetStringUTF8(
@ -222,7 +222,7 @@ AssistantNotificationPriority CreateTimerNotificationPriority(
// If the notification has lived for at least |kPopupThreshold|, drop the
// priority to |kLow| so that the notification will not pop up to the user.
constexpr base::TimeDelta kPopupThreshold = base::TimeDelta::FromSeconds(6);
constexpr base::TimeDelta kPopupThreshold = base::Seconds(6);
const base::TimeDelta lifetime =
base::Time::Now() - timer.creation_time.value_or(base::Time::Now());
if (lifetime >= kPopupThreshold)
@ -463,8 +463,7 @@ void AssistantAlarmTimerControllerImpl::ScheduleNextTick(
// when Tick() is called due to the possibility of the |model_| being updated
// via a call to OnTimerStateChanged(), such as might happen if a timer is
// created, paused, resumed, or removed by LibAssistant.
ticker.Start(FROM_HERE,
base::TimeDelta::FromMilliseconds(millis_to_next_full_sec),
ticker.Start(FROM_HERE, base::Milliseconds(millis_to_next_full_sec),
base::BindOnce(&AssistantAlarmTimerControllerImpl::Tick,
base::Unretained(this), timer.id));
}

@ -399,7 +399,7 @@ TEST_F(AssistantAlarmTimerControllerTest, AddedTimersShouldHaveCreationTime) {
testing::Mock::VerifyAndClearExpectations(&mock);
// If specified, |creation_time| should be respected.
creation_time -= base::TimeDelta::FromMinutes(1);
creation_time -= base::Minutes(1);
EXPECT_CALL(mock, OnTimerAdded)
.WillOnce(testing::Invoke([&](const AssistantTimer& timer) {
EXPECT_EQ(creation_time, timer.creation_time.value());
@ -423,12 +423,12 @@ TEST_F(AssistantAlarmTimerControllerTest, TimerNotificationHasExpectedTitle) {
/*ticks=*/
{
{base::TimeDelta(), "1:01:01"},
{base::TimeDelta::FromHours(1), "1:01"},
{base::TimeDelta::FromMinutes(1), "0:01"},
{base::TimeDelta::FromSeconds(1), "0:00"},
{base::TimeDelta::FromSeconds(1), "-0:01"},
{base::TimeDelta::FromMinutes(1), "-1:01"},
{base::TimeDelta::FromHours(1), "-1:01:01"},
{base::Hours(1), "1:01"},
{base::Minutes(1), "0:01"},
{base::Seconds(1), "0:00"},
{base::Seconds(1), "-0:01"},
{base::Minutes(1), "-1:01"},
{base::Hours(1), "-1:01:01"},
},
});
@ -438,12 +438,12 @@ TEST_F(AssistantAlarmTimerControllerTest, TimerNotificationHasExpectedTitle) {
/*ticks=*/
{
{base::TimeDelta(), "1.01.01"},
{base::TimeDelta::FromHours(1), "1.01"},
{base::TimeDelta::FromMinutes(1), "0.01"},
{base::TimeDelta::FromSeconds(1), "0.00"},
{base::TimeDelta::FromSeconds(1), "-0.01"},
{base::TimeDelta::FromMinutes(1), "-1.01"},
{base::TimeDelta::FromHours(1), "-1.01.01"},
{base::Hours(1), "1.01"},
{base::Minutes(1), "0.01"},
{base::Seconds(1), "0.00"},
{base::Seconds(1), "-0.01"},
{base::Minutes(1), "-1.01"},
{base::Hours(1), "-1.01.01"},
},
});
@ -455,9 +455,8 @@ TEST_F(AssistantAlarmTimerControllerTest, TimerNotificationHasExpectedTitle) {
ScopedNotificationModelObserver observer;
// Schedule a timer.
ScheduleTimer(kTimerId).WithRemainingTime(base::TimeDelta::FromHours(1) +
base::TimeDelta::FromMinutes(1) +
base::TimeDelta::FromSeconds(1));
ScheduleTimer(kTimerId).WithRemainingTime(
base::Hours(1) + base::Minutes(1) + base::Seconds(1));
// Run each tick of the clock in the test.
for (auto& tick : i18n_test_case.ticks) {
@ -476,9 +475,9 @@ TEST_F(AssistantAlarmTimerControllerTest, TimerNotificationHasExpectedTitle) {
// Tests that a notification is added for a timer and has the expected message.
TEST_F(AssistantAlarmTimerControllerTest, TimerNotificationHasExpectedMessage) {
constexpr char kEmptyLabel[] = "";
constexpr base::TimeDelta kOneSec = base::TimeDelta::FromSeconds(1);
constexpr base::TimeDelta kOneMin = base::TimeDelta::FromMinutes(1);
constexpr base::TimeDelta kOneHour = base::TimeDelta::FromHours(1);
constexpr base::TimeDelta kOneSec = base::Seconds(1);
constexpr base::TimeDelta kOneMin = base::Minutes(1);
constexpr base::TimeDelta kOneHour = base::Hours(1);
// We'll verify the message of our notification with various timers.
typedef struct {
@ -564,7 +563,7 @@ TEST_F(AssistantAlarmTimerControllerTest, TimerNotificationHasExpectedButtons) {
// Observe notifications.
ScopedNotificationModelObserver observer;
constexpr base::TimeDelta kTimeRemaining = base::TimeDelta::FromMinutes(1);
constexpr base::TimeDelta kTimeRemaining = base::Minutes(1);
// Schedule a timer.
ScheduleTimer(kTimerId).WithRemainingTime(kTimeRemaining);
@ -645,7 +644,7 @@ TEST_F(AssistantAlarmTimerControllerTest, TimerNotificationHasExpectedButtons) {
.WithLabel(IDS_ASSISTANT_TIMER_NOTIFICATION_ADD_1_MIN_BUTTON)
.WithActionUrl(assistant::util::CreateAlarmTimerDeepLink(
assistant::util::AlarmTimerAction::kAddTimeToTimer,
kTimerId, base::TimeDelta::FromMinutes(1))
kTimerId, base::Minutes(1))
.value())
.WithRemoveNotificationOnClick(false),
observer.last_notification().buttons.at(1));
@ -697,7 +696,7 @@ TEST_F(AssistantAlarmTimerControllerTest,
ScopedNotificationModelObserver notification_model_observer;
// Schedule a timer.
ScheduleTimer(kTimerId).WithRemainingTime(base::TimeDelta::FromSeconds(10));
ScheduleTimer(kTimerId).WithRemainingTime(base::Seconds(10));
// Make assertions about the notification.
EXPECT_EQ(ExpectedNotification().WithClientId(kClientId).WithPriority(
@ -706,7 +705,7 @@ TEST_F(AssistantAlarmTimerControllerTest,
// Advance the clock.
// NOTE: Six seconds is the threshold for popping up our notification.
AdvanceClockAndWaitForTimerUpdate(base::TimeDelta::FromSeconds(6));
AdvanceClockAndWaitForTimerUpdate(base::Seconds(6));
// Make assertions about the notification.
EXPECT_EQ(ExpectedNotification().WithClientId(kClientId).WithPriority(

@ -120,7 +120,7 @@ class AssistantNotificationBuilder {
}
AssistantNotificationBuilder& WithTimeoutMs(int timeout_ms) {
return WithTimeout(base::TimeDelta::FromMilliseconds(timeout_ms));
return WithTimeout(base::Milliseconds(timeout_ms));
}
private:
@ -237,8 +237,7 @@ class AssistantNotificationControllerTest : public AshTestBase {
}
void ForwardTimeInMs(int time_in_ms) {
task_environment()->FastForwardBy(
base::TimeDelta::FromMilliseconds(time_in_ms));
task_environment()->FastForwardBy(base::Milliseconds(time_in_ms));
}
private:

@ -147,7 +147,7 @@ bool AssistantViewDelegateImpl::ShouldShowOnboarding() const {
// The feature will start to show only for new users which we define as users
// who haven't had an interaction with Assistant in the last 28 days.
return interaction_controller->GetTimeDeltaSinceLastInteraction() >=
base::TimeDelta::FromDays(28);
base::Days(28);
}
} // namespace ash

@ -28,12 +28,9 @@ namespace {
constexpr int kPreferredHeightDip = 48;
// Animation.
constexpr base::TimeDelta kAnimationFadeInDelay =
base::TimeDelta::FromMilliseconds(167);
constexpr base::TimeDelta kAnimationFadeInDuration =
base::TimeDelta::FromMilliseconds(167);
constexpr base::TimeDelta kAnimationFadeOutDuration =
base::TimeDelta::FromMilliseconds(167);
constexpr base::TimeDelta kAnimationFadeInDelay = base::Milliseconds(167);
constexpr base::TimeDelta kAnimationFadeInDuration = base::Milliseconds(167);
constexpr base::TimeDelta kAnimationFadeOutDuration = base::Milliseconds(167);
} // namespace

@ -207,13 +207,12 @@ TEST_F(AssistantOnboardingViewTest, ShouldHaveExpectedGreeting) {
CreateAndSwitchActiveUser(test_case.display_email, test_case.given_name);
// Advance clock to midnight tomorrow.
AdvanceClock(base::Time::Now().LocalMidnight() +
base::TimeDelta::FromHours(24) - base::Time::Now());
AdvanceClock(base::Time::Now().LocalMidnight() + base::Hours(24) -
base::Time::Now());
{
// Verify 4:59 AM.
AdvanceClock(base::TimeDelta::FromHours(4) +
base::TimeDelta::FromMinutes(59));
AdvanceClock(base::Hours(4) + base::Minutes(59));
ScopedShowUi scoped_show_ui;
EXPECT_EQ(greeting_label()->GetText(),
test_case.expected_greeting.for_night);
@ -221,7 +220,7 @@ TEST_F(AssistantOnboardingViewTest, ShouldHaveExpectedGreeting) {
{
// Verify 5:00 AM.
AdvanceClock(base::TimeDelta::FromMinutes(1));
AdvanceClock(base::Minutes(1));
ScopedShowUi scoped_show_ui;
EXPECT_EQ(greeting_label()->GetText(),
test_case.expected_greeting.for_morning);
@ -229,8 +228,7 @@ TEST_F(AssistantOnboardingViewTest, ShouldHaveExpectedGreeting) {
{
// Verify 11:59 AM.
AdvanceClock(base::TimeDelta::FromHours(6) +
base::TimeDelta::FromMinutes(59));
AdvanceClock(base::Hours(6) + base::Minutes(59));
ScopedShowUi scoped_show_ui;
EXPECT_EQ(greeting_label()->GetText(),
test_case.expected_greeting.for_morning);
@ -238,7 +236,7 @@ TEST_F(AssistantOnboardingViewTest, ShouldHaveExpectedGreeting) {
{
// Verify 12:00 PM.
AdvanceClock(base::TimeDelta::FromMinutes(1));
AdvanceClock(base::Minutes(1));
ScopedShowUi scoped_show_ui;
EXPECT_EQ(greeting_label()->GetText(),
test_case.expected_greeting.for_afternoon);
@ -246,8 +244,7 @@ TEST_F(AssistantOnboardingViewTest, ShouldHaveExpectedGreeting) {
{
// Verify 4:59 PM.
AdvanceClock(base::TimeDelta::FromHours(4) +
base::TimeDelta::FromMinutes(59));
AdvanceClock(base::Hours(4) + base::Minutes(59));
ScopedShowUi scoped_show_ui;
EXPECT_EQ(greeting_label()->GetText(),
test_case.expected_greeting.for_afternoon);
@ -255,7 +252,7 @@ TEST_F(AssistantOnboardingViewTest, ShouldHaveExpectedGreeting) {
{
// Verify 5:00 PM.
AdvanceClock(base::TimeDelta::FromMinutes(1));
AdvanceClock(base::Minutes(1));
ScopedShowUi scoped_show_ui;
EXPECT_EQ(greeting_label()->GetText(),
test_case.expected_greeting.for_evening);
@ -263,8 +260,7 @@ TEST_F(AssistantOnboardingViewTest, ShouldHaveExpectedGreeting) {
{
// Verify 10:59 PM.
AdvanceClock(base::TimeDelta::FromHours(5) +
base::TimeDelta::FromMinutes(59));
AdvanceClock(base::Hours(5) + base::Minutes(59));
ScopedShowUi scoped_show_ui;
EXPECT_EQ(greeting_label()->GetText(),
test_case.expected_greeting.for_evening);
@ -272,7 +268,7 @@ TEST_F(AssistantOnboardingViewTest, ShouldHaveExpectedGreeting) {
{
// Verify 11:00 PM.
AdvanceClock(base::TimeDelta::FromMinutes(1));
AdvanceClock(base::Minutes(1));
ScopedShowUi scoped_show_ui;
EXPECT_EQ(greeting_label()->GetText(),
test_case.expected_greeting.for_night);

@ -146,21 +146,19 @@ void AssistantProgressIndicator::VisibilityChanged(views::View* starting_from,
start_offset,
ui::LayerAnimationElement::AnimatableProperty::TRANSFORM);
}
start_offset += base::TimeDelta::FromMilliseconds(216);
start_offset += base::Milliseconds(216);
// Schedule transformation animation.
child->layer()->GetAnimator()->ScheduleAnimation(
CreateLayerAnimationSequence(
// Animate scale up.
CreateTransformElement(transform,
base::TimeDelta::FromMilliseconds(266)),
CreateTransformElement(transform, base::Milliseconds(266)),
// Animate scale down.
CreateTransformElement(gfx::Transform(),
base::TimeDelta::FromMilliseconds(450)),
CreateTransformElement(gfx::Transform(), base::Milliseconds(450)),
// Pause before next iteration.
ui::LayerAnimationElement::CreatePauseElement(
ui::LayerAnimationElement::AnimatableProperty::TRANSFORM,
base::TimeDelta::FromMilliseconds(500)),
base::Milliseconds(500)),
// Animation parameters.
{/*is_cyclic=*/true}));
}

@ -22,10 +22,8 @@ using assistant::util::CreateOpacityElement;
using assistant::util::StartLayerAnimationSequence;
// Animation.
constexpr base::TimeDelta kAnimateInDuration =
base::TimeDelta::FromMilliseconds(250);
constexpr base::TimeDelta kAnimateOutDuration =
base::TimeDelta::FromMilliseconds(200);
constexpr base::TimeDelta kAnimateInDuration = base::Milliseconds(250);
constexpr base::TimeDelta kAnimateOutDuration = base::Milliseconds(200);
} // namespace

@ -23,8 +23,7 @@ namespace ash {
class ElementAnimator {
public:
// Fade out duration used in the default implementation of |FadeOut|.
constexpr static base::TimeDelta kFadeOutDuration =
base::TimeDelta::FromMilliseconds(150);
constexpr static base::TimeDelta kFadeOutDuration = base::Milliseconds(150);
// Fade out opacity used in the default implementation of |FadeOut|.
constexpr static float kFadeOutOpacity = 0.26f;
// Minimum allowed opacity as a target when fading out.

@ -38,10 +38,8 @@ using assistant::util::CreateOpacityElement;
using assistant::util::StartLayerAnimationSequence;
// Animation.
constexpr base::TimeDelta kChipFadeInDuration =
base::TimeDelta::FromMilliseconds(250);
constexpr base::TimeDelta kChipFadeOutDuration =
base::TimeDelta::FromMilliseconds(200);
constexpr base::TimeDelta kChipFadeInDuration = base::Milliseconds(250);
constexpr base::TimeDelta kChipFadeOutDuration = base::Milliseconds(200);
// Appearance.
constexpr int kPreferredHeightDip = 48;

@ -349,7 +349,7 @@ absl::optional<base::TimeDelta> GetDeepLinkParamAsTimeDelta(
if (!duration_ms.has_value())
return absl::nullopt;
return base::TimeDelta::FromMilliseconds(duration_ms.value());
return base::Milliseconds(duration_ms.value());
}
DeepLinkType GetDeepLinkType(const GURL& url) {

@ -73,7 +73,7 @@ TEST_F(DeepLinkUtilTest, CreateAlarmTimerDeeplink) {
"googleassistant://"
"alarm-timer?action=addTimeToTimer&id=1&durationMs=60000",
CreateAlarmTimerDeepLink(AlarmTimerAction::kAddTimeToTimer, "1",
base::TimeDelta::FromMinutes(1))
base::Minutes(1))
.value());
ASSERT_EQ("googleassistant://alarm-timer?action=pauseTimer&id=1",
CreateAlarmTimerDeepLink(AlarmTimerAction::kPauseTimer, "1",
@ -98,9 +98,9 @@ TEST_F(DeepLinkUtilTest, CreateAlarmTimerDeeplink) {
ASSERT_EQ(absl::nullopt,
CreateAlarmTimerDeepLink(AlarmTimerAction::kAddTimeToTimer, "1",
absl::nullopt));
ASSERT_EQ(absl::nullopt, CreateAlarmTimerDeepLink(
AlarmTimerAction::kAddTimeToTimer, absl::nullopt,
base::TimeDelta::FromMinutes(1)));
ASSERT_EQ(absl::nullopt,
CreateAlarmTimerDeepLink(AlarmTimerAction::kAddTimeToTimer,
absl::nullopt, base::Minutes(1)));
ASSERT_EQ(absl::nullopt,
CreateAlarmTimerDeepLink(AlarmTimerAction::kAddTimeToTimer,
absl::nullopt, absl::nullopt));
@ -108,32 +108,32 @@ TEST_F(DeepLinkUtilTest, CreateAlarmTimerDeeplink) {
ASSERT_EQ(absl::nullopt,
CreateAlarmTimerDeepLink(AlarmTimerAction::kPauseTimer,
absl::nullopt, absl::nullopt));
ASSERT_EQ(absl::nullopt, CreateAlarmTimerDeepLink(
AlarmTimerAction::kPauseTimer, absl::nullopt,
base::TimeDelta::FromMinutes(1)));
ASSERT_EQ(absl::nullopt,
CreateAlarmTimerDeepLink(AlarmTimerAction::kPauseTimer,
absl::nullopt, base::Minutes(1)));
ASSERT_EQ(absl::nullopt,
CreateAlarmTimerDeepLink(AlarmTimerAction::kPauseTimer, "1",
base::TimeDelta::FromMinutes(1)));
base::Minutes(1)));
ASSERT_EQ(absl::nullopt,
CreateAlarmTimerDeepLink(AlarmTimerAction::kRemoveAlarmOrTimer,
absl::nullopt, absl::nullopt));
ASSERT_EQ(absl::nullopt, CreateAlarmTimerDeepLink(
AlarmTimerAction::kRemoveAlarmOrTimer,
absl::nullopt, base::TimeDelta::FromMinutes(1)));
ASSERT_EQ(absl::nullopt,
CreateAlarmTimerDeepLink(AlarmTimerAction::kRemoveAlarmOrTimer,
absl::nullopt, base::Minutes(1)));
ASSERT_EQ(absl::nullopt,
CreateAlarmTimerDeepLink(AlarmTimerAction::kRemoveAlarmOrTimer, "1",
base::TimeDelta::FromMinutes(1)));
base::Minutes(1)));
ASSERT_EQ(absl::nullopt,
CreateAlarmTimerDeepLink(AlarmTimerAction::kResumeTimer,
absl::nullopt, absl::nullopt));
ASSERT_EQ(absl::nullopt, CreateAlarmTimerDeepLink(
AlarmTimerAction::kResumeTimer, absl::nullopt,
base::TimeDelta::FromMinutes(1)));
ASSERT_EQ(absl::nullopt,
CreateAlarmTimerDeepLink(AlarmTimerAction::kResumeTimer,
absl::nullopt, base::Minutes(1)));
ASSERT_EQ(absl::nullopt,
CreateAlarmTimerDeepLink(AlarmTimerAction::kResumeTimer, "1",
base::TimeDelta::FromMinutes(1)));
base::Minutes(1)));
}
TEST_F(DeepLinkUtilTest, CreateAssistantQueryDeepLink) {
@ -438,11 +438,9 @@ TEST_F(DeepLinkUtilTest, GetDeepLinkParamAsTimeDelta) {
// Case: Deep link parameter present, well formed "60000".
params["durationMs"] = "60000";
AssertDeepLinkParamEq(base::TimeDelta::FromMinutes(1),
DeepLinkParam::kDurationMs);
AssertDeepLinkParamEq(base::Minutes(1), DeepLinkParam::kDurationMs);
params["durationMs"] = "00";
AssertDeepLinkParamEq(base::TimeDelta::FromMilliseconds(0),
DeepLinkParam::kDurationMs);
AssertDeepLinkParamEq(base::Milliseconds(0), DeepLinkParam::kDurationMs);
// Case: Deep link parameter present, non-int value.
params["durationMs"] = "true";

@ -44,25 +44,20 @@ constexpr int kCountDownStartSeconds = 3;
constexpr int kCountDownEndSeconds = 1;
constexpr base::TimeDelta kCaptureLabelOpacityFadeoutDuration =
base::TimeDelta::FromMilliseconds(33);
base::Milliseconds(33);
// Opacity fade in animation duration and scale up animation duration when the
// timeout label enters 3.
constexpr base::TimeDelta kCountDownEnter3Duration =
base::TimeDelta::FromMilliseconds(267);
constexpr base::TimeDelta kCountDownEnter3Duration = base::Milliseconds(267);
// Opacity fade out animation duration and scale down animation duration when
// the timeout label exits 1.
constexpr base::TimeDelta kCountDownExit1Duration =
base::TimeDelta::FromMilliseconds(333);
constexpr base::TimeDelta kCountDownExit1Duration = base::Milliseconds(333);
// For other number enter/exit fade in/out, scale up/down animation duration.
constexpr base::TimeDelta kCountDownEnterExitDuration =
base::TimeDelta::FromMilliseconds(167);
constexpr base::TimeDelta kCountDownEnterExitDuration = base::Milliseconds(167);
// Delay to enter number 3 to start count down.
constexpr base::TimeDelta kStartCountDownDelay =
base::TimeDelta::FromMilliseconds(233);
constexpr base::TimeDelta kStartCountDownDelay = base::Milliseconds(233);
// Delay to exit a number after entering animation is completed.
constexpr base::TimeDelta kCountDownExitDelay =
base::TimeDelta::FromMilliseconds(667);
constexpr base::TimeDelta kCountDownExitDelay = base::Milliseconds(667);
// Different scales for enter/exiting countdown numbers.
constexpr float kEnterLabelScaleDown = 0.8f;

@ -68,8 +68,7 @@ CaptureModeController* g_instance = nullptr;
// The amount of time that can elapse from the prior screenshot to be considered
// consecutive.
constexpr base::TimeDelta kConsecutiveScreenshotThreshold =
base::TimeDelta::FromSeconds(5);
constexpr base::TimeDelta kConsecutiveScreenshotThreshold = base::Seconds(5);
constexpr char kScreenCaptureNotificationId[] = "capture_mode_notification";
constexpr char kScreenCaptureStoppedNotificationId[] =
@ -89,8 +88,7 @@ constexpr char k24HourTimeFmtStr[] = "%02d.%02d.%02d";
constexpr char kAmPmTimeFmtStr[] = "%d.%02d.%02d";
// Duration to clear the capture region selection from the previous session.
constexpr base::TimeDelta kResetCaptureRegionDuration =
base::TimeDelta::FromMinutes(8);
constexpr base::TimeDelta kResetCaptureRegionDuration = base::Minutes(8);
// The name of a file path pref for the user-selected custom path to which
// captured images and videos should be saved.
@ -343,14 +341,14 @@ CaptureModeController::CaptureModeController(
// Schedule recording of the number of screenshots taken per day.
num_screenshots_taken_in_last_day_scheduler_.Start(
FROM_HERE, base::TimeDelta::FromDays(1),
FROM_HERE, base::Days(1),
base::BindRepeating(
&CaptureModeController::RecordAndResetScreenshotsTakenInLastDay,
weak_ptr_factory_.GetWeakPtr()));
// Schedule recording of the number of screenshots taken per week.
num_screenshots_taken_in_last_week_scheduler_.Start(
FROM_HERE, base::TimeDelta::FromDays(7),
FROM_HERE, base::Days(7),
base::BindRepeating(
&CaptureModeController::RecordAndResetScreenshotsTakenInLastWeek,
weak_ptr_factory_.GetWeakPtr()));

@ -90,10 +90,10 @@ void RecordCaptureModeEntryType(CaptureModeEntryType entry_type) {
void RecordCaptureModeRecordTime(int64_t length_in_seconds) {
// Use custom counts macro instead of custom times so we can record in
// seconds instead of milliseconds. The max bucket is 3 hours.
base::UmaHistogramCustomCounts(
kRecordTimeHistogramName, length_in_seconds, /*min=*/1,
/*max=*/base::TimeDelta::FromHours(3).InSeconds(),
/*bucket_count=*/50);
base::UmaHistogramCustomCounts(kRecordTimeHistogramName, length_in_seconds,
/*min=*/1,
/*max=*/base::Hours(3).InSeconds(),
/*bucket_count=*/50);
}
void RecordCaptureModeSwitchesFromInitialMode(bool switched) {

@ -131,15 +131,14 @@ constexpr int kCaptureRegionMinimumPaddingDp = 16;
// The animation duration that the label fades out and scales down before count
// down starts.
constexpr base::TimeDelta kCaptureLabelCountdownStartDuration =
base::TimeDelta::FromMilliseconds(267);
base::Milliseconds(267);
// The animation duration that the capture bar fades out before count down
// starts.
constexpr base::TimeDelta kCaptureBarFadeOutDuration =
base::TimeDelta::FromMilliseconds(167);
constexpr base::TimeDelta kCaptureBarFadeOutDuration = base::Milliseconds(167);
// The animation duration that the fullscreen shield fades out before count down
// starts.
constexpr base::TimeDelta kCaptureShieldFadeOutDuration =
base::TimeDelta::FromMilliseconds(333);
base::Milliseconds(333);
// If there is no text message was showing when count down starts, the label
// widget will shrink down from 120% -> 100% and fade in.
constexpr float kLabelScaleUpOnCountdown = 1.2;
@ -147,10 +146,10 @@ constexpr float kLabelScaleUpOnCountdown = 1.2;
// The animation duration that the label fades out and scales up when going from
// the selection phase to the fine tune phase.
constexpr base::TimeDelta kCaptureLabelRegionPhaseChangeDuration =
base::TimeDelta::FromMilliseconds(167);
base::Milliseconds(167);
// The delay before the label fades out and scales up.
constexpr base::TimeDelta kCaptureLabelRegionPhaseChangeDelay =
base::TimeDelta::FromMilliseconds(67);
base::Milliseconds(67);
// When going from the select region phase to the fine tune phase, the label
// widget will scale up from 80% -> 100%.
constexpr float kLabelScaleDownOnPhaseChange = 0.8;
@ -158,10 +157,10 @@ constexpr float kLabelScaleDownOnPhaseChange = 0.8;
// Animation parameters for capture bar overlapping the user capture region.
// The default animation duration for opacity changes to the capture bar.
constexpr base::TimeDelta kCaptureBarOpacityChangeDuration =
base::TimeDelta::FromMilliseconds(100);
base::Milliseconds(100);
// The animation duration for showing the capture bar on mouse/touch release.
constexpr base::TimeDelta kCaptureBarOnReleaseOpacityChangeDuration =
base::TimeDelta::FromMilliseconds(167);
base::Milliseconds(167);
// When the capture bar and user capture region overlap and the mouse is not
// hovering over the capture bar, drop the opacity to this value to make the
// region easier to see.

@ -452,8 +452,7 @@ class CaptureModeTest : public AshTestBase {
while (!controller->is_recording_in_progress()) {
base::RunLoop run_loop;
base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
FROM_HERE, run_loop.QuitClosure(),
base::TimeDelta::FromMilliseconds(100));
FROM_HERE, run_loop.QuitClosure(), base::Milliseconds(100));
run_loop.Run();
}
}
@ -482,7 +481,7 @@ class CaptureModeTest : public AshTestBase {
base::RunLoop loop;
base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
FROM_HERE, base::BindLambdaForTesting([&]() { loop.Quit(); }),
base::TimeDelta::FromSeconds(seconds));
base::Seconds(seconds));
loop.Run();
}
@ -3678,13 +3677,13 @@ TEST_F(CaptureModeMockTimeTest, ConsecutiveScreenshotsHistograms) {
SelectRegion(capture_region);
take_n_screenshots(3);
histogram_tester.ExpectBucketCount(kConsecutiveScreenshotsHistogram, 3, 0);
task_environment()->FastForwardBy(base::TimeDelta::FromSeconds(5));
task_environment()->FastForwardBy(base::Seconds(5));
histogram_tester.ExpectBucketCount(kConsecutiveScreenshotsHistogram, 3, 1);
// Take only one screenshot. This should not be recorded.
take_n_screenshots(1);
histogram_tester.ExpectBucketCount(kConsecutiveScreenshotsHistogram, 1, 0);
task_environment()->FastForwardBy(base::TimeDelta::FromSeconds(5));
task_environment()->FastForwardBy(base::Seconds(5));
histogram_tester.ExpectBucketCount(kConsecutiveScreenshotsHistogram, 1, 0);
// Take a screenshot, change source and take another screenshot. This should
@ -3694,7 +3693,7 @@ TEST_F(CaptureModeMockTimeTest, ConsecutiveScreenshotsHistograms) {
CaptureModeType::kImage);
controller->PerformCapture();
histogram_tester.ExpectBucketCount(kConsecutiveScreenshotsHistogram, 2, 0);
task_environment()->FastForwardBy(base::TimeDelta::FromSeconds(5));
task_environment()->FastForwardBy(base::Seconds(5));
histogram_tester.ExpectBucketCount(kConsecutiveScreenshotsHistogram, 2, 1);
}
@ -3712,7 +3711,7 @@ TEST_F(CaptureModeMockTimeTest, ClearUserCaptureRegionBetweenSessions) {
// Start region image capture again shortly after the previous capture
// session, we should still be able to reuse the previous capture region.
task_environment()->FastForwardBy(base::TimeDelta::FromMinutes(1));
task_environment()->FastForwardBy(base::Minutes(1));
StartImageRegionCapture();
EXPECT_EQ(capture_region, controller->user_capture_region());
auto* event_generator = GetEventGenerator();
@ -3722,7 +3721,7 @@ TEST_F(CaptureModeMockTimeTest, ClearUserCaptureRegionBetweenSessions) {
// Wait for 8 second and then start region image capture again. We should have
// forgot the previous capture region.
task_environment()->FastForwardBy(base::TimeDelta::FromMinutes(8));
task_environment()->FastForwardBy(base::Minutes(8));
StartImageRegionCapture();
EXPECT_EQ(gfx::Rect(), controller->user_capture_region());
}

@ -47,14 +47,13 @@ namespace {
// events that are too frequent will be throttled. We use the frame duration as
// the minimum delay between any two successive such events that we use to
// update the cursor overlay.
constexpr base::TimeDelta kCursorEventsThrottleDelay =
base::TimeDelta::FromHz(30);
constexpr base::TimeDelta kCursorEventsThrottleDelay = base::Hertz(30);
// Window resizes can be done on many intermediate steps. This delay is used to
// throttle these resize events so that we send the final size of the window to
// the recording service when it stabilizes.
constexpr base::TimeDelta kWindowSizeChangeThrottleDelay =
base::TimeDelta::FromMilliseconds(250);
base::Milliseconds(250);
// Returns true if |window_1| and |window_2| are both windows that belong to
// the same Desk. Note that it will return false for windows that don't belong

@ -121,7 +121,7 @@ void ClipboardHistory::OnClipboardDataChanged() {
base::BindOnce(&ClipboardHistory::OnClipboardOperation,
clipboard_histogram_weak_factory_.GetWeakPtr(),
/*copy=*/true),
base::TimeDelta::FromMilliseconds(100));
base::Milliseconds(100));
// We post commit |clipboard_data| at the end of the current task sequence to
// debounce the case where multiple copies are programmatically performed.
@ -153,7 +153,7 @@ void ClipboardHistory::OnClipboardDataRead() {
base::BindOnce(&ClipboardHistory::OnClipboardOperation,
clipboard_histogram_weak_factory_.GetWeakPtr(),
/*copy=*/false),
base::TimeDelta::FromMilliseconds(100));
base::Milliseconds(100));
}
void ClipboardHistory::OnClipboardOperation(bool copy) {

@ -644,7 +644,7 @@ void ClipboardHistoryControllerImpl::PasteClipboardHistoryItem(
GetClipboard()->WriteClipboardData(std::move(original_data));
},
weak_ptr_factory_.GetWeakPtr(), std::move(original_data)),
base::TimeDelta::FromMilliseconds(200));
base::Milliseconds(200));
}
void ClipboardHistoryControllerImpl::DeleteSelectedMenuItemIfAny() {

@ -51,9 +51,8 @@ const char kScreenshotNotification_PasteTime[] =
constexpr int kNotificationLimit = 3;
constexpr int kContextMenuBadgeShowLimit = 3;
constexpr base::TimeDelta kMinInterval = base::TimeDelta::FromDays(1);
constexpr base::TimeDelta kMaxTimeBetweenPaste =
base::TimeDelta::FromMinutes(10);
constexpr base::TimeDelta kMinInterval = base::Days(1);
constexpr base::TimeDelta kMaxTimeBetweenPaste = base::Minutes(10);
} // namespace ash

@ -72,7 +72,7 @@ class ClipboardNudgeControllerTest : public AshTestBase {
nudge_controller_ =
Shell::Get()->clipboard_history_controller()->nudge_controller();
nudge_controller_->OverrideClockForTesting(&test_clock_);
test_clock_.Advance(base::TimeDelta::FromSeconds(360));
test_clock_.Advance(base::Seconds(360));
}
void TearDown() override {

@ -35,13 +35,11 @@ namespace {
// The duration of the fade out animation for transitioning the placeholder
// image to rendered HTML.
constexpr base::TimeDelta kFadeOutDurationMs =
base::TimeDelta::FromMilliseconds(60);
constexpr base::TimeDelta kFadeOutDurationMs = base::Milliseconds(60);
// The duration of the fade in animation for transitioning the placeholder image
// to rendered HTML.
constexpr base::TimeDelta kFadeInDurationMs =
base::TimeDelta::FromMilliseconds(200);
constexpr base::TimeDelta kFadeInDurationMs = base::Milliseconds(200);
////////////////////////////////////////////////////////////////////////////////
// FadeImageView

@ -1822,9 +1822,8 @@ void CrasAudioHandler::StartHDMIRediscoverGracePeriod() {
hdmi_rediscover_timer_.Stop();
hdmi_rediscover_timer_.Start(
FROM_HERE,
base::TimeDelta::FromMilliseconds(
hdmi_rediscover_grace_period_duration_in_ms_),
this, &CrasAudioHandler::UpdateAudioAfterHDMIRediscoverGracePeriod);
base::Milliseconds(hdmi_rediscover_grace_period_duration_in_ms_), this,
&CrasAudioHandler::UpdateAudioAfterHDMIRediscoverGracePeriod);
}
void CrasAudioHandler::SetHDMIRediscoverGracePeriodForTesting(

@ -518,7 +518,7 @@ class HDMIRediscoverWaiter {
base::RunLoop run_loop;
base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
FROM_HERE, run_loop.QuitClosure(),
base::TimeDelta::FromMilliseconds(wait_duration_in_ms));
base::Milliseconds(wait_duration_in_ms));
run_loop.Run();
}
@ -531,7 +531,7 @@ class HDMIRediscoverWaiter {
FROM_HERE,
base::BindOnce(&HDMIRediscoverWaiter::CheckHDMIRediscoverGracePeriodEnd,
base::Unretained(this), std::move(quit_loop_func)),
base::TimeDelta::FromMilliseconds(grace_period_duration_in_ms_ / 4));
base::Milliseconds(grace_period_duration_in_ms_ / 4));
}
void WaitUntilHDMIRediscoverGracePeriodEnd() {

@ -61,7 +61,7 @@ void DriveFsAuth::GetAccessToken(
get_access_token_callback_ = std::move(callback);
// Timer is cancelled when it is destroyed, so use base::Unretained().
timer_->Start(
FROM_HERE, base::TimeDelta::FromSeconds(30),
FROM_HERE, base::Seconds(30),
base::BindOnce(&DriveFsAuth::AuthTimeout, base::Unretained(this)));
std::set<std::string> scopes({"https://www.googleapis.com/auth/drive"});
access_token_fetcher_ =

@ -28,7 +28,7 @@ namespace {
using testing::_;
constexpr char kTestEmail[] = "test@example.com";
constexpr base::TimeDelta kTokenLifetime = base::TimeDelta::FromHours(1);
constexpr base::TimeDelta kTokenLifetime = base::Hours(1);
class AuthDelegateImpl : public DriveFsAuth::Delegate {
public:
@ -281,7 +281,7 @@ TEST_F(DriveFsAuthTest, CacheExpired) {
EXPECT_TRUE(identity_test_env_.IsAccessTokenRequestPending());
RespondWithAccessToken("auth token");
clock_.Advance(base::TimeDelta::FromHours(2));
clock_.Advance(base::Hours(2));
// The token expired so a new one is requested.
auth_->GetAccessToken(true, base::BindOnce([](mojom::AccessTokenStatus status,

@ -48,7 +48,7 @@ using base::test::RunOnceClosure;
using testing::_;
using MountFailure = DriveFsHost::MountObserver::MountFailure;
constexpr base::TimeDelta kTokenLifetime = base::TimeDelta::FromHours(1);
constexpr base::TimeDelta kTokenLifetime = base::Hours(1);
class MockDriveFs : public mojom::DriveFsInterceptorForTesting,
public mojom::SearchQuery {
@ -738,7 +738,7 @@ TEST_F(DriveFsHostTest, Remount_CachedOnceOnly) {
"auth token", clock_.Now() + kTokenLifetime);
EXPECT_FALSE(identity_test_env_.IsAccessTokenRequestPending());
absl::optional<base::TimeDelta> delay = base::TimeDelta::FromSeconds(5);
absl::optional<base::TimeDelta> delay = base::Seconds(5);
EXPECT_CALL(*host_delegate_, OnUnmounted(delay));
SendOnUnmounted(delay);
base::RunLoop().RunUntilIdle();
@ -774,7 +774,7 @@ TEST_F(DriveFsHostTest, Remount_RequestInflight) {
base::BindLambdaForTesting([&](mojom::AccessTokenStatus status,
const std::string& token) { FAIL(); }));
absl::optional<base::TimeDelta> delay = base::TimeDelta::FromSeconds(5);
absl::optional<base::TimeDelta> delay = base::Seconds(5);
EXPECT_CALL(*host_delegate_, OnUnmounted(delay));
SendOnUnmounted(delay);
base::RunLoop().RunUntilIdle();
@ -799,7 +799,7 @@ TEST_F(DriveFsHostTest, Remount_RequestInflightCompleteAfterMount) {
base::BindLambdaForTesting([&](mojom::AccessTokenStatus status,
const std::string& token) { FAIL(); }));
absl::optional<base::TimeDelta> delay = base::TimeDelta::FromSeconds(5);
absl::optional<base::TimeDelta> delay = base::Seconds(5);
EXPECT_CALL(*host_delegate_, OnUnmounted(delay));
SendOnUnmounted(delay);
base::RunLoop().RunUntilIdle();

@ -15,7 +15,7 @@ namespace drivefs {
namespace {
constexpr base::TimeDelta kQueryCacheTtl = base::TimeDelta::FromMinutes(5);
constexpr base::TimeDelta kQueryCacheTtl = base::Minutes(5);
bool IsCloudSharedWithMeQuery(const drivefs::mojom::QueryParametersPtr& query) {
return query->query_source ==

@ -287,7 +287,7 @@ TEST_F(DriveFsSearchTest, Search_SharedWithMeCaching) {
EXPECT_TRUE(called);
// Time has passed...
clock_.Advance(base::TimeDelta::FromHours(1));
clock_.Advance(base::Hours(1));
params = mojom::QueryParameters::New();
params->query_source = mojom::QueryParameters::QuerySource::kCloudOnly;

@ -20,7 +20,7 @@ using MountFailure = DriveFsSession::MountObserver::MountFailure;
constexpr char kDataDirOption[] = "datadir=";
constexpr char kMyFilesOption[] = "myfiles=";
constexpr char kMountScheme[] = "drivefs://";
constexpr base::TimeDelta kMountTimeout = base::TimeDelta::FromSeconds(20);
constexpr base::TimeDelta kMountTimeout = base::Seconds(20);
class DiskMounterImpl : public DiskMounter {
public:

Some files were not shown because too many files have changed in this diff Show More