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

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

Issue 14579006: Start app shim when app launched. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync and rebase Created 7 years, 6 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 #include "apps/app_shim/app_shim_handler_mac.h" 5 #include "apps/app_shim/app_shim_handler_mac.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/memory/scoped_nsobject.h" 10 #include "base/memory/scoped_nsobject.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 void ShowWindowNearDock(); 54 void ShowWindowNearDock();
55 55
56 // AppListService overrides: 56 // AppListService overrides:
57 virtual void Init(Profile* initial_profile) OVERRIDE; 57 virtual void Init(Profile* initial_profile) OVERRIDE;
58 virtual void ShowAppList(Profile* requested_profile) OVERRIDE; 58 virtual void ShowAppList(Profile* requested_profile) OVERRIDE;
59 virtual void DismissAppList() OVERRIDE; 59 virtual void DismissAppList() OVERRIDE;
60 virtual bool IsAppListVisible() const OVERRIDE; 60 virtual bool IsAppListVisible() const OVERRIDE;
61 virtual void EnableAppList() OVERRIDE; 61 virtual void EnableAppList() OVERRIDE;
62 62
63 // AppShimHandler overrides: 63 // AppShimHandler overrides:
64 virtual bool OnShimLaunch(apps::AppShimHandler::Host* host) OVERRIDE; 64 virtual bool OnShimLaunch(apps::AppShimHandler::Host* host,
65 bool launch_now) OVERRIDE;
65 virtual void OnShimClose(apps::AppShimHandler::Host* host) OVERRIDE; 66 virtual void OnShimClose(apps::AppShimHandler::Host* host) OVERRIDE;
66 virtual void OnShimFocus(apps::AppShimHandler::Host* host) OVERRIDE; 67 virtual void OnShimFocus(apps::AppShimHandler::Host* host) OVERRIDE;
67 68
68 private: 69 private:
69 friend struct DefaultSingletonTraits<AppListServiceMac>; 70 friend struct DefaultSingletonTraits<AppListServiceMac>;
70 71
71 AppListServiceMac() {} 72 AppListServiceMac() {}
72 73
73 scoped_nsobject<AppListWindowController> window_controller_; 74 scoped_nsobject<AppListWindowController> window_controller_;
74 75
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 } 265 }
265 266
266 void AppListServiceMac::EnableAppList() { 267 void AppListServiceMac::EnableAppList() {
267 // TODO(tapted): Implement enable logic here for OSX. 268 // TODO(tapted): Implement enable logic here for OSX.
268 } 269 }
269 270
270 NSWindow* AppListServiceMac::GetNativeWindow() { 271 NSWindow* AppListServiceMac::GetNativeWindow() {
271 return [window_controller_ window]; 272 return [window_controller_ window];
272 } 273 }
273 274
274 bool AppListServiceMac::OnShimLaunch(apps::AppShimHandler::Host* host) { 275 bool AppListServiceMac::OnShimLaunch(apps::AppShimHandler::Host* host,
276 bool launch_now) {
tapted 2013/05/29 04:20:30 I've noticed the app list will need some logic add
275 ShowForSavedProfile(); 277 ShowForSavedProfile();
276 observers_.AddObserver(host); 278 observers_.AddObserver(host);
277 return true; 279 return true;
278 } 280 }
279 281
280 void AppListServiceMac::OnShimClose(apps::AppShimHandler::Host* host) { 282 void AppListServiceMac::OnShimClose(apps::AppShimHandler::Host* host) {
281 observers_.RemoveObserver(host); 283 observers_.RemoveObserver(host);
282 DismissAppList(); 284 DismissAppList();
283 } 285 }
284 286
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 367
366 // static 368 // static
367 AppListService* AppListService::Get() { 369 AppListService* AppListService::Get() {
368 return AppListServiceMac::GetInstance(); 370 return AppListServiceMac::GetInstance();
369 } 371 }
370 372
371 // static 373 // static
372 void AppListService::InitAll(Profile* initial_profile) { 374 void AppListService::InitAll(Profile* initial_profile) {
373 Get()->Init(initial_profile); 375 Get()->Init(initial_profile);
374 } 376 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698