OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/webui/constrained_web_dialog_delegate_base.h" | 5 #include "chrome/browser/ui/webui/constrained_web_dialog_delegate_base.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 9 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
10 #include "chrome/browser/ui/views/constrained_window_views.h" | 10 #include "chrome/browser/ui/views/constrained_window_views.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 | 47 |
48 virtual ~ConstrainedWebDialogDelegateViews() {} | 48 virtual ~ConstrainedWebDialogDelegateViews() {} |
49 | 49 |
50 // WebDialogWebContentsDelegate interface. | 50 // WebDialogWebContentsDelegate interface. |
51 virtual void CloseContents(WebContents* source) OVERRIDE { | 51 virtual void CloseContents(WebContents* source) OVERRIDE { |
52 window()->CloseConstrainedWindow(); | 52 window()->CloseConstrainedWindow(); |
53 } | 53 } |
54 | 54 |
55 // contents::WebContentsDelegate | 55 // contents::WebContentsDelegate |
56 virtual void HandleKeyboardEvent( | 56 virtual void HandleKeyboardEvent( |
| 57 content::WebContents* source, |
57 const content::NativeWebKeyboardEvent& event) OVERRIDE { | 58 const content::NativeWebKeyboardEvent& event) OVERRIDE { |
58 unhandled_keyboard_event_handler_.HandleKeyboardEvent( | 59 unhandled_keyboard_event_handler_.HandleKeyboardEvent( |
59 event, view_->GetFocusManager()); | 60 event, view_->GetFocusManager()); |
60 } | 61 } |
61 | 62 |
62 private: | 63 private: |
63 // Converts keyboard events on the WebContents to accelerators. | 64 // Converts keyboard events on the WebContents to accelerators. |
64 UnhandledKeyboardEventHandler unhandled_keyboard_event_handler_; | 65 UnhandledKeyboardEventHandler unhandled_keyboard_event_handler_; |
65 | 66 |
66 views::WebView* view_; | 67 views::WebView* view_; |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 WebDialogDelegate* delegate, | 179 WebDialogDelegate* delegate, |
179 WebDialogWebContentsDelegate* tab_delegate, | 180 WebDialogWebContentsDelegate* tab_delegate, |
180 TabContents* container) { | 181 TabContents* container) { |
181 ConstrainedWebDialogDelegateViewViews* constrained_delegate = | 182 ConstrainedWebDialogDelegateViewViews* constrained_delegate = |
182 new ConstrainedWebDialogDelegateViewViews(profile, delegate, tab_delegate)
; | 183 new ConstrainedWebDialogDelegateViewViews(profile, delegate, tab_delegate)
; |
183 ConstrainedWindow* constrained_window = | 184 ConstrainedWindow* constrained_window = |
184 new ConstrainedWindowViews(container, constrained_delegate); | 185 new ConstrainedWindowViews(container, constrained_delegate); |
185 constrained_delegate->set_window(constrained_window); | 186 constrained_delegate->set_window(constrained_window); |
186 return constrained_delegate; | 187 return constrained_delegate; |
187 } | 188 } |
OLD | NEW |