OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/ash/launcher/extension_launcher_context_menu.h" | 5 #include "chrome/browser/ui/ash/launcher/extension_launcher_context_menu.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "chrome/browser/extensions/context_menu_matcher.h" | 8 #include "chrome/browser/extensions/context_menu_matcher.h" |
9 #include "chrome/browser/extensions/extension_util.h" | 9 #include "chrome/browser/extensions/extension_util.h" |
10 #include "chrome/browser/extensions/launch_util.h" | 10 #include "chrome/browser/extensions/launch_util.h" |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 break; | 204 break; |
205 default: | 205 default: |
206 if (extension_items_) { | 206 if (extension_items_) { |
207 extension_items_->ExecuteCommand(command_id, nullptr, nullptr, | 207 extension_items_->ExecuteCommand(command_id, nullptr, nullptr, |
208 content::ContextMenuParams()); | 208 content::ContextMenuParams()); |
209 } | 209 } |
210 } | 210 } |
211 } | 211 } |
212 | 212 |
213 extensions::LaunchType ExtensionLauncherContextMenu::GetLaunchType() const { | 213 extensions::LaunchType ExtensionLauncherContextMenu::GetLaunchType() const { |
214 const extensions::Extension* extension = GetExtensionForAppID( | 214 const extensions::Extension* extension = |
215 item().app_launch_id.app_id(), controller()->profile()); | 215 GetExtensionForAppID(item().id.app_id, controller()->profile()); |
216 | 216 |
217 // An extension can be unloaded/updated/unavailable at any time. | 217 // An extension can be unloaded/updated/unavailable at any time. |
218 if (!extension) | 218 if (!extension) |
219 return extensions::LAUNCH_TYPE_DEFAULT; | 219 return extensions::LAUNCH_TYPE_DEFAULT; |
220 | 220 |
221 return extensions::GetLaunchType( | 221 return extensions::GetLaunchType( |
222 extensions::ExtensionPrefs::Get(controller()->profile()), extension); | 222 extensions::ExtensionPrefs::Get(controller()->profile()), extension); |
223 } | 223 } |
224 | 224 |
225 void ExtensionLauncherContextMenu::SetLaunchType(extensions::LaunchType type) { | 225 void ExtensionLauncherContextMenu::SetLaunchType(extensions::LaunchType type) { |
226 extensions::SetLaunchType(controller()->profile(), | 226 extensions::SetLaunchType(controller()->profile(), item().id.app_id, type); |
227 item().app_launch_id.app_id(), type); | |
228 } | 227 } |
OLD | NEW |