| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/views/tab_contents/native_tab_contents_container_win
.h" | 5 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_container_win
.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/view_ids.h" | 7 #include "chrome/browser/ui/view_ids.h" |
| 8 #include "chrome/browser/ui/views/tab_contents/tab_contents_container.h" | 8 #include "chrome/browser/ui/views/tab_contents/tab_contents_container.h" |
| 9 #include "chrome/browser/ui/views/tab_contents/tab_contents_view_views.h" | 9 #include "chrome/browser/ui/views/tab_contents/tab_contents_view_views.h" |
| 10 #include "content/browser/renderer_host/render_widget_host_view_win.h" | 10 #include "content/browser/renderer_host/render_widget_host_view_win.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 const views::KeyEvent& e) { | 98 const views::KeyEvent& e) { |
| 99 // Don't look-up accelerators or tab-traversal if we are showing a non-crashed | 99 // Don't look-up accelerators or tab-traversal if we are showing a non-crashed |
| 100 // TabContents. | 100 // TabContents. |
| 101 // We'll first give the page a chance to process the key events. If it does | 101 // We'll first give the page a chance to process the key events. If it does |
| 102 // not process them, they'll be returned to us and we'll treat them as | 102 // not process them, they'll be returned to us and we'll treat them as |
| 103 // accelerators then. | 103 // accelerators then. |
| 104 return container_->tab_contents() && | 104 return container_->tab_contents() && |
| 105 !container_->tab_contents()->is_crashed(); | 105 !container_->tab_contents()->is_crashed(); |
| 106 } | 106 } |
| 107 | 107 |
| 108 bool NativeTabContentsContainerWin::IsFocusable() const { | 108 bool NativeTabContentsContainerWin::IsFocusableInRootView() const { |
| 109 // We need to be focusable when our contents is not a view hierarchy, as | 109 // We need to be focusable when our contents is not a view hierarchy, as |
| 110 // clicking on the contents needs to focus us. | 110 // clicking on the contents needs to focus us. |
| 111 return container_->tab_contents() != NULL; | 111 return container_->tab_contents() != NULL; |
| 112 } | 112 } |
| 113 | 113 |
| 114 void NativeTabContentsContainerWin::OnFocus() { | 114 void NativeTabContentsContainerWin::OnFocus() { |
| 115 if (container_->tab_contents()) | 115 if (container_->tab_contents()) |
| 116 container_->tab_contents()->Focus(); | 116 container_->tab_contents()->Focus(); |
| 117 } | 117 } |
| 118 | 118 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 } | 159 } |
| 160 | 160 |
| 161 //////////////////////////////////////////////////////////////////////////////// | 161 //////////////////////////////////////////////////////////////////////////////// |
| 162 // NativeTabContentsContainer, public: | 162 // NativeTabContentsContainer, public: |
| 163 | 163 |
| 164 // static | 164 // static |
| 165 NativeTabContentsContainer* NativeTabContentsContainer::CreateNativeContainer( | 165 NativeTabContentsContainer* NativeTabContentsContainer::CreateNativeContainer( |
| 166 TabContentsContainer* container) { | 166 TabContentsContainer* container) { |
| 167 return new NativeTabContentsContainerWin(container); | 167 return new NativeTabContentsContainerWin(container); |
| 168 } | 168 } |
| OLD | NEW |