Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(161)

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 2775553002: Adds the ability for WebContentsDelegate to decide if event should be updated (Closed)
Patch Set: Fix compile Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/public/browser/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "content/browser/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <cmath> 9 #include <cmath>
10 #include <utility> 10 #include <utility>
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 #include "content/public/browser/ax_event_notification_details.h" 93 #include "content/public/browser/ax_event_notification_details.h"
94 #include "content/public/browser/browser_context.h" 94 #include "content/public/browser/browser_context.h"
95 #include "content/public/browser/browser_plugin_guest_manager.h" 95 #include "content/public/browser/browser_plugin_guest_manager.h"
96 #include "content/public/browser/content_browser_client.h" 96 #include "content/public/browser/content_browser_client.h"
97 #include "content/public/browser/download_manager.h" 97 #include "content/public/browser/download_manager.h"
98 #include "content/public/browser/download_url_parameters.h" 98 #include "content/public/browser/download_url_parameters.h"
99 #include "content/public/browser/focused_node_details.h" 99 #include "content/public/browser/focused_node_details.h"
100 #include "content/public/browser/guest_mode.h" 100 #include "content/public/browser/guest_mode.h"
101 #include "content/public/browser/invalidate_type.h" 101 #include "content/public/browser/invalidate_type.h"
102 #include "content/public/browser/javascript_dialog_manager.h" 102 #include "content/public/browser/javascript_dialog_manager.h"
103 #include "content/public/browser/keyboard_event_processing_result.h"
103 #include "content/public/browser/load_notification_details.h" 104 #include "content/public/browser/load_notification_details.h"
104 #include "content/public/browser/navigation_details.h" 105 #include "content/public/browser/navigation_details.h"
105 #include "content/public/browser/notification_details.h" 106 #include "content/public/browser/notification_details.h"
106 #include "content/public/browser/notification_service.h" 107 #include "content/public/browser/notification_service.h"
107 #include "content/public/browser/notification_types.h" 108 #include "content/public/browser/notification_types.h"
108 #include "content/public/browser/render_widget_host_iterator.h" 109 #include "content/public/browser/render_widget_host_iterator.h"
109 #include "content/public/browser/resource_request_details.h" 110 #include "content/public/browser/resource_request_details.h"
110 #include "content/public/browser/security_style_explanations.h" 111 #include "content/public/browser/security_style_explanations.h"
111 #include "content/public/browser/ssl_status.h" 112 #include "content/public/browser/ssl_status.h"
112 #include "content/public/browser/storage_partition.h" 113 #include "content/public/browser/storage_partition.h"
(...skipping 1648 matching lines...) Expand 10 before | Expand all | Expand 10 after
1761 1762
1762 for (auto& observer : observers_) 1763 for (auto& observer : observers_)
1763 observer.MainFrameWasResized(width_changed); 1764 observer.MainFrameWasResized(width_changed);
1764 } 1765 }
1765 1766
1766 void WebContentsImpl::ScreenInfoChanged() { 1767 void WebContentsImpl::ScreenInfoChanged() {
1767 if (browser_plugin_embedder_) 1768 if (browser_plugin_embedder_)
1768 browser_plugin_embedder_->ScreenInfoChanged(); 1769 browser_plugin_embedder_->ScreenInfoChanged();
1769 } 1770 }
1770 1771
1771 bool WebContentsImpl::PreHandleKeyboardEvent( 1772 KeyboardEventProcessingResult WebContentsImpl::PreHandleKeyboardEvent(
1772 const NativeWebKeyboardEvent& event, 1773 const NativeWebKeyboardEvent& event) {
1773 bool* is_keyboard_shortcut) { 1774 return delegate_ ? delegate_->PreHandleKeyboardEvent(this, event)
1774 return delegate_ && 1775 : KeyboardEventProcessingResult::NOT_HANDLED;
1775 delegate_->PreHandleKeyboardEvent(this, event, is_keyboard_shortcut);
1776 } 1776 }
1777 1777
1778 void WebContentsImpl::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) { 1778 void WebContentsImpl::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) {
1779 if (browser_plugin_embedder_ && 1779 if (browser_plugin_embedder_ &&
1780 browser_plugin_embedder_->HandleKeyboardEvent(event)) { 1780 browser_plugin_embedder_->HandleKeyboardEvent(event)) {
1781 return; 1781 return;
1782 } 1782 }
1783 if (delegate_) 1783 if (delegate_)
1784 delegate_->HandleKeyboardEvent(this, event); 1784 delegate_->HandleKeyboardEvent(this, event);
1785 } 1785 }
(...skipping 3607 matching lines...) Expand 10 before | Expand all | Expand 10 after
5393 RenderViewHost* render_view_host = RenderViewHost::From(render_widget_host); 5393 RenderViewHost* render_view_host = RenderViewHost::From(render_widget_host);
5394 if (!render_view_host) 5394 if (!render_view_host)
5395 continue; 5395 continue;
5396 render_view_host_set.insert(render_view_host); 5396 render_view_host_set.insert(render_view_host);
5397 } 5397 }
5398 for (RenderViewHost* render_view_host : render_view_host_set) 5398 for (RenderViewHost* render_view_host : render_view_host_set)
5399 render_view_host->OnWebkitPreferencesChanged(); 5399 render_view_host->OnWebkitPreferencesChanged();
5400 } 5400 }
5401 5401
5402 } // namespace content 5402 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/public/browser/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698