OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/automation/testing_automation_provider.h" | 5 #include "chrome/browser/automation/testing_automation_provider.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 #include "content/public/browser/plugin_service.h" | 132 #include "content/public/browser/plugin_service.h" |
133 #include "content/public/browser/render_process_host.h" | 133 #include "content/public/browser/render_process_host.h" |
134 #include "content/public/browser/render_view_host.h" | 134 #include "content/public/browser/render_view_host.h" |
135 #include "content/public/browser/render_widget_host_view.h" | 135 #include "content/public/browser/render_widget_host_view.h" |
136 #include "content/public/browser/web_contents.h" | 136 #include "content/public/browser/web_contents.h" |
137 #include "content/public/common/child_process_host.h" | 137 #include "content/public/common/child_process_host.h" |
138 #include "content/public/common/common_param_traits.h" | 138 #include "content/public/common/common_param_traits.h" |
139 #include "content/public/common/drop_data.h" | 139 #include "content/public/common/drop_data.h" |
140 #include "content/public/common/geoposition.h" | 140 #include "content/public/common/geoposition.h" |
141 #include "content/public/common/ssl_status.h" | 141 #include "content/public/common/ssl_status.h" |
| 142 #include "content/public/common/webplugininfo.h" |
142 #include "extensions/browser/view_type_utils.h" | 143 #include "extensions/browser/view_type_utils.h" |
143 #include "extensions/common/url_pattern.h" | 144 #include "extensions/common/url_pattern.h" |
144 #include "extensions/common/url_pattern_set.h" | 145 #include "extensions/common/url_pattern_set.h" |
145 #include "net/cookies/cookie_store.h" | 146 #include "net/cookies/cookie_store.h" |
146 #include "third_party/WebKit/public/web/WebInputEvent.h" | 147 #include "third_party/WebKit/public/web/WebInputEvent.h" |
147 #include "ui/base/events/event_constants.h" | 148 #include "ui/base/events/event_constants.h" |
148 #include "ui/base/keycodes/keyboard_codes.h" | 149 #include "ui/base/keycodes/keyboard_codes.h" |
149 #include "ui/base/ui_base_types.h" | 150 #include "ui/base/ui_base_types.h" |
150 #include "webkit/plugins/webplugininfo.h" | |
151 | 151 |
152 #if defined(ENABLE_CONFIGURATION_POLICY) | 152 #if defined(ENABLE_CONFIGURATION_POLICY) |
153 #include "chrome/browser/policy/policy_service.h" | 153 #include "chrome/browser/policy/policy_service.h" |
154 #endif | 154 #endif |
155 | 155 |
156 #if defined(OS_CHROMEOS) | 156 #if defined(OS_CHROMEOS) |
157 #include "chromeos/dbus/dbus_thread_manager.h" | 157 #include "chromeos/dbus/dbus_thread_manager.h" |
158 #endif | 158 #endif |
159 | 159 |
160 #if defined(OS_MACOSX) | 160 #if defined(OS_MACOSX) |
(...skipping 2890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3051 IPC::Message* reply_message) { | 3051 IPC::Message* reply_message) { |
3052 PluginService::GetInstance()->GetPlugins( | 3052 PluginService::GetInstance()->GetPlugins( |
3053 base::Bind(&TestingAutomationProvider::GetPluginsInfoCallback, | 3053 base::Bind(&TestingAutomationProvider::GetPluginsInfoCallback, |
3054 this, browser, args, reply_message)); | 3054 this, browser, args, reply_message)); |
3055 } | 3055 } |
3056 | 3056 |
3057 void TestingAutomationProvider::GetPluginsInfoCallback( | 3057 void TestingAutomationProvider::GetPluginsInfoCallback( |
3058 Browser* browser, | 3058 Browser* browser, |
3059 DictionaryValue* args, | 3059 DictionaryValue* args, |
3060 IPC::Message* reply_message, | 3060 IPC::Message* reply_message, |
3061 const std::vector<webkit::WebPluginInfo>& plugins) { | 3061 const std::vector<content::WebPluginInfo>& plugins) { |
3062 PluginPrefs* plugin_prefs = | 3062 PluginPrefs* plugin_prefs = |
3063 PluginPrefs::GetForProfile(browser->profile()).get(); | 3063 PluginPrefs::GetForProfile(browser->profile()).get(); |
3064 ListValue* items = new ListValue; | 3064 ListValue* items = new ListValue; |
3065 for (std::vector<webkit::WebPluginInfo>::const_iterator it = | 3065 for (std::vector<content::WebPluginInfo>::const_iterator it = |
3066 plugins.begin(); | 3066 plugins.begin(); |
3067 it != plugins.end(); | 3067 it != plugins.end(); |
3068 ++it) { | 3068 ++it) { |
3069 DictionaryValue* item = new DictionaryValue; | 3069 DictionaryValue* item = new DictionaryValue; |
3070 item->SetString("name", it->name); | 3070 item->SetString("name", it->name); |
3071 item->SetString("path", it->path.value()); | 3071 item->SetString("path", it->path.value()); |
3072 item->SetString("version", it->version); | 3072 item->SetString("version", it->version); |
3073 item->SetString("desc", it->desc); | 3073 item->SetString("desc", it->desc); |
3074 item->SetBoolean("enabled", plugin_prefs->IsPluginEnabled(*it)); | 3074 item->SetBoolean("enabled", plugin_prefs->IsPluginEnabled(*it)); |
3075 // Add info about mime types. | 3075 // Add info about mime types. |
3076 ListValue* mime_types = new ListValue(); | 3076 ListValue* mime_types = new ListValue(); |
3077 for (std::vector<webkit::WebPluginMimeType>::const_iterator type_it = | 3077 for (std::vector<content::WebPluginMimeType>::const_iterator type_it = |
3078 it->mime_types.begin(); | 3078 it->mime_types.begin(); |
3079 type_it != it->mime_types.end(); | 3079 type_it != it->mime_types.end(); |
3080 ++type_it) { | 3080 ++type_it) { |
3081 DictionaryValue* mime_type = new DictionaryValue(); | 3081 DictionaryValue* mime_type = new DictionaryValue(); |
3082 mime_type->SetString("mimeType", type_it->mime_type); | 3082 mime_type->SetString("mimeType", type_it->mime_type); |
3083 mime_type->SetString("description", type_it->description); | 3083 mime_type->SetString("description", type_it->description); |
3084 | 3084 |
3085 ListValue* file_extensions = new ListValue(); | 3085 ListValue* file_extensions = new ListValue(); |
3086 for (std::vector<std::string>::const_iterator ext_it = | 3086 for (std::vector<std::string>::const_iterator ext_it = |
3087 type_it->file_extensions.begin(); | 3087 type_it->file_extensions.begin(); |
(...skipping 2515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5603 if (g_browser_process) | 5603 if (g_browser_process) |
5604 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); | 5604 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); |
5605 } | 5605 } |
5606 | 5606 |
5607 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, | 5607 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, |
5608 WebContents* tab) { | 5608 WebContents* tab) { |
5609 TabStripModel* tab_strip = browser->tab_strip_model(); | 5609 TabStripModel* tab_strip = browser->tab_strip_model(); |
5610 if (tab_strip->GetActiveWebContents() != tab) | 5610 if (tab_strip->GetActiveWebContents() != tab) |
5611 tab_strip->ActivateTabAt(tab_strip->GetIndexOfWebContents(tab), true); | 5611 tab_strip->ActivateTabAt(tab_strip->GetIndexOfWebContents(tab), true); |
5612 } | 5612 } |
OLD | NEW |