summaryrefslogtreecommitdiffstats
path: root/chrome/browser/automation
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-14 15:30:40 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-14 15:30:40 +0000
commitc65e2f15891448a06a89c7a2e0e9aa74d1a44c67 (patch)
tree0a8f6b8d60b332a9d4c60f85046f8a3f7ba3e96d /chrome/browser/automation
parent87996f6636dd308b649e38e7b83df05045e62b81 (diff)
downloadchromium_src-c65e2f15891448a06a89c7a2e0e9aa74d1a44c67.zip
chromium_src-c65e2f15891448a06a89c7a2e0e9aa74d1a44c67.tar.gz
chromium_src-c65e2f15891448a06a89c7a2e0e9aa74d1a44c67.tar.bz2
Fixes instant so that it correctly deals with child contents. I've
changed around BlockedPopupContainer so that it can handle any types and made TabContents offer a mode to block all child content. BUG=58927 TEST=enable instant, go to a site that would normally show a popup on entering (or explicitly enable all popups). While typing in the omnibox the popup shouldn't appear, but as soon as you commit the instant result it should appear. Review URL: http://codereview.chromium.org/3694005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62553 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/automation')
-rw-r--r--chrome/browser/automation/automation_provider.cc2
-rw-r--r--chrome/browser/automation/testing_automation_provider.cc30
2 files changed, 16 insertions, 16 deletions
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc
index ec635a9..7deaefe 100644
--- a/chrome/browser/automation/automation_provider.cc
+++ b/chrome/browser/automation/automation_provider.cc
@@ -38,7 +38,7 @@
#include "chrome/browser/automation/automation_window_tracker.h"
#include "chrome/browser/automation/extension_port_container.h"
#include "chrome/browser/autocomplete/autocomplete_edit.h"
-#include "chrome/browser/blocked_popup_container.h"
+#include "chrome/browser/blocked_content_container.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/bookmarks/bookmark_storage.h"
#include "chrome/browser/browser_list.h"
diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc
index 4b28aad..109c13b 100644
--- a/chrome/browser/automation/testing_automation_provider.cc
+++ b/chrome/browser/automation/testing_automation_provider.cc
@@ -27,7 +27,7 @@
#include "chrome/browser/automation/ui_controls.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/bookmarks/bookmark_storage.h"
-#include "chrome/browser/blocked_popup_container.h"
+#include "chrome/browser/blocked_content_container.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/browser_shutdown.h"
#include "chrome/browser/browser_window.h"
@@ -1956,10 +1956,10 @@ void TestingAutomationProvider::GetBlockedPopupCount(int handle, int* count) {
NavigationController* nav_controller = tab_tracker_->GetResource(handle);
TabContents* tab_contents = nav_controller->tab_contents();
if (tab_contents) {
- BlockedPopupContainer* container =
- tab_contents->blocked_popup_container();
+ BlockedContentContainer* container =
+ tab_contents->blocked_content_container();
if (container) {
- *count = static_cast<int>(container->GetBlockedPopupCount());
+ *count = static_cast<int>(container->GetBlockedContentsCount());
} else {
// If we don't have a container, we don't have any blocked popups to
// contain!
@@ -3598,13 +3598,13 @@ void TestingAutomationProvider::GetBlockedPopupsInfo(
return;
}
scoped_ptr<DictionaryValue> return_value(new DictionaryValue);
- BlockedPopupContainer* popup_container =
- tab_contents->blocked_popup_container();
+ BlockedContentContainer* popup_container =
+ tab_contents->blocked_content_container();
ListValue* blocked_popups_list = new ListValue;
if (popup_container) {
- BlockedPopupContainer::BlockedContents blocked_contents;
+ std::vector<TabContents*> blocked_contents;
popup_container->GetBlockedContents(&blocked_contents);
- for (BlockedPopupContainer::BlockedContents::const_iterator it =
+ for (std::vector<TabContents*>::const_iterator it =
blocked_contents.begin(); it != blocked_contents.end(); ++it) {
DictionaryValue* item = new DictionaryValue;
item->SetString("url", (*it)->GetURL().spec());
@@ -3635,16 +3635,16 @@ void TestingAutomationProvider::UnblockAndLaunchBlockedPopup(
return;
}
scoped_ptr<DictionaryValue> return_value(new DictionaryValue);
- BlockedPopupContainer* popup_container =
- tab_contents->blocked_popup_container();
- if (!popup_container ||
- popup_index >= (int)popup_container->GetBlockedPopupCount()) {
+ BlockedContentContainer* content_container =
+ tab_contents->blocked_content_container();
+ if (!content_container ||
+ popup_index >= (int)content_container->GetBlockedContentsCount()) {
reply.SendError(StringPrintf("No popup at index %d", popup_index));
return;
}
- BlockedPopupContainer::BlockedContents blocked_contents;
- popup_container->GetBlockedContents(&blocked_contents);
- popup_container->LaunchPopupForContents(blocked_contents[popup_index]);
+ std::vector<TabContents*> blocked_contents;
+ content_container->GetBlockedContents(&blocked_contents);
+ content_container->LaunchForContents(blocked_contents[popup_index]);
reply.SendSuccess(NULL);
}