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

Unified Diff: content/browser/browser_plugin/test_browser_plugin_guest.cc

Issue 26497003: Remove NOTIFICATION_WEB_CONTENTS_VISIBILITY_CHANGED from browser plugin. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 months 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 | « content/browser/browser_plugin/test_browser_plugin_guest.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/browser_plugin/test_browser_plugin_guest.cc
diff --git a/content/browser/browser_plugin/test_browser_plugin_guest.cc b/content/browser/browser_plugin/test_browser_plugin_guest.cc
index a6e62a3ba55b2fdab03cf3e6413632cca2a4bc66..7f10cfdd77008541fca54e5ba0654dfc9e0c54ab 100644
--- a/content/browser/browser_plugin/test_browser_plugin_guest.cc
+++ b/content/browser/browser_plugin/test_browser_plugin_guest.cc
@@ -8,7 +8,6 @@
#include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/common/browser_plugin/browser_plugin_messages.h"
-#include "content/public/browser/notification_types.h"
namespace content {
@@ -30,10 +29,6 @@ TestBrowserPluginGuest::TestBrowserPluginGuest(
load_stop_observed_(false),
waiting_for_damage_buffer_with_size_(false),
last_damage_buffer_size_(gfx::Size()) {
- // Listen to visibility changes so that a test can wait for these changes.
- notification_registrar_.Add(this,
- NOTIFICATION_WEB_CONTENTS_VISIBILITY_CHANGED,
- Source<WebContents>(web_contents));
}
TestBrowserPluginGuest::~TestBrowserPluginGuest() {
@@ -43,24 +38,6 @@ WebContentsImpl* TestBrowserPluginGuest::web_contents() const {
return static_cast<WebContentsImpl*>(BrowserPluginGuest::web_contents());
}
-void TestBrowserPluginGuest::Observe(int type,
- const NotificationSource& source,
- const NotificationDetails& details) {
- switch (type) {
- case NOTIFICATION_WEB_CONTENTS_VISIBILITY_CHANGED: {
- bool visible = *Details<bool>(details).ptr();
- if (!visible) {
- was_hidden_observed_ = true;
- if (was_hidden_message_loop_runner_.get())
- was_hidden_message_loop_runner_->Quit();
- }
- return;
- }
- }
-
- BrowserPluginGuest::Observe(type, source, details);
-}
-
void TestBrowserPluginGuest::SendMessageToEmbedder(IPC::Message* msg) {
if (msg->type() == BrowserPluginMsg_UpdateRect::ID) {
update_rect_count_++;
@@ -247,4 +224,10 @@ void TestBrowserPluginGuest::DidStopLoading(
load_stop_message_loop_runner_->Quit();
}
+void TestBrowserPluginGuest::WasHidden() {
+ was_hidden_observed_ = true;
+ if (was_hidden_message_loop_runner_.get())
+ was_hidden_message_loop_runner_->Quit();
+}
+
} // namespace content
« no previous file with comments | « content/browser/browser_plugin/test_browser_plugin_guest.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698