| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/views/tab_contents/native_tab_contents_container_gtk.h" | 5 #include "chrome/browser/views/tab_contents/native_tab_contents_container_gtk.h" |
| 6 | 6 |
| 7 #include "chrome/browser/renderer_host/render_widget_host_view.h" | 7 #include "chrome/browser/renderer_host/render_widget_host_view.h" |
| 8 #include "chrome/browser/tab_contents/interstitial_page.h" | 8 #include "chrome/browser/tab_contents/interstitial_page.h" |
| 9 #include "chrome/browser/tab_contents/tab_contents.h" | 9 #include "chrome/browser/tab_contents/tab_contents.h" |
| 10 #include "chrome/browser/views/tab_contents/tab_contents_container.h" | 10 #include "chrome/browser/views/tab_contents/tab_contents_container.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 // GetRootView()->GetWidget()->GetNativeView()); | 105 // GetRootView()->GetWidget()->GetNativeView()); |
| 106 // if (focus_manager->GetFocusedView() == this) | 106 // if (focus_manager->GetFocusedView() == this) |
| 107 // Focus(); | 107 // Focus(); |
| 108 #endif | 108 #endif |
| 109 } | 109 } |
| 110 | 110 |
| 111 views::View* NativeTabContentsContainerGtk::GetView() { | 111 views::View* NativeTabContentsContainerGtk::GetView() { |
| 112 return this; | 112 return this; |
| 113 } | 113 } |
| 114 | 114 |
| 115 void NativeTabContentsContainerGtk::TabContentsFocused( |
| 116 TabContents* tab_contents) { |
| 117 #if defined(OS_WIN) |
| 118 views::FocusManager* focus_manager = GetFocusManager(); |
| 119 if (!focus_manager) { |
| 120 NOTREACHED(); |
| 121 return; |
| 122 } |
| 123 focus_manager->SetFocusedView(this); |
| 124 #endif |
| 125 } |
| 126 |
| 115 //////////////////////////////////////////////////////////////////////////////// | 127 //////////////////////////////////////////////////////////////////////////////// |
| 116 // NativeTabContentsContainerGtk, views::View overrides: | 128 // NativeTabContentsContainerGtk, views::View overrides: |
| 117 | 129 |
| 118 bool NativeTabContentsContainerGtk::SkipDefaultKeyEventProcessing( | 130 bool NativeTabContentsContainerGtk::SkipDefaultKeyEventProcessing( |
| 119 const views::KeyEvent& e) { | 131 const views::KeyEvent& e) { |
| 120 // Don't look-up accelerators or tab-traverse if we are showing a non-crashed | 132 // Don't look-up accelerators or tab-traverse if we are showing a non-crashed |
| 121 // TabContents. | 133 // TabContents. |
| 122 // We'll first give the page a chance to process the key events. If it does | 134 // We'll first give the page a chance to process the key events. If it does |
| 123 // not process them, they'll be returned to us and we'll treat them as | 135 // not process them, they'll be returned to us and we'll treat them as |
| 124 // accelerators then. | 136 // accelerators then. |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 } | 198 } |
| 187 | 199 |
| 188 //////////////////////////////////////////////////////////////////////////////// | 200 //////////////////////////////////////////////////////////////////////////////// |
| 189 // NativeTabContentsContainer, public: | 201 // NativeTabContentsContainer, public: |
| 190 | 202 |
| 191 // static | 203 // static |
| 192 NativeTabContentsContainer* NativeTabContentsContainer::CreateNativeContainer( | 204 NativeTabContentsContainer* NativeTabContentsContainer::CreateNativeContainer( |
| 193 TabContentsContainer* container) { | 205 TabContentsContainer* container) { |
| 194 return new NativeTabContentsContainerGtk(container); | 206 return new NativeTabContentsContainerGtk(container); |
| 195 } | 207 } |
| OLD | NEW |