| 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 #include "chrome/common/automation_id.h" | 112 #include "chrome/common/automation_id.h" |
| 113 #include "chrome/common/automation_messages.h" | 113 #include "chrome/common/automation_messages.h" |
| 114 #include "chrome/common/chrome_constants.h" | 114 #include "chrome/common/chrome_constants.h" |
| 115 #include "chrome/common/chrome_notification_types.h" | 115 #include "chrome/common/chrome_notification_types.h" |
| 116 #include "chrome/common/chrome_paths.h" | 116 #include "chrome/common/chrome_paths.h" |
| 117 #include "chrome/common/chrome_switches.h" | 117 #include "chrome/common/chrome_switches.h" |
| 118 #include "chrome/common/extensions/background_info.h" | 118 #include "chrome/common/extensions/background_info.h" |
| 119 #include "chrome/common/extensions/extension.h" | 119 #include "chrome/common/extensions/extension.h" |
| 120 #include "chrome/common/extensions/manifest_url_handler.h" | 120 #include "chrome/common/extensions/manifest_url_handler.h" |
| 121 #include "chrome/common/extensions/permissions/permission_set.h" | 121 #include "chrome/common/extensions/permissions/permission_set.h" |
| 122 #include "chrome/common/extensions/permissions/permissions_data.h" |
| 122 #include "chrome/common/pref_names.h" | 123 #include "chrome/common/pref_names.h" |
| 123 #include "chrome/common/render_messages.h" | 124 #include "chrome/common/render_messages.h" |
| 124 #include "content/public/browser/browser_child_process_host_iterator.h" | 125 #include "content/public/browser/browser_child_process_host_iterator.h" |
| 125 #include "content/public/browser/child_process_data.h" | 126 #include "content/public/browser/child_process_data.h" |
| 126 #include "content/public/browser/favicon_status.h" | 127 #include "content/public/browser/favicon_status.h" |
| 127 #include "content/public/browser/geolocation_provider.h" | 128 #include "content/public/browser/geolocation_provider.h" |
| 128 #include "content/public/browser/interstitial_page.h" | 129 #include "content/public/browser/interstitial_page.h" |
| 129 #include "content/public/browser/interstitial_page_delegate.h" | 130 #include "content/public/browser/interstitial_page_delegate.h" |
| 130 #include "content/public/browser/navigation_entry.h" | 131 #include "content/public/browser/navigation_entry.h" |
| 131 #include "content/public/browser/notification_service.h" | 132 #include "content/public/browser/notification_service.h" |
| (...skipping 3488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3620 } else { | 3621 } else { |
| 3621 AutomationJSONReply(this, reply_message).SendError( | 3622 AutomationJSONReply(this, reply_message).SendError( |
| 3622 "Extensions service/process manager is not available"); | 3623 "Extensions service/process manager is not available"); |
| 3623 } | 3624 } |
| 3624 } | 3625 } |
| 3625 | 3626 |
| 3626 namespace { | 3627 namespace { |
| 3627 | 3628 |
| 3628 ListValue* GetHostPermissions(const Extension* ext, bool effective_perm) { | 3629 ListValue* GetHostPermissions(const Extension* ext, bool effective_perm) { |
| 3629 extensions::URLPatternSet pattern_set; | 3630 extensions::URLPatternSet pattern_set; |
| 3630 if (effective_perm) | 3631 if (effective_perm) { |
| 3631 pattern_set = ext->GetEffectiveHostPermissions(); | 3632 pattern_set = |
| 3632 else | 3633 extensions::PermissionsData::GetEffectiveHostPermissions(ext); |
| 3634 } else { |
| 3633 pattern_set = ext->GetActivePermissions()->explicit_hosts(); | 3635 pattern_set = ext->GetActivePermissions()->explicit_hosts(); |
| 3636 } |
| 3634 | 3637 |
| 3635 ListValue* permissions = new ListValue; | 3638 ListValue* permissions = new ListValue; |
| 3636 for (extensions::URLPatternSet::const_iterator perm = pattern_set.begin(); | 3639 for (extensions::URLPatternSet::const_iterator perm = pattern_set.begin(); |
| 3637 perm != pattern_set.end(); ++perm) { | 3640 perm != pattern_set.end(); ++perm) { |
| 3638 permissions->Append(new StringValue(perm->GetAsString())); | 3641 permissions->Append(new StringValue(perm->GetAsString())); |
| 3639 } | 3642 } |
| 3640 | 3643 |
| 3641 return permissions; | 3644 return permissions; |
| 3642 } | 3645 } |
| 3643 | 3646 |
| (...skipping 2297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5941 if (g_browser_process) | 5944 if (g_browser_process) |
| 5942 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); | 5945 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); |
| 5943 } | 5946 } |
| 5944 | 5947 |
| 5945 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, | 5948 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, |
| 5946 WebContents* tab) { | 5949 WebContents* tab) { |
| 5947 TabStripModel* tab_strip = browser->tab_strip_model(); | 5950 TabStripModel* tab_strip = browser->tab_strip_model(); |
| 5948 if (tab_strip->GetActiveWebContents() != tab) | 5951 if (tab_strip->GetActiveWebContents() != tab) |
| 5949 tab_strip->ActivateTabAt(tab_strip->GetIndexOfWebContents(tab), true); | 5952 tab_strip->ActivateTabAt(tab_strip->GetIndexOfWebContents(tab), true); |
| 5950 } | 5953 } |
| OLD | NEW |