Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(181)

Unified Diff: chrome/browser/chrome_browser_application_mac.mm

Issue 1575743003: Mac: Remove a case where panels may become key when an autofill popup closes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove poopie code from chrome_browser_application_mac.mm Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chrome_browser_application_mac.mm
diff --git a/chrome/browser/chrome_browser_application_mac.mm b/chrome/browser/chrome_browser_application_mac.mm
index a7bbcf6a93c5675cf8d97bf782c2def53f28833d..16e8b286e4855d1a337e5527d6f84c1614ca0f85 100644
--- a/chrome/browser/chrome_browser_application_mac.mm
+++ b/chrome/browser/chrome_browser_application_mac.mm
@@ -131,19 +131,10 @@ void CancelTerminate() {
} // namespace chrome_browser_application_mac
-// These methods are being exposed for the purposes of overriding.
+// Method exposed for the purposes of overriding.
// Used to determine when a Panel window can become the key window.
@interface NSApplication (PanelsCanBecomeKey)
- (void)_cycleWindowsReversed:(BOOL)arg1;
-- (id)_removeWindow:(NSWindow*)window;
-- (id)_setKeyWindow:(NSWindow*)window;
-@end
-
-@interface BrowserCrApplication (PrivateInternal)
-
-// This must be called under the protection of previousKeyWindowsLock_.
-- (void)removePreviousKeyWindow:(NSWindow*)window;
-
@end
@implementation BrowserCrApplication
@@ -377,45 +368,4 @@ void CancelTerminate() {
return cyclingWindows_;
}
-- (id)_removeWindow:(NSWindow*)window {
- // Note _removeWindow is called from -[NSWindow dealloc], which can happen at
- // unpredictable times due to reference counting. Just update state.
- {
- base::AutoLock lock(previousKeyWindowsLock_);
- [self removePreviousKeyWindow:window];
- }
- return [super _removeWindow:window];
-}
-
-- (id)_setKeyWindow:(NSWindow*)window {
- // |window| is nil when the current key window is being closed.
- // A separate call follows with a new value when a new key window is set.
- // Closed windows are not tracked in previousKeyWindows_.
- if (window != nil) {
- base::AutoLock lock(previousKeyWindowsLock_);
- [self removePreviousKeyWindow:window];
- NSWindow* currentKeyWindow = [self keyWindow];
- if (currentKeyWindow != nil && currentKeyWindow != window)
- previousKeyWindows_.push_back(currentKeyWindow);
- }
-
- return [super _setKeyWindow:window];
-}
-
-- (NSWindow*)previousKeyWindow {
- base::AutoLock lock(previousKeyWindowsLock_);
- return previousKeyWindows_.empty() ? nil : previousKeyWindows_.back();
-}
-
-- (void)removePreviousKeyWindow:(NSWindow*)window {
- previousKeyWindowsLock_.AssertAcquired();
- std::vector<NSWindow*>::iterator window_iterator =
- std::find(previousKeyWindows_.begin(),
- previousKeyWindows_.end(),
- window);
- if (window_iterator != previousKeyWindows_.end()) {
- previousKeyWindows_.erase(window_iterator);
- }
-}
-
@end
« no previous file with comments | « chrome/browser/chrome_browser_application_mac.h ('k') | chrome/browser/ui/cocoa/panels/panel_window_controller_cocoa.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698