diff options
author | derat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-16 13:47:14 +0000 |
---|---|---|
committer | derat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-16 13:47:14 +0000 |
commit | 7ca243fb9216532891f3f89a7b4c58d934243727 (patch) | |
tree | c099d0ce504c8537922e3921226d8b697f96bd0e | |
parent | b01f7e19dbb8989e7f129c4f47e1a0d463e09a94 (diff) | |
download | chromium_src-7ca243fb9216532891f3f89a7b4c58d934243727.zip chromium_src-7ca243fb9216532891f3f89a7b4c58d934243727.tar.gz chromium_src-7ca243fb9216532891f3f89a7b4c58d934243727.tar.bz2 |
chromeos: Remove ScreensaverController.
Remove the ScreensaverController class, which isn't being
used anymore. Also remove idle-notification code from
PowerManagerClient.
BUG=none
TBR=yoz@chromium.org
Review URL: https://codereview.chromium.org/26800005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@228911 0039d316-1c4b-4281-b951-d872f2087c98
19 files changed, 0 insertions, 453 deletions
diff --git a/build/ios/grit_whitelist.txt b/build/ios/grit_whitelist.txt index 50e1477..992dade 100644 --- a/build/ios/grit_whitelist.txt +++ b/build/ios/grit_whitelist.txt @@ -247,8 +247,6 @@ IDS_ENABLE_BACKLOADER_DESCRIPTION IDS_ENABLE_BACKLOADER_NAME IDS_ENABLE_BEZEL_TOUCH_DESCRIPTION IDS_ENABLE_BEZEL_TOUCH_NAME -IDS_ENABLE_SCREENSAVER_EXTENSION_DESCRIPTION -IDS_ENABLE_SCREENSAVER_EXTENSION_NAME IDS_ENABLE_TAB_CAPTURE_DESCRIPTION IDS_ENABLE_TAB_CAPTURE_NAME IDS_ERRORPAGES_BUTTON_LESS diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index ee25c3a..621f534d 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -5640,12 +5640,6 @@ Keep your key file in a safe place. You will need it to create new versions of y <message name="IDS_ENABLE_BACKLOADER_DESCRIPTION" desc="Description of the enable background loader flag."> Enable background loader component for hosted applications. </message> - <message name="IDS_ENABLE_SCREENSAVER_EXTENSION_NAME" desc="Title of the enble screensaver extensions flag." > - Enable screensaver extensions. - </message> - <message name="IDS_ENABLE_SCREENSAVER_EXTENSION_DESCRIPTION" desc="Description of the enable screensaver extensions flag."> - Enable screensaver extensions. - </message> <message name="IDS_FLAGS_CONFLICTS_CHECK_NAME" desc="Title of the run conflicts check flag"> Check for known conflicts with 3rd party modules. </message> diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 4f4536a..ec224ae 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc @@ -993,13 +993,6 @@ const Experiment kExperiments[] = { SINGLE_VALUE_TYPE(chromeos::switches::kEnableBackgroundLoader) }, { - "enable-screensaver-extension", - IDS_ENABLE_SCREENSAVER_EXTENSION_NAME, - IDS_ENABLE_SCREENSAVER_EXTENSION_DESCRIPTION, - kOsCrOS, - SINGLE_VALUE_TYPE(chromeos::switches::kEnableScreensaverExtensions) - }, - { "no-discard-tabs", IDS_FLAGS_NO_DISCARD_TABS_NAME, IDS_FLAGS_NO_DISCARD_TABS_DESCRIPTION, diff --git a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc index e03b668..5691582 100644 --- a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc +++ b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc @@ -57,7 +57,6 @@ #include "chrome/browser/chromeos/power/power_button_observer.h" #include "chrome/browser/chromeos/power/power_prefs.h" #include "chrome/browser/chromeos/profiles/profile_helper.h" -#include "chrome/browser/chromeos/screensaver/screensaver_controller.h" #include "chrome/browser/chromeos/settings/device_oauth2_token_service_factory.h" #include "chrome/browser/chromeos/settings/device_settings_service.h" #include "chrome/browser/chromeos/settings/owner_key_util.h" @@ -586,10 +585,6 @@ void ChromeBrowserMainPartsChromeos::PostProfileInit() { // These observers must be initialized after the profile because // they use the profile to dispatch extension events. extension_system_event_observer_.reset(new ExtensionSystemEventObserver()); - if (CommandLine::ForCurrentProcess()->HasSwitch( - switches::kEnableScreensaverExtensions)) { - screensaver_controller_.reset(new ScreensaverController()); - } if (KioskModeSettings::Get()->IsKioskModeEnabled()) { retail_mode_power_save_blocker_ = content::PowerSaveBlocker::Create( content::PowerSaveBlocker::kPowerSaveBlockPreventDisplaySleep, @@ -723,7 +718,6 @@ void ChromeBrowserMainPartsChromeos::PostMainMessageLoopRun() { // Detach D-Bus clients before DBusThreadManager is shut down. power_button_observer_.reset(); - screensaver_controller_.reset(); idle_action_warning_observer_.reset(); // Delete ContactManager while |g_browser_process| is still alive. diff --git a/chrome/browser/chromeos/chrome_browser_main_chromeos.h b/chrome/browser/chromeos/chrome_browser_main_chromeos.h index ba078ef..74df09c 100644 --- a/chrome/browser/chromeos/chrome_browser_main_chromeos.h +++ b/chrome/browser/chromeos/chrome_browser_main_chromeos.h @@ -28,7 +28,6 @@ class MagnificationManager; class PeripheralBatteryObserver; class PowerButtonObserver; class PowerPrefs; -class ScreensaverController; class SessionManagerObserver; class SwapMetrics; @@ -68,7 +67,6 @@ class ChromeBrowserMainPartsChromeos : public ChromeBrowserMainPartsLinux { scoped_ptr<DisplayConfigurationObserver> display_configuration_observer_; scoped_ptr<default_app_order::ExternalLoader> app_order_loader_; scoped_ptr<ExtensionSystemEventObserver> extension_system_event_observer_; - scoped_ptr<ScreensaverController> screensaver_controller_; scoped_ptr<PeripheralBatteryObserver> peripheral_battery_observer_; scoped_ptr<PowerPrefs> power_prefs_; scoped_ptr<PowerButtonObserver> power_button_observer_; diff --git a/chrome/browser/chromeos/screensaver/screensaver_controller.cc b/chrome/browser/chromeos/screensaver/screensaver_controller.cc deleted file mode 100644 index 55e6199..0000000 --- a/chrome/browser/chromeos/screensaver/screensaver_controller.cc +++ /dev/null @@ -1,187 +0,0 @@ -// 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. - -#include "chrome/browser/chromeos/screensaver/screensaver_controller.h" - -#include "ash/screensaver/screensaver_view.h" -#include "ash/shell.h" -#include "ash/wm/user_activity_detector.h" -#include "base/bind.h" -#include "base/callback.h" -#include "base/logging.h" -#include "chrome/browser/chrome_notification_types.h" -#include "chrome/browser/extensions/extension_service.h" -#include "chrome/browser/extensions/extension_system.h" -#include "chrome/browser/profiles/profile_manager.h" -#include "chrome/common/extensions/extension.h" -#include "chrome/common/extensions/manifest_handlers/app_launch_info.h" -#include "chromeos/dbus/dbus_thread_manager.h" -#include "chromeos/dbus/power_manager_client.h" -#include "content/public/browser/notification_service.h" - -namespace { - -const int kScreensaverTimeoutMinutes = 2; - -ExtensionService* GetDefaultExtensionService() { - Profile* default_profile = ProfileManager::GetDefaultProfile(); - DCHECK(default_profile); - ExtensionService* service = - extensions::ExtensionSystem::Get(default_profile)->extension_service(); - DCHECK(service); - - return service; -} - -// Find the screensaver extension for the given service, excluding -// the one with exclude_id. -std::string FindScreensaverExtension(ExtensionService* service, - const std::string& exclude_id) { - const ExtensionSet* extensions = service->extensions(); - if (!extensions) - return std::string(); - - for (ExtensionSet::const_iterator it = extensions->begin(); - it != extensions->end(); - ++it) { - const extensions::Extension* extension = it->get(); - if (extension && - extension->id() != exclude_id && - extension->HasAPIPermission(extensions::APIPermission::kScreensaver)) { - return extension->id(); - } - } - - return std::string(); -} - -void UninstallPreviousScreensavers(const extensions::Extension* current) { - Profile* default_profile = ProfileManager::GetDefaultProfile(); - DCHECK(default_profile); - ExtensionService* service = - extensions::ExtensionSystem::Get(default_profile)->extension_service(); - DCHECK(service); - - std::string screensaver_id; - while ((screensaver_id = FindScreensaverExtension(service, current->id())) - != "") { - string16 error; - if (!service->UninstallExtension(screensaver_id, false, &error)) - LOG(ERROR) - << "Couldn't uninstall previous screensaver extension with id: " - << screensaver_id << " \nError: " << error; - } -} - -} // namespace - -namespace chromeos { - -ScreensaverController::ScreensaverController() - : threshold_(base::TimeDelta::FromMinutes(kScreensaverTimeoutMinutes)), - weak_ptr_factory_(this) { - // Register for extension changes. - registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, - content::NotificationService::AllSources()); - registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, - content::NotificationService::AllSources()); - - std::string screensaver_extension_id = - FindScreensaverExtension(GetDefaultExtensionService(), std::string()); - if (!screensaver_extension_id.empty()) - SetupScreensaver(screensaver_extension_id); -} - -ScreensaverController::~ScreensaverController() { - TeardownScreensaver(); -} - -void ScreensaverController::Observe( - int type, - const content::NotificationSource& source, - const content::NotificationDetails& details) { - switch (type) { - case chrome::NOTIFICATION_EXTENSION_INSTALLED: { - const extensions::Extension* extension = - content::Details<const extensions::InstalledExtensionInfo>(details)-> - extension; - // Uninstall any previously installed screensaver extensions if a new - // screensaver extension is installed. - if (extension->HasAPIPermission(extensions::APIPermission::kScreensaver)) - UninstallPreviousScreensavers(extension); - break; - } - case chrome::NOTIFICATION_EXTENSION_LOADED: { - const extensions::Extension* extension = - content::Details<const extensions::Extension>(details).ptr(); - if (extension->HasAPIPermission(extensions::APIPermission::kScreensaver)) - SetupScreensaver(extension->id()); - break; - } - case chrome::NOTIFICATION_EXTENSION_UNLOADED: { - const extensions::Extension* extension = - content::Details<extensions::UnloadedExtensionInfo>( - details)->extension; - if (extension->id() == screensaver_extension_id_) - TeardownScreensaver(); - break; - } - } -} - -void ScreensaverController::IdleNotify(int64 threshold) { - ExtensionService* service = GetDefaultExtensionService(); - const extensions::Extension* screensaver_extension = - service->GetExtensionById(screensaver_extension_id_, - ExtensionService::INCLUDE_ENABLED); - ash::ShowScreensaver( - extensions::AppLaunchInfo::GetFullLaunchURL(screensaver_extension)); - - if (!ash::Shell::GetInstance()->user_activity_detector()->HasObserver(this)) - ash::Shell::GetInstance()->user_activity_detector()->AddObserver(this); -} - -void ScreensaverController::OnUserActivity(const ui::Event* event) { - // We don't want to handle further user notifications; we'll either login - // the user and close out or or at least close the screensaver. - if (ash::Shell::GetInstance()->user_activity_detector()->HasObserver(this)) - ash::Shell::GetInstance()->user_activity_detector()->RemoveObserver(this); - ash::CloseScreensaver(); - - RequestNextIdleNotification(); -} - -void ScreensaverController::SetupScreensaver( - const std::string& screensaver_extension_id) { - screensaver_extension_id_ = screensaver_extension_id; - - PowerManagerClient* power_manager = - DBusThreadManager::Get()->GetPowerManagerClient(); - if (!power_manager->HasObserver(this)) - power_manager->AddObserver(this); - - RequestNextIdleNotification(); -} - -void ScreensaverController::TeardownScreensaver() { - PowerManagerClient* power_manager = - DBusThreadManager::Get()->GetPowerManagerClient(); - if (power_manager && power_manager->HasObserver(this)) - power_manager->RemoveObserver(this); - - if (ash::Shell::GetInstance() && - ash::Shell::GetInstance()->user_activity_detector()->HasObserver(this)) { - ash::Shell::GetInstance()->user_activity_detector()->RemoveObserver(this); - } - - ash::CloseScreensaver(); - screensaver_extension_id_ = ""; -} - -void ScreensaverController::RequestNextIdleNotification() { - DBusThreadManager::Get()->GetPowerManagerClient()-> - RequestIdleNotification(threshold_.InMilliseconds()); -} - -} // namespace chromeos diff --git a/chrome/browser/chromeos/screensaver/screensaver_controller.h b/chrome/browser/chromeos/screensaver/screensaver_controller.h deleted file mode 100644 index aa69b29..0000000 --- a/chrome/browser/chromeos/screensaver/screensaver_controller.h +++ /dev/null @@ -1,72 +0,0 @@ -// 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. - -#ifndef CHROME_BROWSER_CHROMEOS_SCREENSAVER_SCREENSAVER_CONTROLLER_H_ -#define CHROME_BROWSER_CHROMEOS_SCREENSAVER_SCREENSAVER_CONTROLLER_H_ - -#include <string> - -#include "ash/wm/user_activity_observer.h" -#include "base/basictypes.h" -#include "base/gtest_prod_util.h" -#include "base/memory/weak_ptr.h" -#include "base/time/time.h" -#include "chromeos/dbus/power_manager_client.h" -#include "content/public/browser/notification_observer.h" -#include "content/public/browser/notification_registrar.h" - -namespace extensions { -class Extension; -} - -namespace chromeos { - -// This class controls the management of the screensaver extension. It is -// responsible for: -// . Enabling and disabling of the screensaver, along with ensuring that we -// have only one screensaver at a time. -// . Managing the showing and hiding of the current screensaver based on user -// activity. -// . Any power management that may be required while a screensaver is active. -class ScreensaverController : public ash::UserActivityObserver, - public PowerManagerClient::Observer, - public content::NotificationObserver { - public: - ScreensaverController(); - virtual ~ScreensaverController(); - - private: - FRIEND_TEST_ALL_PREFIXES(ScreensaverControllerTest, Basic); - FRIEND_TEST_ALL_PREFIXES(ScreensaverControllerTest, OutOfOrder); - - // Overridden from content::NotificationObserver: - virtual void Observe(int type, - const content::NotificationSource& source, - const content::NotificationDetails& details) OVERRIDE; - - // Overridden from PowerManagerClient::Observer: - virtual void IdleNotify(int64 threshold) OVERRIDE; - - // UserActivityObserver overrides: - virtual void OnUserActivity(const ui::Event* event) OVERRIDE; - - void SetupScreensaver(const std::string& screensaver_extension_id); - void TeardownScreensaver(); - - void RequestNextIdleNotification(); - - std::string screensaver_extension_id_; - - content::NotificationRegistrar registrar_; - - base::TimeDelta threshold_; - - base::WeakPtrFactory<ScreensaverController> weak_ptr_factory_; - - DISALLOW_COPY_AND_ASSIGN(ScreensaverController); -}; - -} // namespace chromeos - -#endif // CHROME_BROWSER_CHROMEOS_SCREENSAVER_SCREENSAVER_CONTROLLER_H_ diff --git a/chrome/browser/chromeos/screensaver/screensaver_controller_browsertest.cc b/chrome/browser/chromeos/screensaver/screensaver_controller_browsertest.cc deleted file mode 100644 index 781c9a1..0000000 --- a/chrome/browser/chromeos/screensaver/screensaver_controller_browsertest.cc +++ /dev/null @@ -1,97 +0,0 @@ -// 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. - -#include "chrome/browser/chromeos/screensaver/screensaver_controller.h" - -#include "ash/screensaver/screensaver_view.h" -#include "chrome/browser/extensions/extension_browsertest.h" -#include "chrome/browser/extensions/extension_service.h" -#include "chrome/browser/profiles/profile_manager.h" -#include "chrome/common/extensions/extension_builder.h" -#include "chrome/common/extensions/value_builder.h" -#include "chrome/test/base/in_process_browser_test.h" - -namespace { - -scoped_refptr<extensions::Extension> CreateTestScreensaverExtension() { - scoped_refptr<extensions::Extension> extension = - extensions::ExtensionBuilder() - .SetPath(base::FilePath()) - .SetManifest(extensions::DictionaryBuilder() - .Set("name", "Screensaver Extension") - .Set("version", "1") - .Set("manifest_version", 2) - .Set("app", extensions::DictionaryBuilder() - .Set("launch", extensions::DictionaryBuilder() - .Set("local_path", ""))) - .Set("permissions", extensions::ListBuilder() - .Append("screensaver"))) - .Build(); - - return extension; -} - -void InstallExtensionToDefaultProfile(const extensions::Extension* extension) { - Profile* default_profile = ProfileManager::GetDefaultProfile(); - EXPECT_TRUE(default_profile); - ExtensionService* service = - extensions::ExtensionSystem::Get(default_profile)->extension_service(); - EXPECT_TRUE(service); - - service->AddExtension(extension); -} - -} // namespace - -namespace chromeos { - -class ScreensaverControllerTest : public InProcessBrowserTest { -}; - -IN_PROC_BROWSER_TEST_F(ScreensaverControllerTest, Basic) { - scoped_refptr<extensions::Extension> extension( - CreateTestScreensaverExtension()); - InstallExtensionToDefaultProfile(extension.get()); - - scoped_ptr<ScreensaverController> controller_; - controller_.reset(new ScreensaverController()); - base::MessageLoop::current()->RunUntilIdle(); - - // Trigger idle. - controller_->IdleNotify(0); - EXPECT_TRUE(ash::IsScreensaverShown()); - - // Trigger active. - controller_->OnUserActivity(NULL); - EXPECT_FALSE(ash::IsScreensaverShown()); -}; - -IN_PROC_BROWSER_TEST_F(ScreensaverControllerTest, OutOfOrder) { - scoped_refptr<extensions::Extension> extension( - CreateTestScreensaverExtension()); - InstallExtensionToDefaultProfile(extension.get()); - - scoped_ptr<ScreensaverController> controller_; - controller_.reset(new ScreensaverController()); - base::MessageLoop::current()->RunUntilIdle(); - - // Trigger active. - controller_->OnUserActivity(NULL); - EXPECT_FALSE(ash::IsScreensaverShown()); - - // Trigger idle. - controller_->IdleNotify(0); - EXPECT_TRUE(ash::IsScreensaverShown()); - - - // Trigger idle. - controller_->IdleNotify(0); - EXPECT_TRUE(ash::IsScreensaverShown()); - - // Trigger active. - controller_->OnUserActivity(NULL); - EXPECT_FALSE(ash::IsScreensaverShown()); -}; - -} // namespace chromeos. diff --git a/chrome/chrome_browser_chromeos.gypi b/chrome/chrome_browser_chromeos.gypi index d387a0c..97d6320 100644 --- a/chrome/chrome_browser_chromeos.gypi +++ b/chrome/chrome_browser_chromeos.gypi @@ -749,8 +749,6 @@ 'browser/chromeos/proxy_config_service_impl.h', 'browser/chromeos/proxy_cros_settings_parser.cc', 'browser/chromeos/proxy_cros_settings_parser.h', - 'browser/chromeos/screensaver/screensaver_controller.cc', - 'browser/chromeos/screensaver/screensaver_controller.h', 'browser/chromeos/session_length_limiter.cc', 'browser/chromeos/session_length_limiter.h', 'browser/chromeos/settings/cros_settings.cc', diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi index 1ea07ba..86f542d 100644 --- a/chrome/chrome_tests.gypi +++ b/chrome/chrome_tests.gypi @@ -1032,7 +1032,6 @@ 'browser/chromeos/policy/variations_service_policy_browsertest.cc', 'browser/chromeos/power/peripheral_battery_observer_browsertest.cc', 'browser/chromeos/profiles/profile_helper_browsertest.cc', - 'browser/chromeos/screensaver/screensaver_controller_browsertest.cc', 'browser/chromeos/system/tray_accessibility_browsertest.cc', 'browser/chromeos/ui/idle_logout_dialog_view_browsertest.cc', 'browser/collected_cookies_browsertest.cc', diff --git a/chrome/common/extensions/permissions/chrome_api_permissions.cc b/chrome/common/extensions/permissions/chrome_api_permissions.cc index 3eed610..28790c2 100644 --- a/chrome/common/extensions/permissions/chrome_api_permissions.cc +++ b/chrome/common/extensions/permissions/chrome_api_permissions.cc @@ -79,7 +79,6 @@ std::vector<APIPermissionInfo*> ChromeAPIPermissions::GetAllPermissions() IDS_EXTENSION_PROMPT_WARNING_GEOLOCATION, PermissionMessage::kGeolocation }, { APIPermission::kNotification, "notifications" }, - { APIPermission::kScreensaver, "screensaver" }, { APIPermission::kUnlimitedStorage, "unlimitedStorage", APIPermissionInfo::kFlagCannotBeOptional }, diff --git a/chrome/common/extensions/permissions/permission_set_unittest.cc b/chrome/common/extensions/permissions/permission_set_unittest.cc index a2fa1d0..56845de 100644 --- a/chrome/common/extensions/permissions/permission_set_unittest.cc +++ b/chrome/common/extensions/permissions/permission_set_unittest.cc @@ -654,7 +654,6 @@ TEST(PermissionsTest, PermissionMessages) { skip.insert(APIPermission::kPointerLock); skip.insert(APIPermission::kPower); skip.insert(APIPermission::kPushMessaging); - skip.insert(APIPermission::kScreensaver); skip.insert(APIPermission::kSessions); skip.insert(APIPermission::kStorage); skip.insert(APIPermission::kSystemCpu); diff --git a/chromeos/chromeos_switches.cc b/chromeos/chromeos_switches.cc index f9d719d..e324073 100644 --- a/chromeos/chromeos_switches.cc +++ b/chromeos/chromeos_switches.cc @@ -92,9 +92,6 @@ const char kEnableChromeCaptivePortalDetector[] = // on Chrome OS. const char kEnableIMEModeIndicator[] = "enable-ime-mode-indicator"; -// Enables screensaver extensions. -const char kEnableScreensaverExtensions[] = "enable-screensaver-extensions"; - // Enable "interactive" mode for stub implemenations (e.g. NetworkStateHandler) const char kEnableStubInteractive[] = "enable-stub-interactive"; diff --git a/chromeos/chromeos_switches.h b/chromeos/chromeos_switches.h index fc3bacc..24fcce8 100644 --- a/chromeos/chromeos_switches.h +++ b/chromeos/chromeos_switches.h @@ -46,7 +46,6 @@ CHROMEOS_EXPORT extern const char kEnableChromeCaptivePortalDetector[]; CHROMEOS_EXPORT extern const char kEnableIMEModeIndicator[]; CHROMEOS_EXPORT extern const char kEnableKioskMode[]; CHROMEOS_EXPORT extern const char kEnableRequestTabletSite[]; -CHROMEOS_EXPORT extern const char kEnableScreensaverExtensions[]; CHROMEOS_EXPORT extern const char kEnableStubInteractive[]; CHROMEOS_EXPORT extern const char kEnableStubPortalledWifi[]; CHROMEOS_EXPORT extern const char kEnableTouchpadThreeFingerClick[]; diff --git a/chromeos/dbus/fake_power_manager_client.cc b/chromeos/dbus/fake_power_manager_client.cc index 0b0593b..3c70a6f 100644 --- a/chromeos/dbus/fake_power_manager_client.cc +++ b/chromeos/dbus/fake_power_manager_client.cc @@ -36,9 +36,6 @@ void FakePowerManagerClient::SetPolicy( void FakePowerManagerClient::RequestShutdown() { } -void FakePowerManagerClient::RequestIdleNotification(int64 threshold_secs) { -} - void FakePowerManagerClient::DecreaseScreenBrightness(bool allow_off) { } diff --git a/chromeos/dbus/fake_power_manager_client.h b/chromeos/dbus/fake_power_manager_client.h index ea4fa38..d89bb51 100644 --- a/chromeos/dbus/fake_power_manager_client.h +++ b/chromeos/dbus/fake_power_manager_client.h @@ -40,7 +40,6 @@ class FakePowerManagerClient : public PowerManagerClient { virtual void RequestStatusUpdate() OVERRIDE; virtual void RequestRestart() OVERRIDE; virtual void RequestShutdown() OVERRIDE; - virtual void RequestIdleNotification(int64 threshold_secs) OVERRIDE; virtual void NotifyUserActivity( power_manager::UserActivityType type) OVERRIDE; virtual void NotifyVideoActivity(bool is_fullscreen) OVERRIDE; diff --git a/chromeos/dbus/power_manager_client.cc b/chromeos/dbus/power_manager_client.cc index 23b4c26..82b934a 100644 --- a/chromeos/dbus/power_manager_client.cc +++ b/chromeos/dbus/power_manager_client.cc @@ -147,18 +147,6 @@ class PowerManagerClientImpl : public PowerManagerClient { SimpleMethodCallToPowerManager(power_manager::kRequestShutdownMethod); } - virtual void RequestIdleNotification(int64 threshold) OVERRIDE { - dbus::MethodCall method_call(power_manager::kPowerManagerInterface, - power_manager::kRequestIdleNotification); - dbus::MessageWriter writer(&method_call); - writer.AppendInt64(threshold); - - power_manager_proxy_->CallMethod( - &method_call, - dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, - dbus::ObjectProxy::EmptyResponseCallback()); - } - virtual void NotifyUserActivity( power_manager::UserActivityType type) OVERRIDE { dbus::MethodCall method_call( @@ -262,14 +250,6 @@ class PowerManagerClientImpl : public PowerManagerClient { power_manager_proxy_->ConnectToSignal( power_manager::kPowerManagerInterface, - power_manager::kIdleNotifySignal, - base::Bind(&PowerManagerClientImpl::IdleNotifySignalReceived, - weak_ptr_factory_.GetWeakPtr()), - base::Bind(&PowerManagerClientImpl::SignalConnected, - weak_ptr_factory_.GetWeakPtr())); - - power_manager_proxy_->ConnectToSignal( - power_manager::kPowerManagerInterface, power_manager::kInputEventSignal, base::Bind(&PowerManagerClientImpl::InputEventReceived, weak_ptr_factory_.GetWeakPtr()), @@ -448,20 +428,6 @@ class PowerManagerClientImpl : public PowerManagerClient { VLOG(1) << "Registered suspend delay " << suspend_delay_id_; } - void IdleNotifySignalReceived(dbus::Signal* signal) { - dbus::MessageReader reader(signal); - int64 threshold = 0; - if (!reader.PopInt64(&threshold)) { - LOG(ERROR) << "Idle Notify signal had incorrect parameters: " - << signal->ToString(); - return; - } - DCHECK_GT(threshold, 0); - - VLOG(1) << "Idle Notify: " << threshold; - FOR_EACH_OBSERVER(Observer, observers_, IdleNotify(threshold)); - } - void SuspendImminentReceived(dbus::Signal* signal) { if (!has_suspend_delay_id_) { LOG(ERROR) << "Received unrequested " @@ -741,14 +707,6 @@ class PowerManagerClientStubImpl : public PowerManagerClient { virtual void RequestRestart() OVERRIDE {} virtual void RequestShutdown() OVERRIDE {} - virtual void RequestIdleNotification(int64 threshold) OVERRIDE { - base::MessageLoop::current()->PostDelayedTask( - FROM_HERE, - base::Bind(&PowerManagerClientStubImpl::TriggerIdleNotify, - weak_ptr_factory_.GetWeakPtr(), threshold), - base::TimeDelta::FromMilliseconds(threshold)); - } - virtual void NotifyUserActivity( power_manager::UserActivityType type) OVERRIDE {} virtual void NotifyVideoActivity(bool is_fullscreen) OVERRIDE {} @@ -835,10 +793,6 @@ class PowerManagerClientStubImpl : public PowerManagerClient { BrightnessChanged(brightness_level, user_initiated)); } - void TriggerIdleNotify(int64 threshold) { - FOR_EACH_OBSERVER(Observer, observers_, IdleNotify(threshold)); - } - bool discharging_; int battery_percentage_; double brightness_; diff --git a/chromeos/dbus/power_manager_client.h b/chromeos/dbus/power_manager_client.h index e728f10..a24312b 100644 --- a/chromeos/dbus/power_manager_client.h +++ b/chromeos/dbus/power_manager_client.h @@ -22,8 +22,6 @@ class PowerSupplyProperties; namespace chromeos { -typedef base::Callback<void(void)> IdleNotificationCallback; - // Callback used for getting the current screen brightness. The param is in the // range [0.0, 100.0]. typedef base::Callback<void(double)> GetScreenBrightnessPercentCallback; @@ -59,9 +57,6 @@ class CHROMEOS_EXPORT PowerManagerClient : public DBusClient { virtual void PowerChanged( const power_manager::PowerSupplyProperties& proto) {} - // Called when we go idle for threshold time. - virtual void IdleNotify(int64 threshold_secs) {} - // Called when the system is about to suspend. Suspend is deferred until // all observers' implementations of this method have finished running. // @@ -127,15 +122,6 @@ class CHROMEOS_EXPORT PowerManagerClient : public DBusClient { // Requests shutdown of the system. virtual void RequestShutdown() = 0; - // Idle management functions: - - // Requests notification for Idle at a certain threshold. - // NOTE: This notification is one shot, once the machine has been idle for - // threshold time, a notification will be sent and then that request will be - // removed from the notification queue. If you wish notifications the next - // time the machine goes idle for that much time, request again. - virtual void RequestIdleNotification(int64 threshold_secs) = 0; - // Notifies the power manager that the user is active (i.e. generating input // events). virtual void NotifyUserActivity(power_manager::UserActivityType type) = 0; diff --git a/extensions/common/permissions/api_permission.h b/extensions/common/permissions/api_permission.h index 6fbe479..7e09d14 100644 --- a/extensions/common/permissions/api_permission.h +++ b/extensions/common/permissions/api_permission.h @@ -121,7 +121,6 @@ class APIPermission { kPushMessaging, kImageWriterPrivate, kRtcPrivate, - kScreensaver, kSerial, kSessions, kSignedInDevices, |