X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fchrome%2Fbrowser%2Fui%2Fapp_list%2Fapp_list_service_mac.mm;h=762a571ac060f0133c12e8c5425b1c560a9be0b0;hb=3545e9f2671f595d2a2f3ee75ca0393b01e35ef6;hp=8e448e8cde0a1c4c728ce16299c30b7bcee3fd59;hpb=7d210d4c7e9ba36e635eabc5b5780495f8a63292;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/chrome/browser/ui/app_list/app_list_service_mac.mm b/src/chrome/browser/ui/app_list/app_list_service_mac.mm index 8e448e8..762a571 100644 --- a/src/chrome/browser/ui/app_list/app_list_service_mac.mm +++ b/src/chrome/browser/ui/app_list/app_list_service_mac.mm @@ -9,7 +9,7 @@ #include "base/bind.h" #include "base/command_line.h" -#include "base/file_util.h" +#include "base/files/file_util.h" #include "base/lazy_instance.h" #include "base/mac/mac_util.h" #include "base/memory/singleton.h" @@ -34,11 +34,11 @@ #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" #include "chrome/common/mac/app_mode_common.h" #include "chrome/common/pref_names.h" +#include "chrome/grit/google_chrome_strings.h" #include "content/public/browser/browser_thread.h" #include "extensions/browser/extension_system.h" #include "extensions/common/manifest_handlers/file_handler_info.h" #include "grit/chrome_unscaled_resources.h" -#include "grit/google_chrome_strings.h" #include "net/base/url_util.h" #import "ui/app_list/cocoa/app_list_view_controller.h" #import "ui/app_list/cocoa/app_list_window_controller.h" @@ -392,9 +392,9 @@ void AppListServiceMac::CreateForProfile(Profile* requested_profile) { if (!window_controller_) window_controller_.reset([[AppListWindowController alloc] init]); - scoped_ptr delegate( - new AppListViewDelegate(profile_, GetControllerDelegate())); - [[window_controller_ appListViewController] setDelegate:delegate.Pass()]; + [[window_controller_ appListViewController] setDelegate:nil]; + [[window_controller_ appListViewController] + setDelegate:GetViewDelegate(profile_)]; } void AppListServiceMac::ShowForProfile(Profile* requested_profile) { @@ -452,6 +452,16 @@ void AppListServiceMac::CreateShortcut() { g_browser_process->profile_manager()->user_data_dir())); } +void AppListServiceMac::DestroyAppList() { + // Due to reference counting, Mac can't guarantee that the widget is deleted, + // but mac supports a visible app list with a NULL profile, so there's also no + // need to tear it down completely. + DismissAppList(); + [[window_controller_ appListViewController] setDelegate:NULL]; + + profile_ = NULL; +} + NSWindow* AppListServiceMac::GetAppListWindow() { return [window_controller_ window]; }