| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import "chrome/browser/ui/app_list/app_list_service_mac.h" | 5 #import "chrome/browser/ui/app_list/app_list_service_mac.h" |
| 6 | 6 |
| 7 #include <ApplicationServices/ApplicationServices.h> | 7 #include <ApplicationServices/ApplicationServices.h> |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 | 10 |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 break; | 222 break; |
| 223 case AppListPositioner::SCREEN_EDGE_UNKNOWN: | 223 case AppListPositioner::SCREEN_EDGE_UNKNOWN: |
| 224 case AppListPositioner::SCREEN_EDGE_TOP: | 224 case AppListPositioner::SCREEN_EDGE_TOP: |
| 225 NOTREACHED(); | 225 NOTREACHED(); |
| 226 break; | 226 break; |
| 227 } | 227 } |
| 228 } | 228 } |
| 229 | 229 |
| 230 void GetAppListWindowOrigins( | 230 void GetAppListWindowOrigins( |
| 231 NSWindow* window, NSPoint* target_origin, NSPoint* start_origin) { | 231 NSWindow* window, NSPoint* target_origin, NSPoint* start_origin) { |
| 232 gfx::Screen* const screen = gfx::Screen::GetScreenFor([window contentView]); | 232 gfx::Screen* const screen = gfx::Screen::GetScreen(); |
| 233 // Ensure y coordinates are flipped back into AppKit's coordinate system. | 233 // Ensure y coordinates are flipped back into AppKit's coordinate system. |
| 234 bool cursor_is_visible = CGCursorIsVisible(); | 234 bool cursor_is_visible = CGCursorIsVisible(); |
| 235 gfx::Display display; | 235 gfx::Display display; |
| 236 gfx::Point cursor; | 236 gfx::Point cursor; |
| 237 if (!cursor_is_visible) { | 237 if (!cursor_is_visible) { |
| 238 // If Chrome is the active application, display on the same display as | 238 // If Chrome is the active application, display on the same display as |
| 239 // Chrome's keyWindow since this will catch activations triggered, e.g, via | 239 // Chrome's keyWindow since this will catch activations triggered, e.g, via |
| 240 // WebStore install. If another application is active, OSX doesn't provide a | 240 // WebStore install. If another application is active, OSX doesn't provide a |
| 241 // reliable way to get the display in use. Fall back to the primary display | 241 // reliable way to get the display in use. Fall back to the primary display |
| 242 // since it has the menu bar and is likely to be correct, e.g., for | 242 // since it has the menu bar and is likely to be correct, e.g., for |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 | 581 |
| 582 - (void)animationDidEnd:(NSAnimation*)animation { | 582 - (void)animationDidEnd:(NSAnimation*)animation { |
| 583 content::BrowserThread::PostTask( | 583 content::BrowserThread::PostTask( |
| 584 content::BrowserThread::UI, | 584 content::BrowserThread::UI, |
| 585 FROM_HERE, | 585 FROM_HERE, |
| 586 base::Bind(&AppListServiceMac::WindowAnimationDidEnd, | 586 base::Bind(&AppListServiceMac::WindowAnimationDidEnd, |
| 587 base::Unretained(GetActiveInstance()))); | 587 base::Unretained(GetActiveInstance()))); |
| 588 } | 588 } |
| 589 | 589 |
| 590 @end | 590 @end |
| OLD | NEW |