Commit 8bb35150 authored by Robert Sesek's avatar Robert Sesek Committed by Commit Bot

Remove ui::WorkAreaWatcherObserver from AppController.

This was originally added in 33190c88
for the panels feature, which was then later removed in
566d3644. Currently nothing adds an
observer for this notification.

Bug: 571511
Change-Id: I1ecbcacffd1451d70912895c106858eb616e6a80
Reviewed-on: https://chromium-review.googlesource.com/743857Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#512546}
parent ede16f41
...@@ -14,10 +14,8 @@ ...@@ -14,10 +14,8 @@
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/mac/scoped_nsobject.h" #include "base/mac/scoped_nsobject.h"
#include "base/observer_list.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "components/prefs/pref_change_registrar.h" #include "components/prefs/pref_change_registrar.h"
#include "ui/base/work_area_watcher_observer.h"
class AppControllerProfileObserver; class AppControllerProfileObserver;
@class AppShimMenuController; @class AppShimMenuController;
...@@ -33,10 +31,6 @@ class QuitWithAppsController; ...@@ -33,10 +31,6 @@ class QuitWithAppsController;
class ScopedKeepAlive; class ScopedKeepAlive;
@class ShareMenuController; @class ShareMenuController;
namespace ui {
class WorkAreaWatcherObserver;
}
// The application controller object, created by loading the MainMenu nib. // The application controller object, created by loading the MainMenu nib.
// This handles things like responding to menus when there are no windows // This handles things like responding to menus when there are no windows
// open, etc and acts as the NSApplication delegate. // open, etc and acts as the NSApplication delegate.
...@@ -97,9 +91,6 @@ class WorkAreaWatcherObserver; ...@@ -97,9 +91,6 @@ class WorkAreaWatcherObserver;
// event, the time we got the event. A null time otherwise. // event, the time we got the event. A null time otherwise.
base::TimeTicks reopenTime_; base::TimeTicks reopenTime_;
// Observers that listen to the work area changes.
base::ObserverList<ui::WorkAreaWatcherObserver> workAreaChangeObservers_;
std::unique_ptr<PrefChangeRegistrar> profilePrefRegistrar_; std::unique_ptr<PrefChangeRegistrar> profilePrefRegistrar_;
PrefChangeRegistrar localPrefRegistrar_; PrefChangeRegistrar localPrefRegistrar_;
...@@ -168,10 +159,6 @@ class WorkAreaWatcherObserver; ...@@ -168,10 +159,6 @@ class WorkAreaWatcherObserver;
- (BookmarkMenuBridge*)bookmarkMenuBridge; - (BookmarkMenuBridge*)bookmarkMenuBridge;
- (HistoryMenuBridge*)historyMenuBridge; - (HistoryMenuBridge*)historyMenuBridge;
// Subscribes/unsubscribes from the work area change notification.
- (void)addObserverForWorkAreaChange:(ui::WorkAreaWatcherObserver*)observer;
- (void)removeObserverForWorkAreaChange:(ui::WorkAreaWatcherObserver*)observer;
// Initializes the AppShimMenuController. This enables changing the menu bar for // Initializes the AppShimMenuController. This enables changing the menu bar for
// apps. // apps.
- (void)initAppShimMenuController; - (void)initAppShimMenuController;
......
...@@ -1535,14 +1535,6 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; ...@@ -1535,14 +1535,6 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session;
return historyMenuBridge_.get(); return historyMenuBridge_.get();
} }
- (void)addObserverForWorkAreaChange:(ui::WorkAreaWatcherObserver*)observer {
workAreaChangeObservers_.AddObserver(observer);
}
- (void)removeObserverForWorkAreaChange:(ui::WorkAreaWatcherObserver*)observer {
workAreaChangeObservers_.RemoveObserver(observer);
}
- (void)initAppShimMenuController { - (void)initAppShimMenuController {
if (!appShimMenuController_) if (!appShimMenuController_)
appShimMenuController_.reset([[AppShimMenuController alloc] init]); appShimMenuController_.reset([[AppShimMenuController alloc] init]);
...@@ -1599,18 +1591,6 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; ...@@ -1599,18 +1591,6 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session;
lastProfile_)); lastProfile_));
} }
- (void)applicationDidChangeScreenParameters:(NSNotification*)notification {
// During this callback the working area is not always already updated. Defer.
[self performSelector:@selector(delayedScreenParametersUpdate)
withObject:nil
afterDelay:0];
}
- (void)delayedScreenParametersUpdate {
for (auto& observer : workAreaChangeObservers_)
observer.WorkAreaChanged();
}
- (BOOL)application:(NSApplication*)application - (BOOL)application:(NSApplication*)application
willContinueUserActivityWithType:(NSString*)userActivityType willContinueUserActivityWithType:(NSString*)userActivityType
API_AVAILABLE(macos(10.10)) { API_AVAILABLE(macos(10.10)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment