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

Unified Diff: ui/app_list/cocoa/app_list_window_controller.mm

Issue 12701022: wrongbaseurl OSX App List Pager and root view controller. (Closed) Base URL: http://git.chromium.org/chromium/src.git@20130304-crbug-138633-osx-app-list-demo-polish-macbook
Patch Set: delegate should be owned by viewcontroller, test coverage Created 7 years, 9 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: ui/app_list/cocoa/app_list_window_controller.mm
diff --git a/ui/app_list/cocoa/app_list_window_controller.mm b/ui/app_list/cocoa/app_list_window_controller.mm
index 44f7f59f901101c451fbd04e97de2e9154b6f2cb..60c2d24465d495883c1c1837add92733cd3f19c8 100644
--- a/ui/app_list/cocoa/app_list_window_controller.mm
+++ b/ui/app_list/cocoa/app_list_window_controller.mm
@@ -5,7 +5,9 @@
#import "ui/app_list/cocoa/app_list_window_controller.h"
#include "ui/app_list/app_list_view_delegate.h"
+#import "ui/app_list/cocoa/app_list_view_controller.h"
#import "ui/app_list/cocoa/apps_grid_controller.h"
+#include "ui/base/cocoa/window_size_constants.h"
@interface AppListWindow : NSWindow;
@end
@@ -22,38 +24,43 @@
@implementation AppListWindowController;
-- (id)initWithGridController:(AppsGridController*)gridController {
+- (id)init {
scoped_nsobject<NSWindow> controlledWindow(
- [[AppListWindow alloc] initWithContentRect:[[gridController view] bounds]
+ [[AppListWindow alloc] initWithContentRect:ui::kWindowSizeDeterminedLater
styleMask:NSBorderlessWindowMask
backing:NSBackingStoreBuffered
defer:NO]);
- [controlledWindow setContentView:[gridController view]];
[controlledWindow setReleasedWhenClosed:NO];
[controlledWindow setBackgroundColor:[NSColor clearColor]];
[controlledWindow setOpaque:NO];
[controlledWindow setHasShadow:NO];
+ [controlledWindow
+ setCollectionBehavior:NSWindowCollectionBehaviorCanJoinAllSpaces];
if ((self = [super initWithWindow:controlledWindow])) {
- appsGridController_.reset([gridController retain]);
+ appListViewController_.reset([[AppListViewController alloc] init]);
+ [[self window] setFrame:[[appListViewController_ view] bounds]
+ display:NO];
+ [[self window] setContentView:[appListViewController_ view]];
[[self window] setDelegate:self];
- [[self window] makeFirstResponder:[appsGridController_
- collectionViewAtPageIndex:0]];
+ [[self window] makeFirstResponder:
+ [[appListViewController_ appsGridController]
+ collectionViewAtPageIndex:0]];
}
return self;
}
-- (AppsGridController*)appsGridController {
- return appsGridController_;
+- (AppListViewController*)appListViewController {
+ return appListViewController_;
}
- (void)doCommandBySelector:(SEL)command {
if (command == @selector(cancel:)) {
- if ([appsGridController_ delegate])
- [appsGridController_ delegate]->Dismiss();
+ if ([appListViewController_ delegate])
+ [appListViewController_ delegate]->Dismiss();
} else if (command == @selector(insertNewline:) ||
command == @selector(insertLineBreak:)) {
- [appsGridController_ activateSelection];
+ [[appListViewController_ appsGridController] activateSelection];
}
}
« no previous file with comments | « ui/app_list/cocoa/app_list_window_controller.h ('k') | ui/app_list/cocoa/app_list_window_controller_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698