diff options
author | mazda@chromium.org <mazda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-02 03:54:50 +0000 |
---|---|---|
committer | mazda@chromium.org <mazda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-02 03:54:50 +0000 |
commit | d14af52a5523e6ecd71f6173b7254a481852e3c8 (patch) | |
tree | 4342abbb7fbdc1cebcdc91b35c5cba6bb9fb50c2 /chrome/browser/ui/views/keyboard_overlay_delegate.cc | |
parent | 15e123091eaa54a4b20f407a181cdc17532e9364 (diff) | |
download | chromium_src-d14af52a5523e6ecd71f6173b7254a481852e3c8.zip chromium_src-d14af52a5523e6ecd71f6173b7254a481852e3c8.tar.gz chromium_src-d14af52a5523e6ecd71f6173b7254a481852e3c8.tar.bz2 |
Enable to show the keyboard overlay by shortcut key.
BUG=chromium-os:6268
TEST=manually on the netbook
Review URL: http://codereview.chromium.org/5440001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67962 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/views/keyboard_overlay_delegate.cc')
-rw-r--r-- | chrome/browser/ui/views/keyboard_overlay_delegate.cc | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/chrome/browser/ui/views/keyboard_overlay_delegate.cc b/chrome/browser/ui/views/keyboard_overlay_delegate.cc new file mode 100644 index 0000000..5673f02 --- /dev/null +++ b/chrome/browser/ui/views/keyboard_overlay_delegate.cc @@ -0,0 +1,70 @@ +// Copyright (c) 2010 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 "chrome/browser/ui/views/keyboard_overlay_delegate.h" + +#include "app/l10n_util.h" +#include "base/scoped_ptr.h" +#include "chrome/browser/browser_list.h" +#include "chrome/browser/dom_ui/html_dialog_ui.h" +#include "chrome/browser/ui/browser.h" +#include "chrome/common/url_constants.h" +#include "grit/generated_resources.h" + + +void KeyboardOverlayDelegate::ShowDialog(gfx::NativeWindow owning_window) { + Browser* browser = BrowserList::GetLastActive(); + KeyboardOverlayDelegate* delegate = new KeyboardOverlayDelegate( + l10n_util::GetString(IDS_KEYBOARD_OVERLAY_TITLE)); + DCHECK(browser); + browser->BrowserShowHtmlDialog(delegate, owning_window); +} + +KeyboardOverlayDelegate::KeyboardOverlayDelegate( + const std::wstring& title) + : title_(title) { +} + +KeyboardOverlayDelegate::~KeyboardOverlayDelegate() { +} + +bool KeyboardOverlayDelegate::IsDialogModal() const { + return true; +} + +std::wstring KeyboardOverlayDelegate::GetDialogTitle() const { + return title_; +} + +GURL KeyboardOverlayDelegate::GetDialogContentURL() const { + std::string url_string(chrome::kChromeUIKeyboardOverlayURL); + return GURL(url_string); +} + +void KeyboardOverlayDelegate::GetDOMMessageHandlers( + std::vector<DOMMessageHandler*>* handlers) const { +} + +void KeyboardOverlayDelegate::GetDialogSize( + gfx::Size* size) const { + size->SetSize(1170, 483); +} + +std::string KeyboardOverlayDelegate::GetDialogArgs() const { + return "[]"; +} + +void KeyboardOverlayDelegate::OnDialogClosed( + const std::string& json_retval) { + delete this; + return; +} + +void KeyboardOverlayDelegate::OnCloseContents(TabContents* source, + bool* out_close_dialog) { +} + +bool KeyboardOverlayDelegate::ShouldShowDialogTitle() const { + return false; +} |