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 "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/base64.h" | 8 #include "base/base64.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 #include "chrome/browser/google/google_util.h" | 34 #include "chrome/browser/google/google_util.h" |
35 #include "chrome/browser/managed_mode/managed_user_service.h" | 35 #include "chrome/browser/managed_mode/managed_user_service.h" |
36 #include "chrome/browser/managed_mode/managed_user_service_factory.h" | 36 #include "chrome/browser/managed_mode/managed_user_service_factory.h" |
37 #include "chrome/browser/profiles/profile.h" | 37 #include "chrome/browser/profiles/profile.h" |
38 #include "chrome/browser/tab_contents/background_contents.h" | 38 #include "chrome/browser/tab_contents/background_contents.h" |
39 #include "chrome/browser/ui/browser_finder.h" | 39 #include "chrome/browser/ui/browser_finder.h" |
40 #include "chrome/browser/ui/chrome_select_file_policy.h" | 40 #include "chrome/browser/ui/chrome_select_file_policy.h" |
41 #include "chrome/browser/ui/extensions/application_launch.h" | 41 #include "chrome/browser/ui/extensions/application_launch.h" |
42 #include "chrome/browser/ui/extensions/shell_window.h" | 42 #include "chrome/browser/ui/extensions/shell_window.h" |
43 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" | 43 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" |
44 #include "chrome/browser/view_type_utils.h" | |
45 #include "chrome/common/chrome_notification_types.h" | 44 #include "chrome/common/chrome_notification_types.h" |
46 #include "chrome/common/chrome_switches.h" | 45 #include "chrome/common/chrome_switches.h" |
47 #include "chrome/common/extensions/background_info.h" | 46 #include "chrome/common/extensions/background_info.h" |
48 #include "chrome/common/extensions/extension.h" | 47 #include "chrome/common/extensions/extension.h" |
49 #include "chrome/common/extensions/extension_constants.h" | 48 #include "chrome/common/extensions/extension_constants.h" |
50 #include "chrome/common/extensions/extension_icon_set.h" | 49 #include "chrome/common/extensions/extension_icon_set.h" |
51 #include "chrome/common/extensions/extension_set.h" | 50 #include "chrome/common/extensions/extension_set.h" |
52 #include "chrome/common/extensions/feature_switch.h" | 51 #include "chrome/common/extensions/feature_switch.h" |
53 #include "chrome/common/extensions/incognito_handler.h" | 52 #include "chrome/common/extensions/incognito_handler.h" |
54 #include "chrome/common/extensions/manifest_url_handler.h" | 53 #include "chrome/common/extensions/manifest_url_handler.h" |
55 #include "chrome/common/pref_names.h" | 54 #include "chrome/common/pref_names.h" |
56 #include "chrome/common/url_constants.h" | 55 #include "chrome/common/url_constants.h" |
57 #include "components/user_prefs/pref_registry_syncable.h" | 56 #include "components/user_prefs/pref_registry_syncable.h" |
58 #include "content/public/browser/notification_service.h" | 57 #include "content/public/browser/notification_service.h" |
59 #include "content/public/browser/notification_source.h" | 58 #include "content/public/browser/notification_source.h" |
60 #include "content/public/browser/notification_types.h" | 59 #include "content/public/browser/notification_types.h" |
61 #include "content/public/browser/render_process_host.h" | 60 #include "content/public/browser/render_process_host.h" |
62 #include "content/public/browser/render_view_host.h" | 61 #include "content/public/browser/render_view_host.h" |
63 #include "content/public/browser/site_instance.h" | 62 #include "content/public/browser/site_instance.h" |
64 #include "content/public/browser/web_contents.h" | 63 #include "content/public/browser/web_contents.h" |
65 #include "content/public/browser/web_contents_view.h" | 64 #include "content/public/browser/web_contents_view.h" |
66 #include "content/public/browser/web_ui.h" | 65 #include "content/public/browser/web_ui.h" |
67 #include "content/public/browser/web_ui_data_source.h" | 66 #include "content/public/browser/web_ui_data_source.h" |
| 67 #include "extensions/browser/view_type_utils.h" |
68 #include "extensions/common/constants.h" | 68 #include "extensions/common/constants.h" |
69 #include "grit/browser_resources.h" | 69 #include "grit/browser_resources.h" |
70 #include "grit/chromium_strings.h" | 70 #include "grit/chromium_strings.h" |
71 #include "grit/generated_resources.h" | 71 #include "grit/generated_resources.h" |
72 #include "grit/theme_resources.h" | 72 #include "grit/theme_resources.h" |
73 #include "ui/base/l10n/l10n_util.h" | 73 #include "ui/base/l10n/l10n_util.h" |
74 #include "ui/base/resource/resource_bundle.h" | 74 #include "ui/base/resource/resource_bundle.h" |
75 | 75 |
76 | 76 |
77 using content::RenderViewHost; | 77 using content::RenderViewHost; |
(...skipping 933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1011 return result; | 1011 return result; |
1012 } | 1012 } |
1013 | 1013 |
1014 void ExtensionSettingsHandler::GetInspectablePagesForExtensionProcess( | 1014 void ExtensionSettingsHandler::GetInspectablePagesForExtensionProcess( |
1015 const std::set<RenderViewHost*>& views, | 1015 const std::set<RenderViewHost*>& views, |
1016 std::vector<ExtensionPage>* result) { | 1016 std::vector<ExtensionPage>* result) { |
1017 for (std::set<RenderViewHost*>::const_iterator iter = views.begin(); | 1017 for (std::set<RenderViewHost*>::const_iterator iter = views.begin(); |
1018 iter != views.end(); ++iter) { | 1018 iter != views.end(); ++iter) { |
1019 RenderViewHost* host = *iter; | 1019 RenderViewHost* host = *iter; |
1020 WebContents* web_contents = WebContents::FromRenderViewHost(host); | 1020 WebContents* web_contents = WebContents::FromRenderViewHost(host); |
1021 chrome::ViewType host_type = chrome::GetViewType(web_contents); | 1021 extensions::ViewType host_type = extensions::GetViewType(web_contents); |
1022 if (host == deleting_rvh_ || | 1022 if (host == deleting_rvh_ || |
1023 chrome::VIEW_TYPE_EXTENSION_POPUP == host_type || | 1023 extensions::VIEW_TYPE_EXTENSION_POPUP == host_type || |
1024 chrome::VIEW_TYPE_EXTENSION_DIALOG == host_type) | 1024 extensions::VIEW_TYPE_EXTENSION_DIALOG == host_type) |
1025 continue; | 1025 continue; |
1026 | 1026 |
1027 GURL url = web_contents->GetURL(); | 1027 GURL url = web_contents->GetURL(); |
1028 content::RenderProcessHost* process = host->GetProcess(); | 1028 content::RenderProcessHost* process = host->GetProcess(); |
1029 result->push_back( | 1029 result->push_back( |
1030 ExtensionPage(url, process->GetID(), host->GetRoutingID(), | 1030 ExtensionPage(url, process->GetID(), host->GetRoutingID(), |
1031 process->GetBrowserContext()->IsOffTheRecord())); | 1031 process->GetBrowserContext()->IsOffTheRecord())); |
1032 } | 1032 } |
1033 } | 1033 } |
1034 | 1034 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1077 std::vector<std::string> requirement_errors) { | 1077 std::vector<std::string> requirement_errors) { |
1078 if (requirement_errors.empty()) { | 1078 if (requirement_errors.empty()) { |
1079 extension_service_->EnableExtension(extension_id); | 1079 extension_service_->EnableExtension(extension_id); |
1080 } else { | 1080 } else { |
1081 ExtensionErrorReporter::GetInstance()->ReportError( | 1081 ExtensionErrorReporter::GetInstance()->ReportError( |
1082 UTF8ToUTF16(JoinString(requirement_errors, ' ')), | 1082 UTF8ToUTF16(JoinString(requirement_errors, ' ')), |
1083 true /* be noisy */); | 1083 true /* be noisy */); |
1084 } | 1084 } |
1085 requirements_checker_.reset(); | 1085 requirements_checker_.reset(); |
1086 } | 1086 } |
OLD | NEW |