From e7146cef7148efeaa5b22404e1e3f94aec14749f Mon Sep 17 00:00:00 2001 From: "mazda@chromium.org" Date: Thu, 20 Dec 2012 20:21:11 +0000 Subject: Make VKEY_F14 and VKEY_HELP close keyboard overlay. Also add tests to verify that the shortcuts that open the keyboard overlay close it. BUG=chrome-os-partner:16067 Review URL: https://chromiumcodereview.appspot.com/11636037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@174220 0039d316-1c4b-4281-b951-d872f2087c98 --- ui/web_dialogs/test/test_web_contents_handler.cc | 32 +++++++++++++++++++ ui/web_dialogs/test/test_web_contents_handler.h | 40 ++++++++++++++++++++++++ ui/web_dialogs/web_dialogs.gyp | 2 ++ 3 files changed, 74 insertions(+) create mode 100644 ui/web_dialogs/test/test_web_contents_handler.cc create mode 100644 ui/web_dialogs/test/test_web_contents_handler.h (limited to 'ui/web_dialogs') diff --git a/ui/web_dialogs/test/test_web_contents_handler.cc b/ui/web_dialogs/test/test_web_contents_handler.cc new file mode 100644 index 0000000..4b2077d --- /dev/null +++ b/ui/web_dialogs/test/test_web_contents_handler.cc @@ -0,0 +1,32 @@ +// Copyright (c) 2012 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. + +#include "ui/web_dialogs/test/test_web_contents_handler.h" + +namespace ui { +namespace test { + +TestWebContentsHandler::TestWebContentsHandler() { +} + +TestWebContentsHandler::~TestWebContentsHandler() { +} + +content::WebContents* TestWebContentsHandler::OpenURLFromTab( + content::BrowserContext* context, + content::WebContents* source, + const content::OpenURLParams& params) { + return NULL; +} + +void TestWebContentsHandler::AddNewContents(content::BrowserContext* context, + content::WebContents* source, + content::WebContents* new_contents, + WindowOpenDisposition disposition, + const gfx::Rect& initial_pos, + bool user_gesture) { +} + +} // namespace test +} // namespace ui diff --git a/ui/web_dialogs/test/test_web_contents_handler.h b/ui/web_dialogs/test/test_web_contents_handler.h new file mode 100644 index 0000000..abe2c73 --- /dev/null +++ b/ui/web_dialogs/test/test_web_contents_handler.h @@ -0,0 +1,40 @@ +// Copyright (c) 2012 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. + +#ifndef UI_WEB_DIALOGS_TEST_TEST_WEB_CONTENTS_HANDLER_H_ +#define UI_WEB_DIALOGS_TEST_TEST_WEB_CONTENTS_HANDLER_H_ + +#include "base/basictypes.h" +#include "base/compiler_specific.h" +#include "ui/web_dialogs/web_dialog_web_contents_delegate.h" + +namespace ui { +namespace test { + +class TestWebContentsHandler + : public WebDialogWebContentsDelegate::WebContentsHandler { + public: + TestWebContentsHandler(); + virtual ~TestWebContentsHandler(); + + private: + // Overridden from WebDialogWebContentsDelegate::WebContentsHandler: + virtual content::WebContents* OpenURLFromTab( + content::BrowserContext* context, + content::WebContents* source, + const content::OpenURLParams& params) OVERRIDE; + virtual void AddNewContents(content::BrowserContext* context, + content::WebContents* source, + content::WebContents* new_contents, + WindowOpenDisposition disposition, + const gfx::Rect& initial_pos, + bool user_gesture) OVERRIDE; + + DISALLOW_COPY_AND_ASSIGN(TestWebContentsHandler); +}; + +} // namespace test +} // namespace ui + +#endif // UI_WEB_DIALOGS_TEST_TEST_WEB_CONTENTS_HANDLER_H_ diff --git a/ui/web_dialogs/web_dialogs.gyp b/ui/web_dialogs/web_dialogs.gyp index 1ac2562..35cc67b 100644 --- a/ui/web_dialogs/web_dialogs.gyp +++ b/ui/web_dialogs/web_dialogs.gyp @@ -41,6 +41,8 @@ 'web_dialogs', ], 'sources': [ + 'test/test_web_contents_handler.cc', + 'test/test_web_contents_handler.h', 'test/test_web_dialog_delegate.cc', 'test/test_web_dialog_delegate.h', 'test/test_web_dialog_observer.cc', -- cgit v1.1