| 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/webui/ntp/app_launcher_handler.h" | 5 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 #include "chrome/browser/profiles/profile.h" | 30 #include "chrome/browser/profiles/profile.h" |
| 31 #include "chrome/browser/ui/browser_finder.h" | 31 #include "chrome/browser/ui/browser_finder.h" |
| 32 #include "chrome/browser/ui/browser_tabstrip.h" | 32 #include "chrome/browser/ui/browser_tabstrip.h" |
| 33 #include "chrome/browser/ui/browser_window.h" | 33 #include "chrome/browser/ui/browser_window.h" |
| 34 #include "chrome/browser/ui/extensions/application_launch.h" | 34 #include "chrome/browser/ui/extensions/application_launch.h" |
| 35 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" | 35 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" |
| 36 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" | 36 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" |
| 37 #include "chrome/browser/ui/webui/web_ui_util.h" | 37 #include "chrome/browser/ui/webui/web_ui_util.h" |
| 38 #include "chrome/common/chrome_notification_types.h" | 38 #include "chrome/common/chrome_notification_types.h" |
| 39 #include "chrome/common/extensions/extension.h" | 39 #include "chrome/common/extensions/extension.h" |
| 40 #include "chrome/common/extensions/extension_constants.h" |
| 40 #include "chrome/common/extensions/extension_icon_set.h" | 41 #include "chrome/common/extensions/extension_icon_set.h" |
| 41 #include "chrome/common/extensions/extension_resource.h" | 42 #include "chrome/common/extensions/extension_resource.h" |
| 42 #include "chrome/common/favicon_url.h" | 43 #include "chrome/common/favicon_url.h" |
| 43 #include "chrome/common/pref_names.h" | 44 #include "chrome/common/pref_names.h" |
| 44 #include "chrome/common/url_constants.h" | 45 #include "chrome/common/url_constants.h" |
| 45 #include "chrome/common/web_apps.h" | 46 #include "chrome/common/web_apps.h" |
| 46 #include "content/public/browser/notification_service.h" | 47 #include "content/public/browser/notification_service.h" |
| 47 #include "content/public/browser/web_ui.h" | 48 #include "content/public/browser/web_ui.h" |
| 48 #include "googleurl/src/gurl.h" | 49 #include "googleurl/src/gurl.h" |
| 49 #include "grit/browser_resources.h" | 50 #include "grit/browser_resources.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 extension->GetBasicInfo(enabled, value); | 123 extension->GetBasicInfo(enabled, value); |
| 123 | 124 |
| 124 value->SetBoolean("mayDisable", extensions::ExtensionSystem::Get( | 125 value->SetBoolean("mayDisable", extensions::ExtensionSystem::Get( |
| 125 service->profile())->management_policy()->UserMayModifySettings( | 126 service->profile())->management_policy()->UserMayModifySettings( |
| 126 extension, NULL)); | 127 extension, NULL)); |
| 127 | 128 |
| 128 bool icon_big_exists = true; | 129 bool icon_big_exists = true; |
| 129 // Instead of setting grayscale here, we do it in apps_page.js. | 130 // Instead of setting grayscale here, we do it in apps_page.js. |
| 130 GURL icon_big = | 131 GURL icon_big = |
| 131 ExtensionIconSource::GetIconURL(extension, | 132 ExtensionIconSource::GetIconURL(extension, |
| 132 ExtensionIconSet::EXTENSION_ICON_LARGE, | 133 extension_misc::EXTENSION_ICON_LARGE, |
| 133 ExtensionIconSet::MATCH_BIGGER, | 134 ExtensionIconSet::MATCH_BIGGER, |
| 134 false, &icon_big_exists); | 135 false, &icon_big_exists); |
| 135 value->SetString("icon_big", icon_big.spec()); | 136 value->SetString("icon_big", icon_big.spec()); |
| 136 value->SetBoolean("icon_big_exists", icon_big_exists); | 137 value->SetBoolean("icon_big_exists", icon_big_exists); |
| 137 bool icon_small_exists = true; | 138 bool icon_small_exists = true; |
| 138 GURL icon_small = | 139 GURL icon_small = |
| 139 ExtensionIconSource::GetIconURL(extension, | 140 ExtensionIconSource::GetIconURL(extension, |
| 140 ExtensionIconSet::EXTENSION_ICON_BITTY, | 141 extension_misc::EXTENSION_ICON_BITTY, |
| 141 ExtensionIconSet::MATCH_BIGGER, | 142 ExtensionIconSet::MATCH_BIGGER, |
| 142 false, &icon_small_exists); | 143 false, &icon_small_exists); |
| 143 value->SetString("icon_small", icon_small.spec()); | 144 value->SetString("icon_small", icon_small.spec()); |
| 144 value->SetBoolean("icon_small_exists", icon_small_exists); | 145 value->SetBoolean("icon_small_exists", icon_small_exists); |
| 145 value->SetInteger("launch_container", extension->launch_container()); | 146 value->SetInteger("launch_container", extension->launch_container()); |
| 146 ExtensionPrefs* prefs = service->extension_prefs(); | 147 ExtensionPrefs* prefs = service->extension_prefs(); |
| 147 value->SetInteger("launch_type", | 148 value->SetInteger("launch_type", |
| 148 prefs->GetLaunchType(extension->id(), | 149 prefs->GetLaunchType(extension->id(), |
| 149 ExtensionPrefs::LAUNCH_DEFAULT)); | 150 ExtensionPrefs::LAUNCH_DEFAULT)); |
| 150 value->SetBoolean("is_component", | 151 value->SetBoolean("is_component", |
| (...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 939 | 940 |
| 940 ExtensionInstallPrompt* AppLauncherHandler::GetExtensionInstallPrompt() { | 941 ExtensionInstallPrompt* AppLauncherHandler::GetExtensionInstallPrompt() { |
| 941 if (!extension_install_ui_.get()) { | 942 if (!extension_install_ui_.get()) { |
| 942 Browser* browser = browser::FindBrowserWithWebContents( | 943 Browser* browser = browser::FindBrowserWithWebContents( |
| 943 web_ui()->GetWebContents()); | 944 web_ui()->GetWebContents()); |
| 944 extension_install_ui_.reset( | 945 extension_install_ui_.reset( |
| 945 chrome::CreateExtensionInstallPromptWithBrowser(browser)); | 946 chrome::CreateExtensionInstallPromptWithBrowser(browser)); |
| 946 } | 947 } |
| 947 return extension_install_ui_.get(); | 948 return extension_install_ui_.get(); |
| 948 } | 949 } |
| OLD | NEW |