summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/test/data/extensions/platform_apps/windows_api_ime/forced_app_mode_not_fullscreen/background.js22
-rw-r--r--chrome/test/data/extensions/platform_apps/windows_api_ime/forced_app_mode_not_fullscreen/index.html1
-rw-r--r--chrome/test/data/extensions/platform_apps/windows_api_ime/forced_app_mode_not_fullscreen/manifest.json10
-rw-r--r--extensions/DEPS1
-rw-r--r--extensions/browser/api/app_window/app_window_api.cc4
-rw-r--r--extensions/browser/api/app_window/app_window_apitest.cc13
6 files changed, 50 insertions, 1 deletions
diff --git a/chrome/test/data/extensions/platform_apps/windows_api_ime/forced_app_mode_not_fullscreen/background.js b/chrome/test/data/extensions/platform_apps/windows_api_ime/forced_app_mode_not_fullscreen/background.js
new file mode 100644
index 0000000..ecb55ec
--- /dev/null
+++ b/chrome/test/data/extensions/platform_apps/windows_api_ime/forced_app_mode_not_fullscreen/background.js
@@ -0,0 +1,22 @@
+// Copyright 2015 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 testBounds = {left: 0, top: 0, width: 10, height: 10};
+
+chrome.test.runTests([
+
+ // Window is created with specific bounds should not force to fullscreen.
+ function testFullscreenIsNotForced() {
+ chrome.app.window.create(
+ 'index.html',
+ { ime: true, frame: 'none', innerBounds: testBounds},
+ chrome.test.callbackPass(function(win) {
+ chrome.test.assertEq(testBounds.left, win.innerBounds.left);
+ chrome.test.assertEq(testBounds.top, win.innerBounds.top);
+ chrome.test.assertEq(testBounds.width, win.innerBounds.width);
+ chrome.test.assertEq(testBounds.height, win.innerBounds.height);
+ }));
+ }
+
+]);
diff --git a/chrome/test/data/extensions/platform_apps/windows_api_ime/forced_app_mode_not_fullscreen/index.html b/chrome/test/data/extensions/platform_apps/windows_api_ime/forced_app_mode_not_fullscreen/index.html
new file mode 100644
index 0000000..c341a40
--- /dev/null
+++ b/chrome/test/data/extensions/platform_apps/windows_api_ime/forced_app_mode_not_fullscreen/index.html
@@ -0,0 +1 @@
+<!-- empty -->
diff --git a/chrome/test/data/extensions/platform_apps/windows_api_ime/forced_app_mode_not_fullscreen/manifest.json b/chrome/test/data/extensions/platform_apps/windows_api_ime/forced_app_mode_not_fullscreen/manifest.json
new file mode 100644
index 0000000..6fc618bf
--- /dev/null
+++ b/chrome/test/data/extensions/platform_apps/windows_api_ime/forced_app_mode_not_fullscreen/manifest.json
@@ -0,0 +1,10 @@
+{
+ "name": "Windows API - ime (No fullscreen window in kiosk mode)",
+ "key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC7C0oB6YTnf69uhWnVTZl5TB/psHrJXgIPLYchFb0whlVCG8fqMo9lW/oxBmZXZ3N8T7zZrdYI/SUjoc9I5R/dMVVD2q4iKox+x7xlTbqSdVeOb6b9ZVJ24pLbO1L7feSNSBgR0t61jrC2eY/gf78h7w58UEQBPFT2mUxhhwodyQIDAQAB",
+ "version": "1",
+ "manifest_version": 2,
+ "background": {
+ "scripts": ["background.js"]
+ },
+ "permissions": ["app.window.ime"]
+}
diff --git a/extensions/DEPS b/extensions/DEPS
index 8f8f7f2..cbab948 100644
--- a/extensions/DEPS
+++ b/extensions/DEPS
@@ -49,6 +49,7 @@ specific_include_rules = {
"+chrome/browser/extensions/test_extension_prefs.h",
"+chrome/browser/extensions/test_extension_system.h",
"+chrome/browser/ui/browser.h",
+ "+chrome/common/chrome_switches.h",
"+chrome/common/extensions/features/feature_channel.h",
"+chrome/test/base/chrome_render_view_test.h",
"+chrome/test/base/testing_profile.h",
diff --git a/extensions/browser/api/app_window/app_window_api.cc b/extensions/browser/api/app_window/app_window_api.cc
index 089f0fc..3901d34 100644
--- a/extensions/browser/api/app_window/app_window_api.cc
+++ b/extensions/browser/api/app_window/app_window_api.cc
@@ -335,8 +335,10 @@ bool AppWindowCreateFunction::RunAsync() {
AppWindowClient::Get()->CreateAppWindow(browser_context(), extension());
app_window->Init(url, new AppWindowContentsImpl(app_window), create_params);
- if (ExtensionsBrowserClient::Get()->IsRunningInForcedAppMode())
+ if (ExtensionsBrowserClient::Get()->IsRunningInForcedAppMode() &&
+ !app_window->is_ime_window()) {
app_window->ForcedFullscreen();
+ }
content::RenderViewHost* created_view =
app_window->web_contents()->GetRenderViewHost();
diff --git a/extensions/browser/api/app_window/app_window_apitest.cc b/extensions/browser/api/app_window/app_window_apitest.cc
index 9fb4422..6aa666d 100644
--- a/extensions/browser/api/app_window/app_window_apitest.cc
+++ b/extensions/browser/api/app_window/app_window_apitest.cc
@@ -6,6 +6,7 @@
#include "base/strings/string_number_conversions.h"
#include "chrome/browser/apps/app_browsertest_util.h"
#include "chrome/browser/ui/browser.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/extensions/features/feature_channel.h"
#include "chrome/test/base/testing_profile.h"
#include "extensions/browser/app_window/app_window.h"
@@ -198,6 +199,18 @@ IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest,
"platform_apps/windows_api_ime/no_permissions_platform_app"))
<< message_;
}
+
+IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest,
+ WindowsApiImeWindowNotFullscreen) {
+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
+ command_line->AppendSwitch(switches::kForceAppMode);
+ command_line->AppendSwitchASCII(switches::kAppId,
+ "jkghodnilhceideoidjikpgommlajknk");
+
+ EXPECT_TRUE(RunComponentExtensionTest(
+ "platform_apps/windows_api_ime/forced_app_mode_not_fullscreen"))
+ << message_;
+}
#endif // OS_CHROMEOS
} // namespace extensions