| 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/extensions/application_launch.h" | 5 #include "chrome/browser/ui/extensions/application_launch.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "apps/launcher.h" | 9 #include "apps/launcher.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 #include "chrome/browser/ui/browser_commands_mac.h" | 48 #include "chrome/browser/ui/browser_commands_mac.h" |
| 49 #endif | 49 #endif |
| 50 | 50 |
| 51 using content::WebContents; | 51 using content::WebContents; |
| 52 using extensions::Extension; | 52 using extensions::Extension; |
| 53 using extensions::ExtensionPrefs; | 53 using extensions::ExtensionPrefs; |
| 54 using extensions::ExtensionRegistry; | 54 using extensions::ExtensionRegistry; |
| 55 | 55 |
| 56 namespace { | 56 namespace { |
| 57 | 57 |
| 58 // Shows the app list for |desktop_type| and returns the app list's window. | 58 // Shows the app list and returns the app list's window. |
| 59 gfx::NativeWindow ShowAppListAndGetNativeWindow() { | 59 gfx::NativeWindow ShowAppListAndGetNativeWindow() { |
| 60 AppListService* app_list_service = AppListService::Get(); | 60 AppListService* app_list_service = AppListService::Get(); |
| 61 app_list_service->Show(); | 61 app_list_service->Show(); |
| 62 return app_list_service->GetAppListWindow(); | 62 return app_list_service->GetAppListWindow(); |
| 63 } | 63 } |
| 64 | 64 |
| 65 // Attempts to launch an app, prompting the user to enable it if necessary. If | 65 // Attempts to launch an app, prompting the user to enable it if necessary. If |
| 66 // a prompt is required it will be shown inside the window returned by | 66 // a prompt is required it will be shown inside the window returned by |
| 67 // |parent_window_getter|. | 67 // |parent_window_getter|. |
| 68 // This class manages its own lifetime. | 68 // This class manages its own lifetime. |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 extensions::TabHelper::FromWebContents(tab)->UpdateShortcutOnLoadComplete(); | 408 extensions::TabHelper::FromWebContents(tab)->UpdateShortcutOnLoadComplete(); |
| 409 | 409 |
| 410 return tab; | 410 return tab; |
| 411 } | 411 } |
| 412 | 412 |
| 413 bool CanLaunchViaEvent(const extensions::Extension* extension) { | 413 bool CanLaunchViaEvent(const extensions::Extension* extension) { |
| 414 const extensions::Feature* feature = | 414 const extensions::Feature* feature = |
| 415 extensions::FeatureProvider::GetAPIFeature("app.runtime"); | 415 extensions::FeatureProvider::GetAPIFeature("app.runtime"); |
| 416 return feature->IsAvailableToExtension(extension).is_available(); | 416 return feature->IsAvailableToExtension(extension).is_available(); |
| 417 } | 417 } |
| OLD | NEW |