Commit 4702f8e8 authored by dtseng's avatar dtseng Committed by Commit bot

Fix AccessibilityExtensionLoader's handling of locked screen

Previously, accessibility extensions required content scripts to access locked screen UI. With the introduction of chrome.automation, this is no longer necessary. An extension running in the signed in profile can easily access locked screen UI.

We therefore can:
- remove enabling an extension in the locked screen ui's profile (e.g. adding ChromeVox as a component extension).
- stop injection of content scripts into the locked screen's web ui.

TEST=navigate to locked screen with ChromeVox on. Verify things work. Toggle ChromeVox off and on. Verify things still work.
BUG=676467,611736
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2617633004
Cr-Commit-Position: refs/heads/master@{#442970}
parent eed4ea8f
...@@ -95,12 +95,6 @@ ...@@ -95,12 +95,6 @@
#include "content/public/test/ppapi_test_utils.h" #include "content/public/test/ppapi_test_utils.h"
#endif #endif
#if defined(OS_CHROMEOS)
#include "ash/common/accessibility_types.h"
#include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
#include "chrome/browser/chromeos/accessibility/speech_monitor.h"
#endif
using extensions::ContextMenuMatcher; using extensions::ContextMenuMatcher;
using extensions::ExtensionsAPIClient; using extensions::ExtensionsAPIClient;
using extensions::MenuItem; using extensions::MenuItem;
...@@ -2222,30 +2216,6 @@ IN_PROC_BROWSER_TEST_P(WebViewTest, ScreenCoordinates) { ...@@ -2222,30 +2216,6 @@ IN_PROC_BROWSER_TEST_P(WebViewTest, ScreenCoordinates) {
<< message_; << message_;
} }
#if defined(OS_CHROMEOS)
// Flaky, see http://crbug.com/611736.
IN_PROC_BROWSER_TEST_P(WebViewTest, DISABLED_ChromeVoxInjection) {
EXPECT_FALSE(
chromeos::AccessibilityManager::Get()->IsSpokenFeedbackEnabled());
chromeos::SpeechMonitor monitor;
chromeos::AccessibilityManager::Get()->EnableSpokenFeedback(
true, ash::A11Y_NOTIFICATION_NONE);
EXPECT_TRUE(monitor.SkipChromeVoxEnabledMessage());
ASSERT_TRUE(StartEmbeddedTestServer());
content::WebContents* guest_web_contents = LoadGuest(
"/extensions/platform_apps/web_view/chromevox_injection/guest.html",
"web_view/chromevox_injection");
ASSERT_TRUE(guest_web_contents);
for (;;) {
if (monitor.GetNextUtterance() == "chrome vox test title")
break;
}
}
#endif
// Flaky on Windows. http://crbug.com/303966 // Flaky on Windows. http://crbug.com/303966
#if defined(OS_WIN) #if defined(OS_WIN)
#define MAYBE_TearDownTest DISABLED_TearDownTest #define MAYBE_TearDownTest DISABLED_TearDownTest
......
...@@ -9,11 +9,6 @@ ...@@ -9,11 +9,6 @@
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
namespace content {
class RenderViewHost;
}
class ExtensionService;
class Profile; class Profile;
namespace chromeos { namespace chromeos {
...@@ -26,35 +21,19 @@ class AccessibilityExtensionLoader { ...@@ -26,35 +21,19 @@ class AccessibilityExtensionLoader {
~AccessibilityExtensionLoader(); ~AccessibilityExtensionLoader();
void SetProfile(Profile* profile, const base::Closure& done_callback); void SetProfile(Profile* profile, const base::Closure& done_callback);
void Load(Profile* profile, void Load(Profile* profile, const base::Closure& done_cb);
const std::string& init_script_str,
const base::Closure& done_cb);
void Unload(); void Unload();
void LoadToUserScreen(const base::Closure& done_cb);
void LoadToLockScreen(const base::Closure& done_cb);
void LoadExtension(Profile* profile, void LoadExtension(Profile* profile,
content::RenderViewHost* render_view_host,
base::Closure done_cb); base::Closure done_cb);
bool loaded_on_lock_screen() { return loaded_on_lock_screen_; }
private: private:
void InjectContentScriptAndCallback(ExtensionService* extension_service,
int render_process_id,
int render_view_id,
const base::Closure& done_cb);
void UnloadFromLockScreen();
void UnloadExtensionFromProfile(Profile* profile); void UnloadExtensionFromProfile(Profile* profile);
Profile* profile_; Profile* profile_;
std::string extension_id_; std::string extension_id_;
base::FilePath extension_path_; base::FilePath extension_path_;
std::string init_script_str_;
// Profile which the extension is currently loaded to. bool loaded_;
// If nullptr, it is not loaded to any profile.
bool loaded_on_lock_screen_;
bool loaded_on_user_screen_;
base::Closure unload_callback_; base::Closure unload_callback_;
......
...@@ -66,7 +66,6 @@ ...@@ -66,7 +66,6 @@
#include "content/public/browser/notification_details.h" #include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_service.h" #include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_source.h" #include "content/public/browser/notification_source.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_ui.h" #include "content/public/browser/web_ui.h"
#include "content/public/common/content_switches.h" #include "content/public/common/content_switches.h"
#include "content/public/common/service_manager_connection.h" #include "content/public/common/service_manager_connection.h"
...@@ -87,7 +86,6 @@ ...@@ -87,7 +86,6 @@
#include "ui/keyboard/keyboard_util.h" #include "ui/keyboard/keyboard_util.h"
using content::BrowserThread; using content::BrowserThread;
using content::RenderViewHost;
using extensions::api::braille_display_private::BrailleController; using extensions::api::braille_display_private::BrailleController;
using extensions::api::braille_display_private::DisplayState; using extensions::api::braille_display_private::DisplayState;
using extensions::api::braille_display_private::KeyEvent; using extensions::api::braille_display_private::KeyEvent;
...@@ -261,7 +259,6 @@ AccessibilityManager::AccessibilityManager() ...@@ -261,7 +259,6 @@ AccessibilityManager::AccessibilityManager()
select_to_speak_enabled_(false), select_to_speak_enabled_(false),
switch_access_enabled_(false), switch_access_enabled_(false),
spoken_feedback_notification_(ash::A11Y_NOTIFICATION_NONE), spoken_feedback_notification_(ash::A11Y_NOTIFICATION_NONE),
should_speak_chrome_vox_announcements_on_user_screen_(true),
system_sounds_enabled_(false), system_sounds_enabled_(false),
braille_display_connected_(false), braille_display_connected_(false),
scoped_braille_observer_(this), scoped_braille_observer_(this),
...@@ -278,9 +275,6 @@ AccessibilityManager::AccessibilityManager() ...@@ -278,9 +275,6 @@ AccessibilityManager::AccessibilityManager()
notification_registrar_.Add(this, notification_registrar_.Add(this,
chrome::NOTIFICATION_PROFILE_DESTROYED, chrome::NOTIFICATION_PROFILE_DESTROYED,
content::NotificationService::AllSources()); content::NotificationService::AllSources());
notification_registrar_.Add(this,
chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED,
content::NotificationService::AllSources());
input_method::InputMethodManager::Get()->AddObserver(this); input_method::InputMethodManager::Get()->AddObserver(this);
...@@ -483,7 +477,7 @@ void AccessibilityManager::UpdateSpokenFeedbackFromPref() { ...@@ -483,7 +477,7 @@ void AccessibilityManager::UpdateSpokenFeedbackFromPref() {
NotifyAccessibilityStatusChanged(details); NotifyAccessibilityStatusChanged(details);
if (enabled) { if (enabled) {
chromevox_loader_->Load(profile_, "window.INJECTED_AFTER_LOAD = true;", chromevox_loader_->Load(profile_,
base::Bind(&AccessibilityManager::PostLoadChromeVox, base::Bind(&AccessibilityManager::PostLoadChromeVox,
weak_ptr_factory_.GetWeakPtr())); weak_ptr_factory_.GetWeakPtr()));
} else { } else {
...@@ -886,8 +880,7 @@ void AccessibilityManager::UpdateSelectToSpeakFromPref() { ...@@ -886,8 +880,7 @@ void AccessibilityManager::UpdateSelectToSpeakFromPref() {
select_to_speak_enabled_ = enabled; select_to_speak_enabled_ = enabled;
if (enabled) { if (enabled) {
select_to_speak_loader_->Load(profile_, "" /* init_script_str */, select_to_speak_loader_->Load(profile_, base::Closure() /* done_cb */);
base::Closure() /* done_cb */);
select_to_speak_event_handler_.reset( select_to_speak_event_handler_.reset(
new chromeos::SelectToSpeakEventHandler()); new chromeos::SelectToSpeakEventHandler());
} else { } else {
...@@ -1163,10 +1156,6 @@ base::TimeDelta AccessibilityManager::PlayShutdownSound() { ...@@ -1163,10 +1156,6 @@ base::TimeDelta AccessibilityManager::PlayShutdownSound() {
return media::SoundsManager::Get()->GetDuration(SOUND_SHUTDOWN); return media::SoundsManager::Get()->GetDuration(SOUND_SHUTDOWN);
} }
void AccessibilityManager::InjectChromeVox(RenderViewHost* render_view_host) {
chromevox_loader_->LoadExtension(profile_, render_view_host, base::Closure());
}
std::unique_ptr<AccessibilityStatusSubscription> std::unique_ptr<AccessibilityStatusSubscription>
AccessibilityManager::RegisterCallback(const AccessibilityStatusCallback& cb) { AccessibilityManager::RegisterCallback(const AccessibilityStatusCallback& cb) {
return callback_list_.Add(cb); return callback_list_.Add(cb);
...@@ -1245,9 +1234,6 @@ void AccessibilityManager::Observe( ...@@ -1245,9 +1234,6 @@ void AccessibilityManager::Observe(
// Update |profile_| when entering a session. // Update |profile_| when entering a session.
SetProfile(ProfileManager::GetActiveUserProfile()); SetProfile(ProfileManager::GetActiveUserProfile());
// Ensure ChromeVox makes announcements at the start of new sessions.
should_speak_chrome_vox_announcements_on_user_screen_ = true;
// Add a session state observer to be able to monitor session changes. // Add a session state observer to be able to monitor session changes.
if (!session_state_observer_.get() && ash::Shell::HasInstance()) if (!session_state_observer_.get() && ash::Shell::HasInstance())
session_state_observer_.reset( session_state_observer_.reset(
...@@ -1260,19 +1246,6 @@ void AccessibilityManager::Observe( ...@@ -1260,19 +1246,6 @@ void AccessibilityManager::Observe(
SetProfile(NULL); SetProfile(NULL);
break; break;
} }
case chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED: {
bool is_screen_locked = *content::Details<bool>(details).ptr();
if (spoken_feedback_enabled_) {
if (is_screen_locked)
chromevox_loader_->LoadToLockScreen(base::Closure());
// If spoken feedback was enabled, make sure it is also enabled on
// the user screen.
// The status tray gets verbalized by user screen ChromeVox, so we need
// to load it on the user screen even if the screen is locked.
chromevox_loader_->LoadToUserScreen(base::Closure());
}
break;
}
} }
} }
...@@ -1320,24 +1293,17 @@ void AccessibilityManager::PostLoadChromeVox() { ...@@ -1320,24 +1293,17 @@ void AccessibilityManager::PostLoadChromeVox() {
// Do any setup work needed immediately after ChromeVox actually loads. // Do any setup work needed immediately after ChromeVox actually loads.
PlayEarcon(SOUND_SPOKEN_FEEDBACK_ENABLED, PlaySoundOption::ALWAYS); PlayEarcon(SOUND_SPOKEN_FEEDBACK_ENABLED, PlaySoundOption::ALWAYS);
if (chromevox_loader_->loaded_on_lock_screen() || extensions::EventRouter* event_router =
should_speak_chrome_vox_announcements_on_user_screen_) { extensions::EventRouter::Get(profile_);
extensions::EventRouter* event_router = CHECK(event_router);
extensions::EventRouter::Get(profile_);
CHECK(event_router);
std::unique_ptr<base::ListValue> event_args(new base::ListValue());
std::unique_ptr<extensions::Event> event(new extensions::Event(
extensions::events::ACCESSIBILITY_PRIVATE_ON_INTRODUCE_CHROME_VOX,
extensions::api::accessibility_private::OnIntroduceChromeVox::
kEventName,
std::move(event_args)));
event_router->DispatchEventWithLazyListener(
extension_misc::kChromeVoxExtensionId, std::move(event));
}
should_speak_chrome_vox_announcements_on_user_screen_ = std::unique_ptr<base::ListValue> event_args(new base::ListValue());
chromevox_loader_->loaded_on_lock_screen(); std::unique_ptr<extensions::Event> event(new extensions::Event(
extensions::events::ACCESSIBILITY_PRIVATE_ON_INTRODUCE_CHROME_VOX,
extensions::api::accessibility_private::OnIntroduceChromeVox::kEventName,
std::move(event_args)));
event_router->DispatchEventWithLazyListener(
extension_misc::kChromeVoxExtensionId, std::move(event));
if (!chromevox_panel_) { if (!chromevox_panel_) {
chromevox_panel_ = new ChromeVoxPanel(profile_); chromevox_panel_ = new ChromeVoxPanel(profile_);
......
...@@ -26,10 +26,6 @@ ...@@ -26,10 +26,6 @@
#include "extensions/browser/extension_system.h" #include "extensions/browser/extension_system.h"
#include "ui/base/ime/chromeos/input_method_manager.h" #include "ui/base/ime/chromeos/input_method_manager.h"
namespace content {
class RenderViewHost;
}
class Profile; class Profile;
namespace chromeos { namespace chromeos {
...@@ -235,9 +231,6 @@ class AccessibilityManager ...@@ -235,9 +231,6 @@ class AccessibilityManager
// Initiates play of shutdown sound and returns it's duration. // Initiates play of shutdown sound and returns it's duration.
base::TimeDelta PlayShutdownSound(); base::TimeDelta PlayShutdownSound();
// Injects ChromeVox scripts into given |render_view_host|.
void InjectChromeVox(content::RenderViewHost* render_view_host);
// Register a callback to be notified when the status of an accessibility // Register a callback to be notified when the status of an accessibility
// option changes. // option changes.
std::unique_ptr<AccessibilityStatusSubscription> RegisterCallback( std::unique_ptr<AccessibilityStatusSubscription> RegisterCallback(
...@@ -386,8 +379,6 @@ class AccessibilityManager ...@@ -386,8 +379,6 @@ class AccessibilityManager
ash::AccessibilityNotificationVisibility spoken_feedback_notification_; ash::AccessibilityNotificationVisibility spoken_feedback_notification_;
bool should_speak_chrome_vox_announcements_on_user_screen_;
bool system_sounds_enabled_; bool system_sounds_enabled_;
AccessibilityStatusCallbackList callback_list_; AccessibilityStatusCallbackList callback_list_;
......
...@@ -74,21 +74,6 @@ bool ChromeWebViewGuestDelegate::HandleContextMenu( ...@@ -74,21 +74,6 @@ bool ChromeWebViewGuestDelegate::HandleContextMenu(
return true; return true;
} }
void ChromeWebViewGuestDelegate::OnDidInitialize() {
#if defined(OS_CHROMEOS)
if (chrome::IsRunningInMash()) {
NOTIMPLEMENTED();
return;
}
chromeos::AccessibilityManager* accessibility_manager =
chromeos::AccessibilityManager::Get();
CHECK(accessibility_manager);
accessibility_subscription_ = accessibility_manager->RegisterCallback(
base::Bind(&ChromeWebViewGuestDelegate::OnAccessibilityStatusChanged,
weak_ptr_factory_.GetWeakPtr()));
#endif
}
// static // static
std::unique_ptr<base::ListValue> ChromeWebViewGuestDelegate::MenuModelToValue( std::unique_ptr<base::ListValue> ChromeWebViewGuestDelegate::MenuModelToValue(
const ui::SimpleMenuModel& menu_model) { const ui::SimpleMenuModel& menu_model) {
...@@ -128,35 +113,6 @@ bool ChromeWebViewGuestDelegate::ShouldHandleFindRequestsForEmbedder() const { ...@@ -128,35 +113,6 @@ bool ChromeWebViewGuestDelegate::ShouldHandleFindRequestsForEmbedder() const {
chrome::kChromeUIChromeSigninURL; chrome::kChromeUIChromeSigninURL;
} }
void ChromeWebViewGuestDelegate::InjectChromeVoxIfNeeded(
content::RenderViewHost* render_view_host) {
#if defined(OS_CHROMEOS)
if (!chromevox_injected_) {
chromeos::AccessibilityManager* manager =
chromeos::AccessibilityManager::Get();
if (manager && manager->IsSpokenFeedbackEnabled()) {
manager->InjectChromeVox(render_view_host);
chromevox_injected_ = true;
}
}
#endif
}
#if defined(OS_CHROMEOS)
void ChromeWebViewGuestDelegate::OnAccessibilityStatusChanged(
const chromeos::AccessibilityStatusEventDetails& details) {
if (details.notification_type == chromeos::ACCESSIBILITY_MANAGER_SHUTDOWN) {
accessibility_subscription_.reset();
} else if (details.notification_type ==
chromeos::ACCESSIBILITY_TOGGLE_SPOKEN_FEEDBACK) {
if (details.enabled)
InjectChromeVoxIfNeeded(guest_web_contents()->GetRenderViewHost());
else
chromevox_injected_ = false;
}
}
#endif
void ChromeWebViewGuestDelegate::SetContextMenuPosition( void ChromeWebViewGuestDelegate::SetContextMenuPosition(
const gfx::Point& position) { const gfx::Point& position) {
if (context_menu_position_ == nullptr) if (context_menu_position_ == nullptr)
......
...@@ -11,10 +11,6 @@ ...@@ -11,10 +11,6 @@
#include "extensions/browser/guest_view/web_view/web_view_guest.h" #include "extensions/browser/guest_view/web_view/web_view_guest.h"
#include "extensions/browser/guest_view/web_view/web_view_guest_delegate.h" #include "extensions/browser/guest_view/web_view/web_view_guest_delegate.h"
#if defined(OS_CHROMEOS)
#include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
#endif
class RenderViewContextMenuBase; class RenderViewContextMenuBase;
namespace ui { namespace ui {
...@@ -30,7 +26,6 @@ class ChromeWebViewGuestDelegate : public WebViewGuestDelegate { ...@@ -30,7 +26,6 @@ class ChromeWebViewGuestDelegate : public WebViewGuestDelegate {
// WebViewGuestDelegate implementation. // WebViewGuestDelegate implementation.
bool HandleContextMenu(const content::ContextMenuParams& params) override; bool HandleContextMenu(const content::ContextMenuParams& params) override;
void OnDidInitialize() override;
void OnShowContextMenu(int request_id) override; void OnShowContextMenu(int request_id) override;
bool ShouldHandleFindRequestsForEmbedder() const override; bool ShouldHandleFindRequestsForEmbedder() const override;
...@@ -47,14 +42,6 @@ class ChromeWebViewGuestDelegate : public WebViewGuestDelegate { ...@@ -47,14 +42,6 @@ class ChromeWebViewGuestDelegate : public WebViewGuestDelegate {
static std::unique_ptr<base::ListValue> MenuModelToValue( static std::unique_ptr<base::ListValue> MenuModelToValue(
const ui::SimpleMenuModel& menu_model); const ui::SimpleMenuModel& menu_model);
void InjectChromeVoxIfNeeded(content::RenderViewHost* render_view_host);
#if defined(OS_CHROMEOS)
// Notification of a change in the state of an accessibility setting.
void OnAccessibilityStatusChanged(
const chromeos::AccessibilityStatusEventDetails& details);
#endif
// A counter to generate a unique request id for a context menu request. // A counter to generate a unique request id for a context menu request.
// We only need the ids to be unique for a given WebViewGuest. // We only need the ids to be unique for a given WebViewGuest.
int pending_context_menu_request_id_; int pending_context_menu_request_id_;
...@@ -63,15 +50,6 @@ class ChromeWebViewGuestDelegate : public WebViewGuestDelegate { ...@@ -63,15 +50,6 @@ class ChromeWebViewGuestDelegate : public WebViewGuestDelegate {
// shown. This is .reset() after ShowContextMenu(). // shown. This is .reset() after ShowContextMenu().
std::unique_ptr<RenderViewContextMenuBase> pending_menu_; std::unique_ptr<RenderViewContextMenuBase> pending_menu_;
#if defined(OS_CHROMEOS)
// Set to |true| if ChromeVox was already injected in main frame.
bool chromevox_injected_ = false;
// Subscription to receive notifications on changes to a11y settings.
std::unique_ptr<chromeos::AccessibilityStatusSubscription>
accessibility_subscription_;
#endif
WebViewGuest* const web_view_guest_; WebViewGuest* const web_view_guest_;
std::unique_ptr<gfx::Point> context_menu_position_; std::unique_ptr<gfx::Point> context_menu_position_;
......
...@@ -88,12 +88,6 @@ Background = function() { ...@@ -88,12 +88,6 @@ Background = function() {
*/ */
this.currentRange_ = null; this.currentRange_ = null;
/**
* @type {cursors.Range}
* @private
*/
this.savedRange_ = null;
// Manually bind all functions to |this|. // Manually bind all functions to |this|.
for (var func in this) { for (var func in this) {
if (typeof(this[func]) == 'function') if (typeof(this[func]) == 'function')
...@@ -156,9 +150,6 @@ Background = function() { ...@@ -156,9 +150,6 @@ Background = function() {
/** @type {!LiveRegions} @private */ /** @type {!LiveRegions} @private */
this.liveRegions_ = new LiveRegions(this); this.liveRegions_ = new LiveRegions(this);
/** @type {boolean} @private */
this.inExcursion_ = false;
/** /**
* Stores the mode as computed the last time a current range was set. * Stores the mode as computed the last time a current range was set.
* @type {?ChromeVoxMode} * @type {?ChromeVoxMode}
...@@ -397,9 +388,6 @@ Background.prototype = { ...@@ -397,9 +388,6 @@ Background.prototype = {
* @override * @override
*/ */
setCurrentRange: function(newRange) { setCurrentRange: function(newRange) {
if (!this.inExcursion_ && newRange)
this.savedRange_ = new cursors.Range(newRange.start, newRange.end);
if (newRange && !newRange.isValid()) if (newRange && !newRange.isValid())
return; return;
......
...@@ -23,6 +23,8 @@ BackgroundKeyboardHandler = function() { ...@@ -23,6 +23,8 @@ BackgroundKeyboardHandler = function() {
document.addEventListener('keydown', this.onKeyDown.bind(this), false); document.addEventListener('keydown', this.onKeyDown.bind(this), false);
document.addEventListener('keyup', this.onKeyUp.bind(this), false); document.addEventListener('keyup', this.onKeyUp.bind(this), false);
chrome.accessibilityPrivate.setKeyboardListener(true, false);
}; };
BackgroundKeyboardHandler.prototype = { BackgroundKeyboardHandler.prototype = {
......
<!doctype html>
<!--
* Copyright (c) 2014 The Chromium Authors. All rights reserved. Use of this
* source code is governed by a BSD-style license that can be found in the
* LICENSE file.
-->
<html>
<head>
<title>ChromeVox test title</title>
</head>
<body>
<div>Some text</div>
</body>
</html>
<!doctype html>
<!--
* Copyright (c) 2014 The Chromium Authors. All rights reserved. Use of this
* source code is governed by a BSD-style license that can be found in the
* LICENSE file.
-->
<html>
<body>
<div id="webview-tag-container"></div>
<script src="main.js"></script>
</body>
</html>
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
var startTest = function() {
chrome.test.sendMessage('guest-loaded');
};
chrome.test.getConfig(function(config) {
var guestURL = 'http://localhost:' + config.testServer.port +
'/extensions/platform_apps/web_view/chromevox_injection/guest.html';
document.querySelector('#webview-tag-container').innerHTML =
'<webview style="width: 10px; height: 10px; margin: 0; padding: 0;"' +
' src="' + guestURL + '"' +
'></webview>';
startTest();
});
{
"name": "<webview> ChromeVox injection test.",
"version": "1",
"permissions": [
"webview"
],
"app": {
"background": {
"scripts": ["test.js"]
}
}
}
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
chrome.app.runtime.onLaunched.addListener(function() {
chrome.app.window.create('main.html', {}, function () {});
});
...@@ -401,8 +401,6 @@ void WebViewGuest::DidInitialize(const base::DictionaryValue& create_params) { ...@@ -401,8 +401,6 @@ void WebViewGuest::DidInitialize(const base::DictionaryValue& create_params) {
content::NOTIFICATION_RESOURCE_RECEIVED_REDIRECT, content::NOTIFICATION_RESOURCE_RECEIVED_REDIRECT,
content::Source<WebContents>(web_contents())); content::Source<WebContents>(web_contents()));
if (web_view_guest_delegate_)
web_view_guest_delegate_->OnDidInitialize();
ExtensionsAPIClient::Get()->AttachWebContentsHelpers(web_contents()); ExtensionsAPIClient::Get()->AttachWebContentsHelpers(web_contents());
web_view_permission_helper_.reset(new WebViewPermissionHelper(this)); web_view_permission_helper_.reset(new WebViewPermissionHelper(this));
......
...@@ -18,9 +18,6 @@ class WebViewGuestDelegate { ...@@ -18,9 +18,6 @@ class WebViewGuestDelegate {
// Called when context menu operation was handled. // Called when context menu operation was handled.
virtual bool HandleContextMenu(const content::ContextMenuParams& params) = 0; virtual bool HandleContextMenu(const content::ContextMenuParams& params) = 0;
// Called just after additional initialization is performed.
virtual void OnDidInitialize() = 0;
// Shows the context menu for the guest. // Shows the context menu for the guest.
virtual void OnShowContextMenu(int request_id) = 0; virtual void OnShowContextMenu(int request_id) = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment