Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(992)

Unified Diff: chrome/browser/external_tab_container.cc

Issue 366025: Modifying extension automation so that it is done through a particular... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/external_tab_container.h ('k') | chrome/test/automation/automation_messages_internal.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/external_tab_container.cc
===================================================================
--- chrome/browser/external_tab_container.cc (revision 31172)
+++ chrome/browser/external_tab_container.cc (working copy)
@@ -11,6 +11,7 @@
#include "base/logging.h"
#include "base/win_util.h"
#include "chrome/browser/automation/automation_provider.h"
+#include "chrome/browser/automation/automation_extension_function.h"
#include "chrome/browser/browser_window.h"
#include "chrome/browser/debugger/devtools_manager.h"
#include "chrome/browser/load_notification_details.h"
@@ -42,7 +43,8 @@
automation_resource_message_filter_(filter),
load_requests_via_automation_(false),
handle_top_level_requests_(false),
- external_method_factory_(this) {
+ external_method_factory_(this),
+ enabled_extension_automation_(false) {
}
ExternalTabContainer::~ExternalTabContainer() {
@@ -160,6 +162,10 @@
}
void ExternalTabContainer::Uninitialize() {
+ if (enabled_extension_automation_) {
+ AutomationExtensionFunction::Disable();
+ }
+
registrar_.RemoveAll();
if (tab_contents_) {
RenderViewHost* rvh = tab_contents_->render_view_host();
@@ -642,6 +648,22 @@
return NULL;
}
+void ExternalTabContainer::SetEnableExtensionAutomation(
+ const std::vector<std::string>& functions_enabled) {
+ if (functions_enabled.size() > 0) {
+ if (!tab_contents_) {
+ NOTREACHED() << "Being invoked via tab so should have TabContents";
+ return;
+ }
+
+ AutomationExtensionFunction::Enable(tab_contents_, functions_enabled);
+ enabled_extension_automation_ = true;
+ } else {
+ AutomationExtensionFunction::Disable();
+ enabled_extension_automation_ = false;
+ }
+}
+
void ExternalTabContainer::Navigate(const GURL& url, const GURL& referrer) {
if (!tab_contents_) {
NOTREACHED();
« no previous file with comments | « chrome/browser/external_tab_container.h ('k') | chrome/test/automation/automation_messages_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698