summaryrefslogtreecommitdiffstats
path: root/chrome/views
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/views')
-rw-r--r--chrome/views/dialog_delegate.cc2
-rw-r--r--chrome/views/dialog_delegate.h2
-rw-r--r--chrome/views/hwnd_view.cc4
-rw-r--r--chrome/views/hwnd_view.h2
-rw-r--r--chrome/views/window_delegate.h2
5 files changed, 9 insertions, 3 deletions
diff --git a/chrome/views/dialog_delegate.cc b/chrome/views/dialog_delegate.cc
index 8c63340..42aaafc 100644
--- a/chrome/views/dialog_delegate.cc
+++ b/chrome/views/dialog_delegate.cc
@@ -18,7 +18,7 @@ int DialogDelegate::GetDefaultDialogButton() const {
return DIALOGBUTTON_NONE;
}
-View* DialogDelegate::GetInitiallyFocusedView() const {
+View* DialogDelegate::GetInitiallyFocusedView() {
// Focus the default button if any.
DialogClientView* dcv = GetDialogClientView();
int default_button = GetDefaultDialogButton();
diff --git a/chrome/views/dialog_delegate.h b/chrome/views/dialog_delegate.h
index a8b72e0f..d077e60 100644
--- a/chrome/views/dialog_delegate.h
+++ b/chrome/views/dialog_delegate.h
@@ -96,7 +96,7 @@ class DialogDelegate : public WindowDelegate {
virtual bool Accept() { return true; }
// Overridden from WindowDelegate:
- virtual View* GetInitiallyFocusedView() const;
+ virtual View* GetInitiallyFocusedView();
// Overridden from WindowDelegate:
virtual ClientView* CreateClientView(Window* window);
diff --git a/chrome/views/hwnd_view.cc b/chrome/views/hwnd_view.cc
index 55786b6..e812a06 100644
--- a/chrome/views/hwnd_view.cc
+++ b/chrome/views/hwnd_view.cc
@@ -171,6 +171,10 @@ void HWNDView::VisibleBoundsInRootChanged() {
UpdateHWNDBounds();
}
+void HWNDView::Focus() {
+ ::SetFocus(hwnd_);
+}
+
void HWNDView::Paint(ChromeCanvas* canvas) {
// The area behind our window is black, so during a fast resize (where our
// content doesn't draw over the full size of our HWND, and the HWND
diff --git a/chrome/views/hwnd_view.h b/chrome/views/hwnd_view.h
index 701d228..ae33d0f 100644
--- a/chrome/views/hwnd_view.h
+++ b/chrome/views/hwnd_view.h
@@ -69,6 +69,8 @@ class HWNDView : public View {
// Notification that our visible bounds relative to the root has changed.
// This updates the bounds of the HWND.
virtual void VisibleBoundsInRootChanged();
+
+ virtual void Focus();
private:
// The hosted window handle.
diff --git a/chrome/views/window_delegate.h b/chrome/views/window_delegate.h
index d10dbf6..4c496bb 100644
--- a/chrome/views/window_delegate.h
+++ b/chrome/views/window_delegate.h
@@ -80,7 +80,7 @@ class WindowDelegate {
// Returns the view that should have the focus when the dialog is opened. If
// NULL no view is focused.
- virtual View* GetInitiallyFocusedView() const { return NULL; }
+ virtual View* GetInitiallyFocusedView() { return NULL; }
// Returns true if the window should show a title in the title bar.
virtual bool ShouldShowWindowTitle() const {