| 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/extensions/extension_view.h" | 5 #include "chrome/browser/ui/views/extensions/extension_view.h" |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/extension_host.h" | 7 #include "chrome/browser/extensions/extension_host.h" |
| 8 #include "chrome/browser/renderer_host/render_view_host.h" | 8 #include "chrome/browser/renderer_host/render_view_host.h" |
| 9 #include "chrome/browser/renderer_host/render_widget_host_view.h" | 9 #include "chrome/browser/renderer_host/render_widget_host_view.h" |
| 10 #include "chrome/browser/ui/views/extensions/extension_popup.h" | 10 #include "chrome/browser/ui/views/extensions/extension_popup.h" |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 | 170 |
| 171 void ExtensionView::PreferredSizeChanged() { | 171 void ExtensionView::PreferredSizeChanged() { |
| 172 View::PreferredSizeChanged(); | 172 View::PreferredSizeChanged(); |
| 173 if (container_) | 173 if (container_) |
| 174 container_->OnExtensionPreferredSizeChanged(this); | 174 container_->OnExtensionPreferredSizeChanged(this); |
| 175 } | 175 } |
| 176 | 176 |
| 177 bool ExtensionView::SkipDefaultKeyEventProcessing(const views::KeyEvent& e) { | 177 bool ExtensionView::SkipDefaultKeyEventProcessing(const views::KeyEvent& e) { |
| 178 // Let the tab key event be processed by the renderer (instead of moving the | 178 // Let the tab key event be processed by the renderer (instead of moving the |
| 179 // focus to the next focusable view). | 179 // focus to the next focusable view). |
| 180 return (e.GetKeyCode() == ui::VKEY_TAB); | 180 return (e.key_code() == ui::VKEY_TAB); |
| 181 } | 181 } |
| 182 | 182 |
| 183 void ExtensionView::HandleMouseMove() { | 183 void ExtensionView::HandleMouseMove() { |
| 184 if (container_) | 184 if (container_) |
| 185 container_->OnExtensionMouseMove(this); | 185 container_->OnExtensionMouseMove(this); |
| 186 } | 186 } |
| 187 | 187 |
| 188 void ExtensionView::HandleMouseLeave() { | 188 void ExtensionView::HandleMouseLeave() { |
| 189 if (container_) | 189 if (container_) |
| 190 container_->OnExtensionMouseLeave(this); | 190 container_->OnExtensionMouseLeave(this); |
| 191 } | 191 } |
| 192 | 192 |
| 193 void ExtensionView::RenderViewCreated() { | 193 void ExtensionView::RenderViewCreated() { |
| 194 if (!pending_background_.empty() && render_view_host()->view()) { | 194 if (!pending_background_.empty() && render_view_host()->view()) { |
| 195 render_view_host()->view()->SetBackground(pending_background_); | 195 render_view_host()->view()->SetBackground(pending_background_); |
| 196 pending_background_.reset(); | 196 pending_background_.reset(); |
| 197 } | 197 } |
| 198 | 198 |
| 199 // Tell the renderer not to draw scroll bars in popups unless the | 199 // Tell the renderer not to draw scroll bars in popups unless the |
| 200 // popups are at the maximum allowed size. | 200 // popups are at the maximum allowed size. |
| 201 gfx::Size largest_popup_size(ExtensionPopup::kMaxWidth, | 201 gfx::Size largest_popup_size(ExtensionPopup::kMaxWidth, |
| 202 ExtensionPopup::kMaxHeight); | 202 ExtensionPopup::kMaxHeight); |
| 203 host_->DisableScrollbarsForSmallWindows(largest_popup_size); | 203 host_->DisableScrollbarsForSmallWindows(largest_popup_size); |
| 204 } | 204 } |
| OLD | NEW |