| 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/extensions/extension_settings_handler.h" | 5 #include "chrome/browser/ui/webui/extensions/extension_settings_handler.h" |
| 6 | 6 |
| 7 #include "apps/app_load_service.h" | 7 #include "apps/app_load_service.h" |
| 8 #include "apps/saved_files_service.h" | 8 #include "apps/saved_files_service.h" |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/base64.h" | 10 #include "base/base64.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" | 54 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" |
| 55 #include "chrome/common/chrome_switches.h" | 55 #include "chrome/common/chrome_switches.h" |
| 56 #include "chrome/common/chrome_version_info.h" | 56 #include "chrome/common/chrome_version_info.h" |
| 57 #include "chrome/common/extensions/features/feature_channel.h" | 57 #include "chrome/common/extensions/features/feature_channel.h" |
| 58 #include "chrome/common/pref_names.h" | 58 #include "chrome/common/pref_names.h" |
| 59 #include "chrome/common/url_constants.h" | 59 #include "chrome/common/url_constants.h" |
| 60 #include "chrome/grit/chromium_strings.h" | 60 #include "chrome/grit/chromium_strings.h" |
| 61 #include "chrome/grit/generated_resources.h" | 61 #include "chrome/grit/generated_resources.h" |
| 62 #include "components/google/core/browser/google_util.h" | 62 #include "components/google/core/browser/google_util.h" |
| 63 #include "components/pref_registry/pref_registry_syncable.h" | 63 #include "components/pref_registry/pref_registry_syncable.h" |
| 64 #include "components/web_modal/popup_manager.h" |
| 65 #include "components/web_modal/web_contents_modal_dialog_host.h" |
| 64 #include "content/public/browser/notification_service.h" | 66 #include "content/public/browser/notification_service.h" |
| 65 #include "content/public/browser/notification_source.h" | 67 #include "content/public/browser/notification_source.h" |
| 66 #include "content/public/browser/notification_types.h" | 68 #include "content/public/browser/notification_types.h" |
| 67 #include "content/public/browser/render_process_host.h" | 69 #include "content/public/browser/render_process_host.h" |
| 68 #include "content/public/browser/render_view_host.h" | 70 #include "content/public/browser/render_view_host.h" |
| 69 #include "content/public/browser/site_instance.h" | 71 #include "content/public/browser/site_instance.h" |
| 70 #include "content/public/browser/web_contents.h" | 72 #include "content/public/browser/web_contents.h" |
| 71 #include "content/public/browser/web_ui.h" | 73 #include "content/public/browser/web_ui.h" |
| 72 #include "content/public/browser/web_ui_data_source.h" | 74 #include "content/public/browser/web_ui_data_source.h" |
| 73 #include "extensions/browser/api/device_permissions_manager.h" | 75 #include "extensions/browser/api/device_permissions_manager.h" |
| (...skipping 1152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1226 // be set on Mac platforms. | 1228 // be set on Mac platforms. |
| 1227 if (ShouldDisplayExtensionInfoDialog()) { | 1229 if (ShouldDisplayExtensionInfoDialog()) { |
| 1228 UMA_HISTOGRAM_ENUMERATION("Apps.AppInfoDialog.Launches", | 1230 UMA_HISTOGRAM_ENUMERATION("Apps.AppInfoDialog.Launches", |
| 1229 AppInfoLaunchSource::FROM_EXTENSIONS_PAGE, | 1231 AppInfoLaunchSource::FROM_EXTENSIONS_PAGE, |
| 1230 AppInfoLaunchSource::NUM_LAUNCH_SOURCES); | 1232 AppInfoLaunchSource::NUM_LAUNCH_SOURCES); |
| 1231 | 1233 |
| 1232 // Display the dialog at a size similar to the app list. | 1234 // Display the dialog at a size similar to the app list. |
| 1233 const int kAppInfoDialogWidth = 380; | 1235 const int kAppInfoDialogWidth = 380; |
| 1234 const int kAppInfoDialogHeight = 490; | 1236 const int kAppInfoDialogHeight = 490; |
| 1235 | 1237 |
| 1236 ShowAppInfoInNativeDialog( | 1238 ShowAppInfoModally( |
| 1237 web_contents()->GetTopLevelNativeWindow(), | 1239 web_modal::PopupManager::FromWebContents(web_contents())->host(), |
| 1238 gfx::Size(kAppInfoDialogWidth, kAppInfoDialogHeight), | 1240 gfx::Size(kAppInfoDialogWidth, kAppInfoDialogHeight), |
| 1239 Profile::FromWebUI(web_ui()), extension, | 1241 Profile::FromWebUI(web_ui()), extension, |
| 1240 base::Bind(&BrokerDelegate::AppInfoDialogClosed, | 1242 base::Bind(&BrokerDelegate::AppInfoDialogClosed, |
| 1241 base::Unretained(broker_delegate))); | 1243 base::Unretained(broker_delegate))); |
| 1242 } else { | 1244 } else { |
| 1243 prompt_.reset(new ExtensionInstallPrompt(web_contents())); | 1245 prompt_.reset(new ExtensionInstallPrompt(web_contents())); |
| 1244 std::vector<base::FilePath> retained_file_paths; | 1246 std::vector<base::FilePath> retained_file_paths; |
| 1245 if (extension->permissions_data()->HasAPIPermission( | 1247 if (extension->permissions_data()->HasAPIPermission( |
| 1246 APIPermission::kFileSystem)) { | 1248 APIPermission::kFileSystem)) { |
| 1247 std::vector<apps::SavedFileEntry> retained_file_entries = | 1249 std::vector<apps::SavedFileEntry> retained_file_entries = |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1514 extension_service_->EnableExtension(extension_id); | 1516 extension_service_->EnableExtension(extension_id); |
| 1515 } else { | 1517 } else { |
| 1516 ExtensionErrorReporter::GetInstance()->ReportError( | 1518 ExtensionErrorReporter::GetInstance()->ReportError( |
| 1517 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), | 1519 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), |
| 1518 true); // Be noisy. | 1520 true); // Be noisy. |
| 1519 } | 1521 } |
| 1520 requirements_checker_.reset(); | 1522 requirements_checker_.reset(); |
| 1521 } | 1523 } |
| 1522 | 1524 |
| 1523 } // namespace extensions | 1525 } // namespace extensions |
| OLD | NEW |