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

Side by Side Diff: chrome/browser/ui/app_list/app_list_service_mac.mm

Issue 492163002: Fix Profile* lifetime issues in Chrome's AppListViewDelegate (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add constructor comment Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 AppListServiceImpl::EnableAppList(initial_profile, enable_source); 445 AppListServiceImpl::EnableAppList(initial_profile, enable_source);
446 AppController* controller = [NSApp delegate]; 446 AppController* controller = [NSApp delegate];
447 [controller initAppShimMenuController]; 447 [controller initAppShimMenuController];
448 } 448 }
449 449
450 void AppListServiceMac::CreateShortcut() { 450 void AppListServiceMac::CreateShortcut() {
451 CreateAppListShim(GetProfilePath( 451 CreateAppListShim(GetProfilePath(
452 g_browser_process->profile_manager()->user_data_dir())); 452 g_browser_process->profile_manager()->user_data_dir()));
453 } 453 }
454 454
455 void AppListServiceMac::DestroyAppList() {
456 // Due to reference counting, Mac can't guarantee that the widget is deleted,
457 // but mac supports a visible app list with a NULL profile, so there's also no
458 // need to tear it down completely.
459 DismissAppList();
460 [[window_controller_ appListViewController]
461 setDelegate:scoped_ptr<app_list::AppListViewDelegate>()];
462
463 profile_ = NULL;
464 }
465
455 NSWindow* AppListServiceMac::GetAppListWindow() { 466 NSWindow* AppListServiceMac::GetAppListWindow() {
456 return [window_controller_ window]; 467 return [window_controller_ window];
457 } 468 }
458 469
459 AppListControllerDelegate* AppListServiceMac::GetControllerDelegate() { 470 AppListControllerDelegate* AppListServiceMac::GetControllerDelegate() {
460 return controller_delegate_.get(); 471 return controller_delegate_.get();
461 } 472 }
462 473
463 void AppListServiceMac::OnShimLaunch(apps::AppShimHandler::Host* host, 474 void AppListServiceMac::OnShimLaunch(apps::AppShimHandler::Host* host,
464 apps::AppShimLaunchType launch_type, 475 apps::AppShimLaunchType launch_type,
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 604
594 - (void)animationDidEnd:(NSAnimation*)animation { 605 - (void)animationDidEnd:(NSAnimation*)animation {
595 content::BrowserThread::PostTask( 606 content::BrowserThread::PostTask(
596 content::BrowserThread::UI, 607 content::BrowserThread::UI,
597 FROM_HERE, 608 FROM_HERE,
598 base::Bind(&AppListServiceMac::WindowAnimationDidEnd, 609 base::Bind(&AppListServiceMac::WindowAnimationDidEnd,
599 base::Unretained(AppListServiceMac::GetInstance()))); 610 base::Unretained(AppListServiceMac::GetInstance())));
600 } 611 }
601 612
602 @end 613 @end
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/app_list_service_mac.h ('k') | chrome/browser/ui/app_list/app_list_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698