diff options
Diffstat (limited to 'chrome/browser')
18 files changed, 66 insertions, 57 deletions
diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm index 012c14b..5468834 100644 --- a/chrome/browser/app_controller_mac.mm +++ b/chrome/browser/app_controller_mac.mm @@ -164,8 +164,10 @@ void RecordLastRunAppBundlePath() { BaseBundleID_CFString()); // Sync after a delay avoid I/O contention on startup; 1500 ms is plenty. - BrowserThread::PostDelayedTask(BrowserThread::FILE, FROM_HERE, - base::Bind(&PrefsSyncCallback), 1500); + BrowserThread::PostDelayedTask( + BrowserThread::FILE, FROM_HERE, + base::Bind(&PrefsSyncCallback), + base::TimeDelta::FromMilliseconds(1500)); } } // anonymous namespace diff --git a/chrome/browser/chromeos/audio/audio_mixer_alsa.cc b/chrome/browser/chromeos/audio/audio_mixer_alsa.cc index 40d1142..c51cca8 100644 --- a/chrome/browser/chromeos/audio/audio_mixer_alsa.cc +++ b/chrome/browser/chromeos/audio/audio_mixer_alsa.cc @@ -161,7 +161,7 @@ void AudioMixerAlsa::Connect() { if (!ConnectInternal()) { thread_->message_loop()->PostDelayedTask(FROM_HERE, base::Bind(&AudioMixerAlsa::Connect, base::Unretained(this)), - kConnectionRetrySleepSec * 1000); + base::TimeDelta::FromSeconds(kConnectionRetrySleepSec)); } } diff --git a/chrome/browser/chromeos/boot_times_loader.cc b/chrome/browser/chromeos/boot_times_loader.cc index 2f9779f..7df1807 100644 --- a/chrome/browser/chromeos/boot_times_loader.cc +++ b/chrome/browser/chromeos/boot_times_loader.cc @@ -234,7 +234,7 @@ void BootTimesLoader::Backend::GetBootTimes( BrowserThread::FILE, FROM_HERE, base::Bind(&Backend::GetBootTimes, this, request), - kReadAttemptDelayMs); + base::TimeDelta::FromMilliseconds(kReadAttemptDelayMs)); return; } @@ -366,7 +366,7 @@ void BootTimesLoader::LoginDone() { BrowserThread::FILE, FROM_HERE, base::Bind(&WriteTimes, kLoginTimes, kUmaLogin, kUmaLoginPrefix, login_time_markers_), - kLoginTimeWriteDelayMs); + base::TimeDelta::FromMilliseconds(kLoginTimeWriteDelayMs)); } void BootTimesLoader::WriteLogoutTimes() { diff --git a/chrome/browser/chromeos/extensions/file_browser_event_router.cc b/chrome/browser/chromeos/extensions/file_browser_event_router.cc index 6ecebdf..ba82050 100644 --- a/chrome/browser/chromeos/extensions/file_browser_event_router.cc +++ b/chrome/browser/chromeos/extensions/file_browser_event_router.cc @@ -585,7 +585,7 @@ void FileBrowserEventRouter::OnDeviceAdded( notifications_->RegisterDevice(device_path); notifications_->ShowNotificationDelayed(FileBrowserNotifications::DEVICE, device_path, - 5000); + base::TimeDelta::FromSeconds(5)); } void FileBrowserEventRouter::OnDeviceRemoved( @@ -630,7 +630,9 @@ void FileBrowserEventRouter::OnFormattingFinished( device_path); // Hide it after a couple of seconds. notifications_->HideNotificationDelayed( - FileBrowserNotifications::FORMAT_SUCCESS, device_path, 4000); + FileBrowserNotifications::FORMAT_SUCCESS, + device_path, + base::TimeDelta::FromSeconds(4)); // MountPath auto-detects filesystem format if second argument is empty. // The third argument (mount label) is not used in a disk mount operation. DiskMountManager::GetInstance()->MountPath(device_path, std::string(), diff --git a/chrome/browser/chromeos/extensions/file_browser_notifications.cc b/chrome/browser/chromeos/extensions/file_browser_notifications.cc index d7a5186..946337d 100644 --- a/chrome/browser/chromeos/extensions/file_browser_notifications.cc +++ b/chrome/browser/chromeos/extensions/file_browser_notifications.cc @@ -130,15 +130,15 @@ void FileBrowserNotifications::ShowNotificationWithMessage( } } -void FileBrowserNotifications::ShowNotificationDelayed(NotificationType type, - const std::string& path, size_t delay_ms) { +void FileBrowserNotifications::ShowNotificationDelayed( + NotificationType type, const std::string& path, base::TimeDelta delay) { std::string notification_id; CreateNotificationId(type, path, ¬ification_id); CreateNotification(notification_id, GetIconId(type), GetTitleId(type)); PostDelayedShowNotificationTask(notification_id, type, l10n_util::GetStringUTF16(GetMessageId(type)), - delay_ms); + delay); } void FileBrowserNotifications::HideNotification(NotificationType type, @@ -153,19 +153,18 @@ void FileBrowserNotifications::HideNotification(NotificationType type, } } -void FileBrowserNotifications::HideNotificationDelayed(NotificationType type, - const std::string& path, - size_t delay_ms) { - PostDelayedHideNotificationTask(type, path, delay_ms); +void FileBrowserNotifications::HideNotificationDelayed( + NotificationType type, const std::string& path, base::TimeDelta delay) { + PostDelayedHideNotificationTask(type, path, delay); } void FileBrowserNotifications::PostDelayedShowNotificationTask( const std::string& notification_id, NotificationType type, - const string16& message, size_t delay_ms) { + const string16& message, base::TimeDelta delay) { MessageLoop::current()->PostDelayedTask(FROM_HERE, base::Bind(&ShowNotificationDelayedTask, notification_id, type, message, AsWeakPtr()), - delay_ms); + delay); } // static @@ -188,10 +187,10 @@ void FileBrowserNotifications::ShowNotificationDelayedTask( } void FileBrowserNotifications::PostDelayedHideNotificationTask( - NotificationType type, const std::string path, size_t delay_ms) { + NotificationType type, const std::string path, base::TimeDelta delay) { MessageLoop::current()->PostDelayedTask(FROM_HERE, base::Bind(&HideNotificationDelayedTask, type, path, AsWeakPtr()), - delay_ms); + delay); } // static diff --git a/chrome/browser/chromeos/extensions/file_browser_notifications.h b/chrome/browser/chromeos/extensions/file_browser_notifications.h index 2522f4f..c646581 100644 --- a/chrome/browser/chromeos/extensions/file_browser_notifications.h +++ b/chrome/browser/chromeos/extensions/file_browser_notifications.h @@ -52,7 +52,7 @@ class FileBrowserNotifications void ShowNotification(NotificationType type, const std::string& path); void ShowNotificationDelayed(NotificationType type, const std::string& path, - size_t delay_ms); + base::TimeDelta delay); virtual void ShowNotificationWithMessage(NotificationType type, const std::string& path, const string16& message); @@ -60,7 +60,7 @@ class FileBrowserNotifications virtual void HideNotification(NotificationType type, const std::string& path); void HideNotificationDelayed(NotificationType type, const std::string& path, - size_t delay_ms); + base::TimeDelta delay); const NotificationMap& notifications() const { return notifications_; } @@ -69,15 +69,14 @@ class FileBrowserNotifications const std::string& notification_id, NotificationType type, const string16& message, - size_t delay_ms); + base::TimeDelta delay); static void ShowNotificationDelayedTask(const std::string& notification_id, NotificationType type, const string16& message, base::WeakPtr<FileBrowserNotifications> self); - virtual void PostDelayedHideNotificationTask(NotificationType type, - const std::string path, - size_t delay_ms); + virtual void PostDelayedHideNotificationTask( + NotificationType type, const std::string path, base::TimeDelta delay); static void HideNotificationDelayedTask(NotificationType type, const std::string& path, base::WeakPtr<FileBrowserNotifications> self); diff --git a/chrome/browser/chromeos/extensions/file_browser_notifications_browsertest.cc b/chrome/browser/chromeos/extensions/file_browser_notifications_browsertest.cc index bb2f99d..3d6276a 100644 --- a/chrome/browser/chromeos/extensions/file_browser_notifications_browsertest.cc +++ b/chrome/browser/chromeos/extensions/file_browser_notifications_browsertest.cc @@ -30,7 +30,7 @@ class MockFileBrowserNotifications : public FileBrowserNotifications { const std::string& notification_id, NotificationType type, const string16& message, - size_t delay_ms) OVERRIDE { + base::TimeDelta delay) OVERRIDE { show_callback_data_.id = notification_id; show_callback_data_.type = type; show_callback_data_.message = message; @@ -39,7 +39,7 @@ class MockFileBrowserNotifications : public FileBrowserNotifications { // Records the notification so we can force it to hide later. virtual void PostDelayedHideNotificationTask(NotificationType type, const std::string path, - size_t delay_ms) OVERRIDE { + base::TimeDelta delay) OVERRIDE { hide_callback_data_.type = type; hide_callback_data_.path = path; } @@ -168,7 +168,8 @@ IN_PROC_BROWSER_TEST_F(FileBrowserNotificationsTest, ShowDelayedTest) { InitNotifications(); // Adding a delayed notification does not show a balloon. notifications_->ShowNotificationDelayed(FileBrowserNotifications::DEVICE, - "path", 3000); + "path", + base::TimeDelta::FromSeconds(3)); EXPECT_EQ(0u, collection_->GetActiveBalloons().size()); // Forcing the show to happen makes the balloon appear. @@ -180,7 +181,8 @@ IN_PROC_BROWSER_TEST_F(FileBrowserNotificationsTest, ShowDelayedTest) { // Showing a notification both immediately and delayed results in one // additional balloon. notifications_->ShowNotificationDelayed(FileBrowserNotifications::DEVICE_FAIL, - "path", 3000); + "path", + base::TimeDelta::FromSeconds(3)); notifications_->ShowNotification(FileBrowserNotifications::DEVICE_FAIL, "path"); EXPECT_EQ(2u, collection_->GetActiveBalloons().size()); @@ -197,8 +199,9 @@ IN_PROC_BROWSER_TEST_F(FileBrowserNotificationsTest, ShowDelayedTest) { // If we schedule a show for later, then hide before it becomes visible, // the balloon should not be added. - notifications_->ShowNotificationDelayed( - FileBrowserNotifications::FORMAT_FAIL, "path", 3000); + notifications_->ShowNotificationDelayed(FileBrowserNotifications::FORMAT_FAIL, + "path", + base::TimeDelta::FromSeconds(3)); notifications_->HideNotification(FileBrowserNotifications::FORMAT_FAIL, "path"); EXPECT_EQ(2u, collection_->GetActiveBalloons().size()); @@ -221,7 +224,8 @@ IN_PROC_BROWSER_TEST_F(FileBrowserNotificationsTest, HideDelayedTest) { // Showing now, and scheduling a hide for later, results in one balloon. notifications_->ShowNotification(FileBrowserNotifications::DEVICE, "path"); notifications_->HideNotificationDelayed(FileBrowserNotifications::DEVICE, - "path", 3000); + "path", + base::TimeDelta::FromSeconds(3)); EXPECT_EQ(1u, collection_->GetActiveBalloons().size()); EXPECT_TRUE(FindBalloon("Dpath")); @@ -240,7 +244,8 @@ IN_PROC_BROWSER_TEST_F(FileBrowserNotificationsTest, HideDelayedTest) { // Delayed hide for a notification that doesn't exist does nothing. notifications_->HideNotificationDelayed(FileBrowserNotifications::DEVICE_FAIL, - "path", 3000); + "path", + base::TimeDelta::FromSeconds(3)); notifications_->ExecuteHide(); ui_test_utils::RunAllPendingInMessageLoop(); EXPECT_EQ(0u, collection_->GetActiveBalloons().size()); diff --git a/chrome/browser/chromeos/external_metrics.cc b/chrome/browser/chromeos/external_metrics.cc index c3a6188..fbb2eec 100644 --- a/chrome/browser/chromeos/external_metrics.cc +++ b/chrome/browser/chromeos/external_metrics.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -31,8 +31,8 @@ using content::UserMetricsAction; namespace chromeos { -// The interval between external metrics collections, in milliseconds. -static const int kExternalMetricsCollectionIntervalMs = 30 * 1000; +// The interval between external metrics collections in seconds +static const int kExternalMetricsCollectionIntervalSeconds = 30; ExternalMetrics::ExternalMetrics() : test_recorder_(NULL) { @@ -240,7 +240,7 @@ void ExternalMetrics::ScheduleCollector() { result = BrowserThread::PostDelayedTask( BrowserThread::FILE, FROM_HERE, base::Bind(&chromeos::ExternalMetrics::CollectEventsAndReschedule, this), - kExternalMetricsCollectionIntervalMs); + base::TimeDelta::FromSeconds(kExternalMetricsCollectionIntervalSeconds)); DCHECK(result); } diff --git a/chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.cc b/chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.cc index f1c3a95..82b17d3 100644 --- a/chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.cc +++ b/chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.cc @@ -169,7 +169,7 @@ KioskModeSettings::KioskModeSettings() : is_initialized_(false) { content::BrowserThread::UI, FROM_HERE, base::Bind(&KioskModeSettings::VerifyModeIsKnown, base::Unretained(this)), - kDeviceModeFetchRetryDelayMs); + base::TimeDelta::FromMilliseconds(kDeviceModeFetchRetryDelayMs)); } } is_kiosk_mode_ = false; @@ -190,7 +190,7 @@ void KioskModeSettings::VerifyModeIsKnown() { content::BrowserThread::UI, FROM_HERE, base::Bind(&KioskModeSettings::VerifyModeIsKnown, base::Unretained(this)), - kDeviceModeFetchRetryDelayMs); + base::TimeDelta::FromMilliseconds(kDeviceModeFetchRetryDelayMs)); break; case policy::DEVICE_MODE_KIOSK: BrowserList::ExitCleanly(); diff --git a/chrome/browser/chromeos/net/network_change_notifier_chromeos.cc b/chrome/browser/chromeos/net/network_change_notifier_chromeos.cc index dd9b2c8..1f93afd 100644 --- a/chrome/browser/chromeos/net/network_change_notifier_chromeos.cc +++ b/chrome/browser/chromeos/net/network_change_notifier_chromeos.cc @@ -35,7 +35,7 @@ NetworkChangeNotifierChromeos::NetworkChangeNotifierChromeos() BrowserThread::UI, FROM_HERE, base::Bind( &NetworkChangeNotifierChromeos::UpdateInitialState, this), - kInitialNotificationCheckDelayMS); + base::TimeDelta::FromMilliseconds(kInitialNotificationCheckDelayMS)); } NetworkChangeNotifierChromeos::~NetworkChangeNotifierChromeos() { @@ -196,7 +196,7 @@ void NetworkChangeNotifierChromeos::ReportOnlineStateChange(bool is_online) { base::Bind( &NetworkChangeNotifierChromeos::ReportOnlineStateChangeOnUIThread, weak_factory_.GetWeakPtr()), - kOnlineNotificationDelayMS); + base::TimeDelta::FromMilliseconds(kOnlineNotificationDelayMS)); } void NetworkChangeNotifierChromeos::ReportOnlineStateChangeOnUIThread() { diff --git a/chrome/browser/chromeos/web_socket_proxy_controller.cc b/chrome/browser/chromeos/web_socket_proxy_controller.cc index 50d286c..d356ff9 100644 --- a/chrome/browser/chromeos/web_socket_proxy_controller.cc +++ b/chrome/browser/chromeos/web_socket_proxy_controller.cc @@ -101,12 +101,12 @@ class ProxyLifetime MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&ProxyLifetime::ProxyCallback, base::Unretained(this)), - delay_ms_); + base::TimeDelta::FromMilliseconds(delay_ms_)); } } } - // Delay between next attempt to run proxy. + // Delay in milliseconds between next attempt to run proxy. int volatile delay_ms_; // Proxy listens for incoming websocket connections on this port. diff --git a/chrome/browser/debugger/devtools_sanity_browsertest.cc b/chrome/browser/debugger/devtools_sanity_browsertest.cc index abb52e8..f6ca130 100644 --- a/chrome/browser/debugger/devtools_sanity_browsertest.cc +++ b/chrome/browser/debugger/devtools_sanity_browsertest.cc @@ -561,6 +561,8 @@ IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestPageWithNoJavaScript) { #if defined(OS_MACOSX) #define MAYBE_InspectSharedWorker DISABLED_InspectSharedWorker +#elif defined(OS_WIN) +#define MAYBE_InspectSharedWorker DISABLED_InspectSharedWorker #elif !defined(NDEBUG) // Now fails consistently on Windows and Linux debug, http://crbug.com/115192 #define MAYBE_InspectSharedWorker DISABLED_InspectSharedWorker diff --git a/chrome/browser/geolocation/wifi_data_provider_chromeos.cc b/chrome/browser/geolocation/wifi_data_provider_chromeos.cc index 9ef3c9f..a415c66 100644 --- a/chrome/browser/geolocation/wifi_data_provider_chromeos.cc +++ b/chrome/browser/geolocation/wifi_data_provider_chromeos.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -215,7 +215,7 @@ void WifiDataProviderChromeOs::ScheduleNextScan(int interval) { BrowserThread::UI, FROM_HERE, base::Bind(&WifiDataProviderChromeOs::DoWifiScanTaskOnUIThread, this), - interval); + base::TimeDelta::FromMilliseconds(interval)); } void WifiDataProviderChromeOs::ScheduleStop() { diff --git a/chrome/browser/ui/views/browser_actions_container.cc b/chrome/browser/ui/views/browser_actions_container.cc index 29971f0..5fb9050 100644 --- a/chrome/browser/ui/views/browser_actions_container.cc +++ b/chrome/browser/ui/views/browser_actions_container.cc @@ -1046,12 +1046,11 @@ void BrowserActionsContainer::StopShowFolderDropMenuTimer() { } void BrowserActionsContainer::StartShowFolderDropMenuTimer() { - int delay = views::GetMenuShowDelay(); MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&BrowserActionsContainer::ShowDropFolder, show_menu_task_factory_.GetWeakPtr()), - delay); + base::TimeDelta::FromMilliseconds(views::GetMenuShowDelay())); } void BrowserActionsContainer::ShowDropFolder() { diff --git a/chrome/browser/ui/views/download/download_item_view.cc b/chrome/browser/ui/views/download/download_item_view.cc index e17fd28..aa16a4b 100644 --- a/chrome/browser/ui/views/download/download_item_view.cc +++ b/chrome/browser/ui/views/download/download_item_view.cc @@ -326,7 +326,7 @@ void DownloadItemView::OnDownloadOpened(DownloadItem* download) { FROM_HERE, base::Bind(&DownloadItemView::Reenable, weak_ptr_factory_.GetWeakPtr()), - kDisabledOnOpenDuration); + base::TimeDelta::FromMilliseconds(kDisabledOnOpenDuration)); // Notify our parent. parent_->OpenedDownload(this); diff --git a/chrome/browser/ui/views/download/download_shelf_view.cc b/chrome/browser/ui/views/download/download_shelf_view.cc index 8660740..1b7bc94 100644 --- a/chrome/browser/ui/views/download/download_shelf_view.cc +++ b/chrome/browser/ui/views/download/download_shelf_view.cc @@ -96,7 +96,8 @@ DownloadShelfView::DownloadShelfView(Browser* browser, BrowserView* parent) ALLOW_THIS_IN_INITIALIZER_LIST( mouse_watcher_(new views::MouseWatcherViewHost(this, gfx::Insets()), this)) { - mouse_watcher_.set_notify_on_exit_time_ms(kNotifyOnExitTimeMS); + mouse_watcher_.set_notify_on_exit_time( + base::TimeDelta::FromMilliseconds(kNotifyOnExitTimeMS)); set_id(VIEW_ID_DOWNLOAD_SHELF); parent->AddChildView(this); } diff --git a/chrome/browser/ui/views/extensions/extension_installed_bubble.cc b/chrome/browser/ui/views/extensions/extension_installed_bubble.cc index 8b767db..aa31288 100644 --- a/chrome/browser/ui/views/extensions/extension_installed_bubble.cc +++ b/chrome/browser/ui/views/extensions/extension_installed_bubble.cc @@ -421,7 +421,7 @@ void ExtensionInstalledBubble::ShowInternal() { FROM_HERE, base::Bind(&ExtensionInstalledBubble::ShowInternal, base::Unretained(this)), - kAnimationWaitTime); + base::TimeDelta::FromMilliseconds(kAnimationWaitTime)); return; } reference_view = container->GetBrowserActionView( diff --git a/chrome/browser/ui/views/status_bubble_views.cc b/chrome/browser/ui/views/status_bubble_views.cc index 13bce71..9d23448 100644 --- a/chrome/browser/ui/views/status_bubble_views.cc +++ b/chrome/browser/ui/views/status_bubble_views.cc @@ -138,10 +138,10 @@ class StatusBubbleViews::StatusView : public views::Label, class InitialTimer; // Manage the timers that control the delay before a fade begins or ends. - void StartTimer(int time); + void StartTimer(base::TimeDelta time); void OnTimer(); void CancelTimer(); - void RestartTimer(int delay); + void RestartTimer(base::TimeDelta delay); // Manage the fades and starting and stopping the animations correctly. void StartFade(double start, double end, int duration); @@ -212,7 +212,7 @@ void StatusBubbleViews::StatusView::Hide() { stage_ = BUBBLE_HIDDEN; } -void StatusBubbleViews::StatusView::StartTimer(int time) { +void StatusBubbleViews::StatusView::StartTimer(base::TimeDelta time) { if (timer_factory_.HasWeakPtrs()) timer_factory_.InvalidateWeakPtrs(); @@ -238,7 +238,7 @@ void StatusBubbleViews::StatusView::CancelTimer() { timer_factory_.InvalidateWeakPtrs(); } -void StatusBubbleViews::StatusView::RestartTimer(int delay) { +void StatusBubbleViews::StatusView::RestartTimer(base::TimeDelta delay) { CancelTimer(); StartTimer(delay); } @@ -247,7 +247,7 @@ void StatusBubbleViews::StatusView::ResetTimer() { if (stage_ == BUBBLE_SHOWING_TIMER) { // We hadn't yet begun showing anything when we received a new request // for something to show, so we start from scratch. - RestartTimer(kShowDelay); + RestartTimer(base::TimeDelta::FromMilliseconds(kShowDelay)); } } @@ -265,7 +265,7 @@ void StatusBubbleViews::StatusView::StartFade(double start, void StatusBubbleViews::StatusView::StartHiding() { if (stage_ == BUBBLE_SHOWN) { stage_ = BUBBLE_HIDING_TIMER; - StartTimer(kHideDelay); + StartTimer(base::TimeDelta::FromMilliseconds(kHideDelay)); } else if (stage_ == BUBBLE_SHOWING_TIMER) { stage_ = BUBBLE_HIDDEN; popup_->Hide(); @@ -285,7 +285,7 @@ void StatusBubbleViews::StatusView::StartShowing() { if (stage_ == BUBBLE_HIDDEN) { popup_->Show(); stage_ = BUBBLE_SHOWING_TIMER; - StartTimer(kShowDelay); + StartTimer(base::TimeDelta::FromMilliseconds(kShowDelay)); } else if (stage_ == BUBBLE_HIDING_TIMER) { stage_ = BUBBLE_SHOWN; CancelTimer(); @@ -679,7 +679,7 @@ void StatusBubbleViews::SetURL(const GURL& url, const std::string& languages) { FROM_HERE, base::Bind(&StatusBubbleViews::ExpandBubble, expand_timer_factory_.GetWeakPtr()), - kExpandHoverDelay); + base::TimeDelta::FromMilliseconds(kExpandHoverDelay)); } } } |