| 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/app_window.h" | |
| 9 #include "apps/app_window_registry.h" | |
| 10 #include "apps/saved_files_service.h" | 8 #include "apps/saved_files_service.h" |
| 11 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 12 #include "base/base64.h" | 10 #include "base/base64.h" |
| 13 #include "base/bind.h" | 11 #include "base/bind.h" |
| 14 #include "base/bind_helpers.h" | 12 #include "base/bind_helpers.h" |
| 15 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 16 #include "base/location.h" | 14 #include "base/location.h" |
| 17 #include "base/message_loop/message_loop.h" | 15 #include "base/message_loop/message_loop.h" |
| 18 #include "base/metrics/histogram.h" | 16 #include "base/metrics/histogram.h" |
| 19 #include "base/prefs/pref_service.h" | 17 #include "base/prefs/pref_service.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 #include "components/pref_registry/pref_registry_syncable.h" | 64 #include "components/pref_registry/pref_registry_syncable.h" |
| 67 #include "content/public/browser/notification_service.h" | 65 #include "content/public/browser/notification_service.h" |
| 68 #include "content/public/browser/notification_source.h" | 66 #include "content/public/browser/notification_source.h" |
| 69 #include "content/public/browser/notification_types.h" | 67 #include "content/public/browser/notification_types.h" |
| 70 #include "content/public/browser/render_process_host.h" | 68 #include "content/public/browser/render_process_host.h" |
| 71 #include "content/public/browser/render_view_host.h" | 69 #include "content/public/browser/render_view_host.h" |
| 72 #include "content/public/browser/site_instance.h" | 70 #include "content/public/browser/site_instance.h" |
| 73 #include "content/public/browser/web_contents.h" | 71 #include "content/public/browser/web_contents.h" |
| 74 #include "content/public/browser/web_ui.h" | 72 #include "content/public/browser/web_ui.h" |
| 75 #include "content/public/browser/web_ui_data_source.h" | 73 #include "content/public/browser/web_ui_data_source.h" |
| 74 #include "extensions/browser/app_window/app_window.h" |
| 75 #include "extensions/browser/app_window/app_window_registry.h" |
| 76 #include "extensions/browser/blacklist_state.h" | 76 #include "extensions/browser/blacklist_state.h" |
| 77 #include "extensions/browser/extension_error.h" | 77 #include "extensions/browser/extension_error.h" |
| 78 #include "extensions/browser/extension_host.h" | 78 #include "extensions/browser/extension_host.h" |
| 79 #include "extensions/browser/extension_registry.h" | 79 #include "extensions/browser/extension_registry.h" |
| 80 #include "extensions/browser/extension_system.h" | 80 #include "extensions/browser/extension_system.h" |
| 81 #include "extensions/browser/lazy_background_task_queue.h" | 81 #include "extensions/browser/lazy_background_task_queue.h" |
| 82 #include "extensions/browser/management_policy.h" | 82 #include "extensions/browser/management_policy.h" |
| 83 #include "extensions/browser/pref_names.h" | 83 #include "extensions/browser/pref_names.h" |
| 84 #include "extensions/browser/uninstall_reason.h" | 84 #include "extensions/browser/uninstall_reason.h" |
| 85 #include "extensions/browser/view_type_utils.h" | 85 #include "extensions/browser/view_type_utils.h" |
| (...skipping 1271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1357 host->GetRoutingID(), | 1357 host->GetRoutingID(), |
| 1358 process->GetBrowserContext()->IsOffTheRecord(), | 1358 process->GetBrowserContext()->IsOffTheRecord(), |
| 1359 is_background_page && has_generated_background_page)); | 1359 is_background_page && has_generated_background_page)); |
| 1360 } | 1360 } |
| 1361 } | 1361 } |
| 1362 | 1362 |
| 1363 void ExtensionSettingsHandler::GetAppWindowPagesForExtensionProfile( | 1363 void ExtensionSettingsHandler::GetAppWindowPagesForExtensionProfile( |
| 1364 const Extension* extension, | 1364 const Extension* extension, |
| 1365 Profile* profile, | 1365 Profile* profile, |
| 1366 std::vector<ExtensionPage>* result) { | 1366 std::vector<ExtensionPage>* result) { |
| 1367 apps::AppWindowRegistry* registry = apps::AppWindowRegistry::Get(profile); | 1367 AppWindowRegistry* registry = AppWindowRegistry::Get(profile); |
| 1368 if (!registry) return; | 1368 if (!registry) return; |
| 1369 | 1369 |
| 1370 const apps::AppWindowRegistry::AppWindowList windows = | 1370 const AppWindowRegistry::AppWindowList windows = |
| 1371 registry->GetAppWindowsForApp(extension->id()); | 1371 registry->GetAppWindowsForApp(extension->id()); |
| 1372 | 1372 |
| 1373 bool has_generated_background_page = | 1373 bool has_generated_background_page = |
| 1374 BackgroundInfo::HasGeneratedBackgroundPage(extension); | 1374 BackgroundInfo::HasGeneratedBackgroundPage(extension); |
| 1375 for (apps::AppWindowRegistry::const_iterator it = windows.begin(); | 1375 for (AppWindowRegistry::const_iterator it = windows.begin(); |
| 1376 it != windows.end(); | 1376 it != windows.end(); |
| 1377 ++it) { | 1377 ++it) { |
| 1378 WebContents* web_contents = (*it)->web_contents(); | 1378 WebContents* web_contents = (*it)->web_contents(); |
| 1379 RenderViewHost* host = web_contents->GetRenderViewHost(); | 1379 RenderViewHost* host = web_contents->GetRenderViewHost(); |
| 1380 content::RenderProcessHost* process = host->GetProcess(); | 1380 content::RenderProcessHost* process = host->GetProcess(); |
| 1381 | 1381 |
| 1382 bool is_background_page = | 1382 bool is_background_page = |
| 1383 (web_contents->GetURL() == BackgroundInfo::GetBackgroundURL(extension)); | 1383 (web_contents->GetURL() == BackgroundInfo::GetBackgroundURL(extension)); |
| 1384 result->push_back( | 1384 result->push_back( |
| 1385 ExtensionPage(web_contents->GetURL(), | 1385 ExtensionPage(web_contents->GetURL(), |
| (...skipping 28 matching lines...) Expand all Loading... |
| 1414 extension_service_->EnableExtension(extension_id); | 1414 extension_service_->EnableExtension(extension_id); |
| 1415 } else { | 1415 } else { |
| 1416 ExtensionErrorReporter::GetInstance()->ReportError( | 1416 ExtensionErrorReporter::GetInstance()->ReportError( |
| 1417 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), | 1417 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), |
| 1418 true); // Be noisy. | 1418 true); // Be noisy. |
| 1419 } | 1419 } |
| 1420 requirements_checker_.reset(); | 1420 requirements_checker_.reset(); |
| 1421 } | 1421 } |
| 1422 | 1422 |
| 1423 } // namespace extensions | 1423 } // namespace extensions |
| OLD | NEW |