Commit 45c8467d authored by xiyuan's avatar xiyuan Committed by Commit bot

kiosk: Fix zoom crash regression.

BUG=412922

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

Cr-Commit-Position: refs/heads/master@{#294530}
parent 87d79e63
......@@ -6,6 +6,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/strings/stringprintf.h"
#include "chrome/browser/app_mode/app_mode_utils.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/extensions/chrome_extension_web_contents_observer.h"
#include "chrome/browser/favicon/favicon_tab_helper.h"
......@@ -20,6 +21,7 @@
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/scoped_tabbed_browser_displayer.h"
#include "chrome/browser/ui/web_contents_sizer.h"
#include "chrome/browser/ui/zoom/zoom_controller.h"
#include "chrome/common/extensions/chrome_extension_messages.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/notification_service.h"
......@@ -175,6 +177,10 @@ void ChromeAppDelegate::InitWebContents(content::WebContents* web_contents) {
#endif // defined(ENABLE_PRINTING)
extensions::ChromeExtensionWebContentsObserver::CreateForWebContents(
web_contents);
// Kiosk app supports zooming.
if (chrome::IsRunningInForcedAppMode())
ZoomController::CreateForWebContents(web_contents);
}
void ChromeAppDelegate::ResizeWebContents(content::WebContents* web_contents,
......
......@@ -15,6 +15,7 @@
#include "chrome/browser/ui/views/apps/shaped_app_window_targeter.h"
#include "chrome/browser/ui/views/extensions/extension_keybinding_registry_views.h"
#include "chrome/browser/ui/views/frame/taskbar_decorator.h"
#include "chrome/browser/ui/zoom/zoom_controller.h"
#include "chrome/browser/web_applications/web_app.h"
#include "chrome/common/chrome_switches.h"
#include "extensions/common/extension.h"
......@@ -273,6 +274,11 @@ void ChromeNativeAppWindowViews::InitializeDefaultWindow(
arraysize(kAppWindowAcceleratorMap) +
arraysize(kAppWindowKioskAppModeAcceleratorMap));
// Ensure there is a ZoomController in kiosk mode, otherwise the processing
// of the accelerators will cause a crash.
DCHECK(!is_kiosk_app_mode ||
ZoomController::FromWebContents(web_view()->GetWebContents()));
for (std::map<ui::Accelerator, int>::const_iterator iter =
accelerator_table.begin();
iter != accelerator_table.end(); ++iter) {
......
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