OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/ui/views/ash/launcher/chrome_launcher_controller.h" | 5 #include "chrome/browser/ui/views/ash/launcher/chrome_launcher_controller.h" |
6 | 6 |
7 #include "ash/launcher/launcher_model.h" | 7 #include "ash/launcher/launcher_model.h" |
8 #include "ash/launcher/launcher_types.h" | 8 #include "ash/launcher/launcher_types.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/wm/window_util.h" | 10 #include "ash/wm/window_util.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 #include "chrome/common/extensions/extension.h" | 32 #include "chrome/common/extensions/extension.h" |
33 #include "chrome/common/extensions/extension_resource.h" | 33 #include "chrome/common/extensions/extension_resource.h" |
34 #include "chrome/common/pref_names.h" | 34 #include "chrome/common/pref_names.h" |
35 #include "content/public/browser/notification_service.h" | 35 #include "content/public/browser/notification_service.h" |
36 #include "content/public/browser/web_contents.h" | 36 #include "content/public/browser/web_contents.h" |
37 #include "grit/theme_resources.h" | 37 #include "grit/theme_resources.h" |
38 #include "ui/aura/client/activation_client.h" | 38 #include "ui/aura/client/activation_client.h" |
39 #include "ui/aura/window.h" | 39 #include "ui/aura/window.h" |
40 #include "ui/views/widget/widget.h" | 40 #include "ui/views/widget/widget.h" |
41 | 41 |
| 42 using extensions::Extension; |
| 43 |
42 namespace { | 44 namespace { |
43 | 45 |
44 // Values used for prefs::kShelfAutoHideBehavior. | 46 // Values used for prefs::kShelfAutoHideBehavior. |
45 const char kShelfAutoHideBehaviorAlways[] = "Always"; | 47 const char kShelfAutoHideBehaviorAlways[] = "Always"; |
46 const char kShelfAutoHideBehaviorDefault[] = "Default"; | 48 const char kShelfAutoHideBehaviorDefault[] = "Default"; |
47 const char kShelfAutoHideBehaviorNever[] = "Never"; | 49 const char kShelfAutoHideBehaviorNever[] = "Never"; |
48 | 50 |
49 // App ID of default pinned apps. | 51 // App ID of default pinned apps. |
50 const char* kDefaultPinnedApps[] = { | 52 const char* kDefaultPinnedApps[] = { |
51 "pjkljhegncpnkpknbcohdijeoejaedia", // Gmail | 53 "pjkljhegncpnkpknbcohdijeoejaedia", // Gmail |
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 int type, | 529 int type, |
528 const content::NotificationSource& source, | 530 const content::NotificationSource& source, |
529 const content::NotificationDetails& details) { | 531 const content::NotificationDetails& details) { |
530 switch (type) { | 532 switch (type) { |
531 case chrome::NOTIFICATION_EXTENSION_LOADED: { | 533 case chrome::NOTIFICATION_EXTENSION_LOADED: { |
532 ProcessPendingPinnedApps(); | 534 ProcessPendingPinnedApps(); |
533 break; | 535 break; |
534 } | 536 } |
535 case chrome::NOTIFICATION_EXTENSION_UNLOADED: { | 537 case chrome::NOTIFICATION_EXTENSION_UNLOADED: { |
536 const Extension* extension = | 538 const Extension* extension = |
537 content::Details<UnloadedExtensionInfo>(details)->extension; | 539 content::Details<extensions::UnloadedExtensionInfo>( |
| 540 details)->extension; |
538 if (IsAppPinned(extension->id())) { | 541 if (IsAppPinned(extension->id())) { |
539 // TODO(dpolukhin): also we need to remember index of the app to show | 542 // TODO(dpolukhin): also we need to remember index of the app to show |
540 // it on the same place when it gets loaded again. | 543 // it on the same place when it gets loaded again. |
541 Item pending_item; | 544 Item pending_item; |
542 pending_item.item_type = TYPE_APP; | 545 pending_item.item_type = TYPE_APP; |
543 pending_item.app_id = extension->id(); | 546 pending_item.app_id = extension->id(); |
544 pending_pinned_apps_.push_back(pending_item); | 547 pending_pinned_apps_.push_back(pending_item); |
545 DoUnpinAppsWithID(extension->id()); | 548 DoUnpinAppsWithID(extension->id()); |
546 } | 549 } |
547 break; | 550 break; |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
670 } else { | 673 } else { |
671 Item pending_item; | 674 Item pending_item; |
672 pending_item.item_type = TYPE_APP; | 675 pending_item.item_type = TYPE_APP; |
673 pending_item.app_id = app_id; | 676 pending_item.app_id = app_id; |
674 pending_pinned_apps_.push_back(pending_item); | 677 pending_pinned_apps_.push_back(pending_item); |
675 } | 678 } |
676 } | 679 } |
677 } | 680 } |
678 } | 681 } |
679 } | 682 } |
OLD | NEW |