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 "extensions/browser/api/management/management_api.h" | 5 #include "extensions/browser/api/management/management_api.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
74 const Extension& extension, | 74 const Extension& extension, |
75 const ManagementAPIDelegate* delegate) { | 75 const ManagementAPIDelegate* delegate) { |
76 std::vector<management::LaunchType> launch_type_list; | 76 std::vector<management::LaunchType> launch_type_list; |
77 if (extension.is_platform_app()) { | 77 if (extension.is_platform_app()) { |
78 launch_type_list.push_back(management::LAUNCH_TYPE_OPEN_AS_WINDOW); | 78 launch_type_list.push_back(management::LAUNCH_TYPE_OPEN_AS_WINDOW); |
79 return launch_type_list; | 79 return launch_type_list; |
80 } | 80 } |
81 | 81 |
82 launch_type_list.push_back(management::LAUNCH_TYPE_OPEN_AS_REGULAR_TAB); | 82 launch_type_list.push_back(management::LAUNCH_TYPE_OPEN_AS_REGULAR_TAB); |
83 | 83 |
84 #if !defined(OS_MACOSX) | 84 // TODO(dominickn) remove check when hosted apps can open in windows on Mac. |
tapted
2015/08/19 06:48:13
nit: colon after TODO(..):
dominickn
2015/08/19 07:10:41
Done.
| |
85 // Open as window is currently disabled on Mac. | 85 if (delegate->CanHostedAppsOpenInWindows()) |
86 launch_type_list.push_back(management::LAUNCH_TYPE_OPEN_AS_WINDOW); | 86 launch_type_list.push_back(management::LAUNCH_TYPE_OPEN_AS_WINDOW); |
87 | 87 |
88 if (!delegate->IsNewBookmarkAppsEnabled()) { | 88 if (!delegate->IsNewBookmarkAppsEnabled()) { |
89 launch_type_list.push_back(management::LAUNCH_TYPE_OPEN_AS_PINNED_TAB); | 89 launch_type_list.push_back(management::LAUNCH_TYPE_OPEN_AS_PINNED_TAB); |
90 launch_type_list.push_back(management::LAUNCH_TYPE_OPEN_FULL_SCREEN); | 90 launch_type_list.push_back(management::LAUNCH_TYPE_OPEN_FULL_SCREEN); |
91 } | 91 } |
92 #endif | |
93 return launch_type_list; | 92 return launch_type_list; |
94 } | 93 } |
95 | 94 |
96 scoped_ptr<management::ExtensionInfo> CreateExtensionInfo( | 95 scoped_ptr<management::ExtensionInfo> CreateExtensionInfo( |
97 const Extension& extension, | 96 const Extension& extension, |
98 content::BrowserContext* context) { | 97 content::BrowserContext* context) { |
99 ExtensionSystem* system = ExtensionSystem::Get(context); | 98 ExtensionSystem* system = ExtensionSystem::Get(context); |
100 ExtensionRegistry* registry = ExtensionRegistry::Get(context); | 99 ExtensionRegistry* registry = ExtensionRegistry::Get(context); |
101 const ManagementAPIDelegate* delegate = | 100 const ManagementAPIDelegate* delegate = |
102 ManagementAPI::GetFactoryInstance()->Get(context)->GetDelegate(); | 101 ManagementAPI::GetFactoryInstance()->Get(context)->GetDelegate(); |
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
910 ManagementAPI::GetFactoryInstance() { | 909 ManagementAPI::GetFactoryInstance() { |
911 return g_factory.Pointer(); | 910 return g_factory.Pointer(); |
912 } | 911 } |
913 | 912 |
914 void ManagementAPI::OnListenerAdded(const EventListenerInfo& details) { | 913 void ManagementAPI::OnListenerAdded(const EventListenerInfo& details) { |
915 management_event_router_.reset(new ManagementEventRouter(browser_context_)); | 914 management_event_router_.reset(new ManagementEventRouter(browser_context_)); |
916 EventRouter::Get(browser_context_)->UnregisterObserver(this); | 915 EventRouter::Get(browser_context_)->UnregisterObserver(this); |
917 } | 916 } |
918 | 917 |
919 } // namespace extensions | 918 } // namespace extensions |
OLD | NEW |