Skip to content

Commit

Permalink
Revert 207400 "Hook up HTML5 fullscreen video notifications to t..."
Browse files Browse the repository at this point in the history
Broke XP-Dbg-5 browser_tests:TabCaptureApiTest.FullscreenEvents
http://build.chromium.org/p/chromium.win/builders/XP%20Tests%20%28dbg%29%285%29/builds/30902

> Hook up HTML5 fullscreen video notifications to tabCapture API
> 
> BUG=222287
> 
> Review URL: https://chromiumcodereview.appspot.com/17354003

TBR=justinlin@chromium.org

Review URL: https://codereview.chromium.org/17484009

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@207435 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
rsesek@chromium.org committed Jun 20, 2013
1 parent b45d8e4 commit e3fb71b
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 108 deletions.
42 changes: 0 additions & 42 deletions chrome/browser/extensions/api/tab_capture/tab_capture_apitest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include "chrome/browser/extensions/extension_test_message_listener.h"
#include "chrome/browser/extensions/tab_helper.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/fullscreen/fullscreen_controller.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/chrome_version_info.h"
#include "chrome/common/extensions/feature_switch.h"
Expand Down Expand Up @@ -189,45 +188,4 @@ IN_PROC_BROWSER_TEST_F(TabCaptureApiTest, MAYBE_ActiveTabPermission) {
EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
}

// Linux Aura does not currently support fullscreen video.
#if defined(USE_AURA) && defined(OS_LINUX)
#define MAYBE_FullscreenEvents DISABLED_FullscreenEvents
// Fullscreen is special on Mac and does not fire events when run in tests.
#elif defined(OS_MACOSX)
#define MAYBE_FullscreenEvents DISABLED_FullscreenEvents
#else
#define MAYBE_FullscreenEvents FullscreenEvents
#endif
IN_PROC_BROWSER_TEST_F(TabCaptureApiTest, MAYBE_FullscreenEvents) {
AddExtensionToCommandLineWhitelist();

content::OpenURLParams params(GURL("chrome://version"),
content::Referrer(),
CURRENT_TAB,
content::PAGE_TRANSITION_LINK, false);
content::WebContents* web_contents = browser()->OpenURL(params);

ExtensionTestMessageListener listeners_setup("ready1", true);
ExtensionTestMessageListener fullscreen_entered("ready2", true);

ASSERT_TRUE(RunExtensionSubtest("tab_capture/experimental",
"fullscreen_test.html")) << message_;
EXPECT_TRUE(listeners_setup.WaitUntilSatisfied());

// Toggle fullscreen after setting up listeners.
browser()->fullscreen_controller()->ToggleFullscreenModeForTab(web_contents,
true);
listeners_setup.Reply("");

// Toggle again after JS should have the event.
EXPECT_TRUE(fullscreen_entered.WaitUntilSatisfied());
browser()->fullscreen_controller()->ToggleFullscreenModeForTab(web_contents,
false);
fullscreen_entered.Reply("");

ResultCatcher catcher;
catcher.RestrictToProfile(browser()->profile());
EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
}

} // namespace chrome
38 changes: 2 additions & 36 deletions chrome/browser/extensions/api/tab_capture/tab_capture_registry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,11 @@
#include "chrome/browser/extensions/event_router.h"
#include "chrome/browser/extensions/extension_system.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/fullscreen/fullscreen_controller.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/extensions/extension.h"
#include "components/browser_context_keyed_service/browser_context_dependency_manager.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_source.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
Expand Down Expand Up @@ -111,9 +109,7 @@ TabCaptureRegistry::TabCaptureRegistry(Profile* profile)
registrar_.Add(this,
chrome::NOTIFICATION_EXTENSION_UNLOADED,
content::Source<Profile>(profile_));
registrar_.Add(this,
chrome::NOTIFICATION_FULLSCREEN_CHANGED,
content::NotificationService::AllSources());
// TODO(justinlin): Hook up HTML5 fullscreen.
}

TabCaptureRegistry::~TabCaptureRegistry() {
Expand All @@ -136,7 +132,6 @@ const TabCaptureRegistry::RegistryCaptureInfo
void TabCaptureRegistry::Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
switch (type) {
case chrome::NOTIFICATION_EXTENSION_UNLOADED: {
// Cleanup all the requested media streams for this extension.
Expand All @@ -154,36 +149,7 @@ void TabCaptureRegistry::Observe(int type,
break;
}
case chrome::NOTIFICATION_FULLSCREEN_CHANGED: {
FullscreenController* fullscreen_controller =
content::Source<FullscreenController>(source).ptr();
const bool is_fullscreen = *content::Details<bool>(details).ptr();
for (ScopedVector<TabCaptureRequest>::iterator it = requests_.begin();
it != requests_.end(); ++it) {
// If we are exiting fullscreen mode, we only need to check if any of
// the requests had the fullscreen flag toggled previously. The
// fullscreen controller no longer has the reference to the fullscreen
// web_contents here.
if (!is_fullscreen) {
if ((*it)->fullscreen) {
(*it)->fullscreen = false;
DispatchStatusChangeEvent(*it);
break;
}
continue;
}

// If we are entering fullscreen mode, find whether the web_contents we
// are capturing entered fullscreen mode.
content::RenderViewHost* const rvh =
content::RenderViewHost::FromID((*it)->render_process_id,
(*it)->render_view_id);
if (rvh && fullscreen_controller->IsFullscreenForTabOrPending(
content::WebContents::FromRenderViewHost(rvh))) {
(*it)->fullscreen = true;
DispatchStatusChangeEvent(*it);
break;
}
}
// TODO(justinlin): Hook up HTML5 fullscreen.
break;
}
}
Expand Down

This file was deleted.

This file was deleted.

0 comments on commit e3fb71b

Please sign in to comment.