Chromium Code Reviews| 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/renderer/render_view.h" | 5 #include "chrome/renderer/render_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 126 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystem.h" | 126 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystem.h" |
| 127 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystemCallback s.h" | 127 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystemCallback s.h" |
| 128 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFindOptions.h" | 128 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFindOptions.h" |
| 129 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFormControlElement .h" | 129 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFormControlElement .h" |
| 130 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFormElement.h" | 130 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFormElement.h" |
| 131 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 131 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
| 132 #include "third_party/WebKit/Source/WebKit/chromium/public/WebGraphicsContext3D. h" | 132 #include "third_party/WebKit/Source/WebKit/chromium/public/WebGraphicsContext3D. h" |
| 133 #include "third_party/WebKit/Source/WebKit/chromium/public/WebHistoryItem.h" | 133 #include "third_party/WebKit/Source/WebKit/chromium/public/WebHistoryItem.h" |
| 134 #include "third_party/WebKit/Source/WebKit/chromium/public/WebImage.h" | 134 #include "third_party/WebKit/Source/WebKit/chromium/public/WebImage.h" |
| 135 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputElement.h" | 135 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputElement.h" |
| 136 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" | |
|
darin (slow to review)
2011/02/17 06:42:32
this include seems unnecessary. it looks like lef
Ken Russell (switch to Gerrit)
2011/02/18 01:05:54
You're right; sorry about that. Removed.
| |
| 136 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNode.h" | 137 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNode.h" |
| 137 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNodeList.h" | 138 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNodeList.h" |
| 138 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPageSerializer.h" | 139 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPageSerializer.h" |
| 139 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPlugin.h" | 140 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPlugin.h" |
| 140 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h" | 141 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h" |
| 141 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginDocument.h" | 142 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginDocument.h" |
| 142 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginParams.h" | 143 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginParams.h" |
| 143 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPoint.h" | 144 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPoint.h" |
| 144 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRange.h" | 145 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRange.h" |
| 145 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRect.h" | 146 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRect.h" |
| (...skipping 5217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5363 } | 5364 } |
| 5364 | 5365 |
| 5365 void RenderView::DidHandleKeyEvent() { | 5366 void RenderView::DidHandleKeyEvent() { |
| 5366 edit_commands_.clear(); | 5367 edit_commands_.clear(); |
| 5367 } | 5368 } |
| 5368 | 5369 |
| 5369 void RenderView::DidHandleMouseEvent(const WebKit::WebMouseEvent& event) { | 5370 void RenderView::DidHandleMouseEvent(const WebKit::WebMouseEvent& event) { |
| 5370 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidHandleMouseEvent(event)); | 5371 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidHandleMouseEvent(event)); |
| 5371 } | 5372 } |
| 5372 | 5373 |
| 5373 #if defined(OS_MACOSX) | |
| 5374 void RenderView::OnWasHidden() { | 5374 void RenderView::OnWasHidden() { |
| 5375 RenderWidget::OnWasHidden(); | 5375 RenderWidget::OnWasHidden(); |
| 5376 | 5376 |
| 5377 if (webview()) { | |
| 5378 webview()->settings()->setMinimumTimerInterval( | |
| 5379 webkit_glue::kBackgroundTabTimerInterval); | |
| 5380 } | |
| 5381 | |
| 5382 #if defined(OS_MACOSX) | |
| 5377 // Inform plugins that their container is no longer visible. | 5383 // Inform plugins that their container is no longer visible. |
| 5378 std::set<WebPluginDelegateProxy*>::iterator plugin_it; | 5384 std::set<WebPluginDelegateProxy*>::iterator plugin_it; |
| 5379 for (plugin_it = plugin_delegates_.begin(); | 5385 for (plugin_it = plugin_delegates_.begin(); |
| 5380 plugin_it != plugin_delegates_.end(); ++plugin_it) { | 5386 plugin_it != plugin_delegates_.end(); ++plugin_it) { |
| 5381 (*plugin_it)->SetContainerVisibility(false); | 5387 (*plugin_it)->SetContainerVisibility(false); |
| 5382 } | 5388 } |
| 5389 #endif // OS_MACOSX | |
| 5383 } | 5390 } |
| 5384 | 5391 |
| 5385 void RenderView::OnWasRestored(bool needs_repainting) { | 5392 void RenderView::OnWasRestored(bool needs_repainting) { |
| 5386 RenderWidget::OnWasRestored(needs_repainting); | 5393 RenderWidget::OnWasRestored(needs_repainting); |
| 5387 | 5394 |
| 5395 if (webview()) { | |
| 5396 webview()->settings()->setMinimumTimerInterval( | |
| 5397 webkit_glue::kForegroundTabTimerInterval); | |
| 5398 } | |
| 5399 | |
| 5400 #if defined(OS_MACOSX) | |
| 5388 // Inform plugins that their container is now visible. | 5401 // Inform plugins that their container is now visible. |
| 5389 std::set<WebPluginDelegateProxy*>::iterator plugin_it; | 5402 std::set<WebPluginDelegateProxy*>::iterator plugin_it; |
| 5390 for (plugin_it = plugin_delegates_.begin(); | 5403 for (plugin_it = plugin_delegates_.begin(); |
| 5391 plugin_it != plugin_delegates_.end(); ++plugin_it) { | 5404 plugin_it != plugin_delegates_.end(); ++plugin_it) { |
| 5392 (*plugin_it)->SetContainerVisibility(true); | 5405 (*plugin_it)->SetContainerVisibility(true); |
| 5393 } | 5406 } |
| 5407 #endif // OS_MACOSX | |
| 5394 } | 5408 } |
| 5395 #endif // OS_MACOSX | |
| 5396 | 5409 |
| 5397 void RenderView::OnSetFocus(bool enable) { | 5410 void RenderView::OnSetFocus(bool enable) { |
| 5398 RenderWidget::OnSetFocus(enable); | 5411 RenderWidget::OnSetFocus(enable); |
| 5399 | 5412 |
| 5400 if (webview() && webview()->isActive()) { | 5413 if (webview() && webview()->isActive()) { |
| 5401 // Notify all NPAPI plugins. | 5414 // Notify all NPAPI plugins. |
| 5402 std::set<WebPluginDelegateProxy*>::iterator plugin_it; | 5415 std::set<WebPluginDelegateProxy*>::iterator plugin_it; |
| 5403 for (plugin_it = plugin_delegates_.begin(); | 5416 for (plugin_it = plugin_delegates_.begin(); |
| 5404 plugin_it != plugin_delegates_.end(); ++plugin_it) { | 5417 plugin_it != plugin_delegates_.end(); ++plugin_it) { |
| 5405 #if defined(OS_MACOSX) | 5418 #if defined(OS_MACOSX) |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5677 } | 5690 } |
| 5678 } | 5691 } |
| 5679 | 5692 |
| 5680 void RenderView::OnContextMenuClosed( | 5693 void RenderView::OnContextMenuClosed( |
| 5681 const webkit_glue::CustomContextMenuContext& custom_context) { | 5694 const webkit_glue::CustomContextMenuContext& custom_context) { |
| 5682 if (custom_context.is_pepper_menu) | 5695 if (custom_context.is_pepper_menu) |
| 5683 pepper_delegate_.OnContextMenuClosed(custom_context); | 5696 pepper_delegate_.OnContextMenuClosed(custom_context); |
| 5684 else | 5697 else |
| 5685 context_menu_node_.reset(); | 5698 context_menu_node_.reset(); |
| 5686 } | 5699 } |
| OLD | NEW |