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

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

Issue 22268009: Move signin status and current user information into AppListModel. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 7 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
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 #include <ApplicationServices/ApplicationServices.h> 5 #include <ApplicationServices/ApplicationServices.h>
6 #import <Cocoa/Cocoa.h> 6 #import <Cocoa/Cocoa.h>
7 7
8 #include "apps/app_launcher.h" 8 #include "apps/app_launcher.h"
9 #include "apps/app_shim/app_shim_handler_mac.h" 9 #include "apps/app_shim/app_shim_handler_mac.h"
10 #include "apps/app_shim/app_shim_mac.h" 10 #include "apps/app_shim/app_shim_mac.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 // AppListService overrides: 69 // AppListService overrides:
70 virtual void Init(Profile* initial_profile) OVERRIDE; 70 virtual void Init(Profile* initial_profile) OVERRIDE;
71 virtual void CreateForProfile(Profile* requested_profile) OVERRIDE; 71 virtual void CreateForProfile(Profile* requested_profile) OVERRIDE;
72 virtual void ShowForProfile(Profile* requested_profile) OVERRIDE; 72 virtual void ShowForProfile(Profile* requested_profile) OVERRIDE;
73 virtual void DismissAppList() OVERRIDE; 73 virtual void DismissAppList() OVERRIDE;
74 virtual bool IsAppListVisible() const OVERRIDE; 74 virtual bool IsAppListVisible() const OVERRIDE;
75 virtual gfx::NativeWindow GetAppListWindow() OVERRIDE; 75 virtual gfx::NativeWindow GetAppListWindow() OVERRIDE;
76 76
77 // AppListServiceImpl overrides: 77 // AppListServiceImpl overrides:
78 virtual void CreateShortcut() OVERRIDE; 78 virtual void CreateShortcut() OVERRIDE;
79 virtual void OnSigninStatusChanged() OVERRIDE;
80 79
81 // AppShimHandler overrides: 80 // AppShimHandler overrides:
82 virtual void OnShimLaunch(apps::AppShimHandler::Host* host, 81 virtual void OnShimLaunch(apps::AppShimHandler::Host* host,
83 apps::AppShimLaunchType launch_type) OVERRIDE; 82 apps::AppShimLaunchType launch_type) OVERRIDE;
84 virtual void OnShimClose(apps::AppShimHandler::Host* host) OVERRIDE; 83 virtual void OnShimClose(apps::AppShimHandler::Host* host) OVERRIDE;
85 virtual void OnShimFocus(apps::AppShimHandler::Host* host, 84 virtual void OnShimFocus(apps::AppShimHandler::Host* host,
86 apps::AppShimFocusType focus_type) OVERRIDE; 85 apps::AppShimFocusType focus_type) OVERRIDE;
87 virtual void OnShimSetHidden(apps::AppShimHandler::Host* host, 86 virtual void OnShimSetHidden(apps::AppShimHandler::Host* host,
88 bool hidden) OVERRIDE; 87 bool hidden) OVERRIDE;
89 virtual void OnShimQuit(apps::AppShimHandler::Host* host) OVERRIDE; 88 virtual void OnShimQuit(apps::AppShimHandler::Host* host) OVERRIDE;
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 397
399 void AppListServiceMac::CreateShortcut() { 398 void AppListServiceMac::CreateShortcut() {
400 CreateAppListShim(GetProfilePath( 399 CreateAppListShim(GetProfilePath(
401 g_browser_process->profile_manager()->user_data_dir())); 400 g_browser_process->profile_manager()->user_data_dir()));
402 } 401 }
403 402
404 NSWindow* AppListServiceMac::GetAppListWindow() { 403 NSWindow* AppListServiceMac::GetAppListWindow() {
405 return [window_controller_ window]; 404 return [window_controller_ window];
406 } 405 }
407 406
408 void AppListServiceMac::OnSigninStatusChanged() {
409 [[window_controller_ appListViewController] onSigninStatusChanged];
410 }
411
412 void AppListServiceMac::OnShimLaunch(apps::AppShimHandler::Host* host, 407 void AppListServiceMac::OnShimLaunch(apps::AppShimHandler::Host* host,
413 apps::AppShimLaunchType launch_type) { 408 apps::AppShimLaunchType launch_type) {
414 Show(); 409 Show();
415 observers_.AddObserver(host); 410 observers_.AddObserver(host);
416 host->OnAppLaunchComplete(apps::APP_SHIM_LAUNCH_SUCCESS); 411 host->OnAppLaunchComplete(apps::APP_SHIM_LAUNCH_SUCCESS);
417 } 412 }
418 413
419 void AppListServiceMac::OnShimClose(apps::AppShimHandler::Host* host) { 414 void AppListServiceMac::OnShimClose(apps::AppShimHandler::Host* host) {
420 observers_.RemoveObserver(host); 415 observers_.RemoveObserver(host);
421 DismissAppList(); 416 DismissAppList();
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 542
548 // static 543 // static
549 AppListService* AppListService::Get() { 544 AppListService* AppListService::Get() {
550 return AppListServiceMac::GetInstance(); 545 return AppListServiceMac::GetInstance();
551 } 546 }
552 547
553 // static 548 // static
554 void AppListService::InitAll(Profile* initial_profile) { 549 void AppListService::InitAll(Profile* initial_profile) {
555 Get()->Init(initial_profile); 550 Get()->Init(initial_profile);
556 } 551 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/app_list_service_impl.cc ('k') | chrome/browser/ui/app_list/app_list_view_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698