| 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 "ui/views/controls/webview/webview.h" | 5 #include "ui/views/controls/webview/webview.h" |
| 6 | 6 |
| 7 #include "content/public/browser/browser_context.h" | 7 #include "content/public/browser/browser_context.h" |
| 8 #include "content/public/browser/navigation_controller.h" | 8 #include "content/public/browser/navigation_controller.h" |
| 9 #include "content/public/browser/notification_details.h" | 9 #include "content/public/browser/notification_details.h" |
| 10 #include "content/public/browser/notification_registrar.h" | 10 #include "content/public/browser/notification_registrar.h" |
| 11 #include "content/public/browser/notification_source.h" | 11 #include "content/public/browser/notification_source.h" |
| 12 #include "content/public/browser/notification_types.h" | 12 #include "content/public/browser/notification_types.h" |
| 13 #include "content/public/browser/render_view_host.h" | 13 #include "content/public/browser/render_view_host.h" |
| 14 #include "content/public/browser/render_widget_host_view.h" | 14 #include "content/public/browser/render_widget_host_view.h" |
| 15 #include "ipc/ipc_message.h" | 15 #include "ipc/ipc_message.h" |
| 16 #include "ui/base/accessibility/accessibility_types.h" | 16 #include "ui/base/accessibility/accessibility_types.h" |
| 17 #include "ui/base/accessibility/accessible_view_state.h" | 17 #include "ui/base/accessibility/accessible_view_state.h" |
| 18 #include "ui/base/event.h" |
| 18 #include "ui/views/controls/native/native_view_host.h" | 19 #include "ui/views/controls/native/native_view_host.h" |
| 19 #include "ui/views/focus/focus_manager.h" | 20 #include "ui/views/focus/focus_manager.h" |
| 20 #include "ui/views/views_delegate.h" | 21 #include "ui/views/views_delegate.h" |
| 21 | 22 |
| 22 namespace views { | 23 namespace views { |
| 23 | 24 |
| 24 // static | 25 // static |
| 25 const char WebView::kViewClassName[] = | 26 const char WebView::kViewClassName[] = |
| 26 "ui/views/WebView"; | 27 "ui/views/WebView"; |
| 27 | 28 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 | 93 |
| 93 void WebView::OnBoundsChanged(const gfx::Rect& previous_bounds) { | 94 void WebView::OnBoundsChanged(const gfx::Rect& previous_bounds) { |
| 94 wcv_holder_->SetSize(bounds().size()); | 95 wcv_holder_->SetSize(bounds().size()); |
| 95 } | 96 } |
| 96 | 97 |
| 97 void WebView::ViewHierarchyChanged(bool is_add, View* parent, View* child) { | 98 void WebView::ViewHierarchyChanged(bool is_add, View* parent, View* child) { |
| 98 if (is_add) | 99 if (is_add) |
| 99 AttachWebContents(); | 100 AttachWebContents(); |
| 100 } | 101 } |
| 101 | 102 |
| 102 bool WebView::SkipDefaultKeyEventProcessing(const views::KeyEvent& event) { | 103 bool WebView::SkipDefaultKeyEventProcessing(const ui::KeyEvent& event) { |
| 103 if (allow_accelerators_) | 104 if (allow_accelerators_) |
| 104 return FocusManager::IsTabTraversalKeyEvent(event); | 105 return FocusManager::IsTabTraversalKeyEvent(event); |
| 105 | 106 |
| 106 // Don't look-up accelerators or tab-traversal if we are showing a non-crashed | 107 // Don't look-up accelerators or tab-traversal if we are showing a non-crashed |
| 107 // TabContents. | 108 // TabContents. |
| 108 // We'll first give the page a chance to process the key events. If it does | 109 // We'll first give the page a chance to process the key events. If it does |
| 109 // not process them, they'll be returned to us and we'll treat them as | 110 // not process them, they'll be returned to us and we'll treat them as |
| 110 // accelerators then. | 111 // accelerators then. |
| 111 return web_contents_ && !web_contents_->IsCrashed(); | 112 return web_contents_ && !web_contents_->IsCrashed(); |
| 112 } | 113 } |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 site_instance, | 251 site_instance, |
| 251 MSG_ROUTING_NONE, | 252 MSG_ROUTING_NONE, |
| 252 NULL, | 253 NULL, |
| 253 NULL); | 254 NULL); |
| 254 } | 255 } |
| 255 | 256 |
| 256 return contents; | 257 return contents; |
| 257 } | 258 } |
| 258 | 259 |
| 259 } // namespace views | 260 } // namespace views |
| OLD | NEW |