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

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: implemented for mac 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 64
65 // AppListService overrides: 65 // AppListService overrides:
66 virtual void Init(Profile* initial_profile) OVERRIDE; 66 virtual void Init(Profile* initial_profile) OVERRIDE;
67 virtual void ShowForProfile(Profile* requested_profile) OVERRIDE; 67 virtual void ShowForProfile(Profile* requested_profile) OVERRIDE;
68 virtual void DismissAppList() OVERRIDE; 68 virtual void DismissAppList() OVERRIDE;
69 virtual bool IsAppListVisible() const OVERRIDE; 69 virtual bool IsAppListVisible() const OVERRIDE;
70 virtual gfx::NativeWindow GetAppListWindow() OVERRIDE; 70 virtual gfx::NativeWindow GetAppListWindow() OVERRIDE;
71 71
72 // AppListServiceImpl overrides: 72 // AppListServiceImpl overrides:
73 virtual void CreateShortcut() OVERRIDE; 73 virtual void CreateShortcut() OVERRIDE;
74 virtual void OnSigninStatusChanged() OVERRIDE;
75 74
76 // AppShimHandler overrides: 75 // AppShimHandler overrides:
77 virtual void OnShimLaunch(apps::AppShimHandler::Host* host, 76 virtual void OnShimLaunch(apps::AppShimHandler::Host* host,
78 apps::AppShimLaunchType launch_type) OVERRIDE; 77 apps::AppShimLaunchType launch_type) OVERRIDE;
79 virtual void OnShimClose(apps::AppShimHandler::Host* host) OVERRIDE; 78 virtual void OnShimClose(apps::AppShimHandler::Host* host) OVERRIDE;
80 virtual void OnShimFocus(apps::AppShimHandler::Host* host, 79 virtual void OnShimFocus(apps::AppShimHandler::Host* host,
81 apps::AppShimFocusType focus_type) OVERRIDE; 80 apps::AppShimFocusType focus_type) OVERRIDE;
82 virtual void OnShimSetHidden(apps::AppShimHandler::Host* host, 81 virtual void OnShimSetHidden(apps::AppShimHandler::Host* host,
83 bool hidden) OVERRIDE; 82 bool hidden) OVERRIDE;
84 virtual void OnShimQuit(apps::AppShimHandler::Host* host) OVERRIDE; 83 virtual void OnShimQuit(apps::AppShimHandler::Host* host) OVERRIDE;
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 358
360 void AppListServiceMac::CreateShortcut() { 359 void AppListServiceMac::CreateShortcut() {
361 CreateAppListShim(GetProfilePath( 360 CreateAppListShim(GetProfilePath(
362 g_browser_process->profile_manager()->user_data_dir())); 361 g_browser_process->profile_manager()->user_data_dir()));
363 } 362 }
364 363
365 NSWindow* AppListServiceMac::GetAppListWindow() { 364 NSWindow* AppListServiceMac::GetAppListWindow() {
366 return [window_controller_ window]; 365 return [window_controller_ window];
367 } 366 }
368 367
369 void AppListServiceMac::OnSigninStatusChanged() {
370 [[window_controller_ appListViewController] onSigninStatusChanged];
371 }
372
373 void AppListServiceMac::OnShimLaunch(apps::AppShimHandler::Host* host, 368 void AppListServiceMac::OnShimLaunch(apps::AppShimHandler::Host* host,
374 apps::AppShimLaunchType launch_type) { 369 apps::AppShimLaunchType launch_type) {
375 Show(); 370 Show();
376 observers_.AddObserver(host); 371 observers_.AddObserver(host);
377 host->OnAppLaunchComplete(apps::APP_SHIM_LAUNCH_SUCCESS); 372 host->OnAppLaunchComplete(apps::APP_SHIM_LAUNCH_SUCCESS);
378 } 373 }
379 374
380 void AppListServiceMac::OnShimClose(apps::AppShimHandler::Host* host) { 375 void AppListServiceMac::OnShimClose(apps::AppShimHandler::Host* host) {
381 observers_.RemoveObserver(host); 376 observers_.RemoveObserver(host);
382 DismissAppList(); 377 DismissAppList();
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 503
509 // static 504 // static
510 AppListService* AppListService::Get() { 505 AppListService* AppListService::Get() {
511 return AppListServiceMac::GetInstance(); 506 return AppListServiceMac::GetInstance();
512 } 507 }
513 508
514 // static 509 // static
515 void AppListService::InitAll(Profile* initial_profile) { 510 void AppListService::InitAll(Profile* initial_profile) {
516 Get()->Init(initial_profile); 511 Get()->Init(initial_profile);
517 } 512 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698