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

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

Issue 222783004: Move textual replacement to WebContents. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 | Annotate | Revision Log
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 <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 #include "content/browser/renderer_host/render_widget_host_impl.h" 44 #include "content/browser/renderer_host/render_widget_host_impl.h"
45 #include "content/browser/site_instance_impl.h" 45 #include "content/browser/site_instance_impl.h"
46 #include "content/browser/web_contents/web_contents_view_guest.h" 46 #include "content/browser/web_contents/web_contents_view_guest.h"
47 #include "content/browser/webui/generic_handler.h" 47 #include "content/browser/webui/generic_handler.h"
48 #include "content/browser/webui/web_ui_controller_factory_registry.h" 48 #include "content/browser/webui/web_ui_controller_factory_registry.h"
49 #include "content/browser/webui/web_ui_impl.h" 49 #include "content/browser/webui/web_ui_impl.h"
50 #include "content/common/browser_plugin/browser_plugin_constants.h" 50 #include "content/common/browser_plugin/browser_plugin_constants.h"
51 #include "content/common/browser_plugin/browser_plugin_messages.h" 51 #include "content/common/browser_plugin/browser_plugin_messages.h"
52 #include "content/common/frame_messages.h" 52 #include "content/common/frame_messages.h"
53 #include "content/common/image_messages.h" 53 #include "content/common/image_messages.h"
54 #include "content/common/input_messages.h"
54 #include "content/common/ssl_status_serialization.h" 55 #include "content/common/ssl_status_serialization.h"
55 #include "content/common/view_messages.h" 56 #include "content/common/view_messages.h"
56 #include "content/port/browser/render_view_host_delegate_view.h" 57 #include "content/port/browser/render_view_host_delegate_view.h"
57 #include "content/port/browser/render_widget_host_view_port.h" 58 #include "content/port/browser/render_widget_host_view_port.h"
58 #include "content/public/browser/ax_event_notification_details.h" 59 #include "content/public/browser/ax_event_notification_details.h"
59 #include "content/public/browser/browser_context.h" 60 #include "content/public/browser/browser_context.h"
60 #include "content/public/browser/color_chooser.h" 61 #include "content/public/browser/color_chooser.h"
61 #include "content/public/browser/content_browser_client.h" 62 #include "content/public/browser/content_browser_client.h"
62 #include "content/public/browser/devtools_agent_host.h" 63 #include "content/public/browser/devtools_agent_host.h"
63 #include "content/public/browser/download_manager.h" 64 #include "content/public/browser/download_manager.h"
(...skipping 1704 matching lines...) Expand 10 before | Expand all | Expand 10 after
1768 if (site_instance && rvh->GetSiteInstance() != site_instance) { 1769 if (site_instance && rvh->GetSiteInstance() != site_instance) {
1769 NOTREACHED(); 1770 NOTREACHED();
1770 return; 1771 return;
1771 } 1772 }
1772 Send(new ViewMsg_SetHistoryLengthAndPrune(GetRoutingID(), 1773 Send(new ViewMsg_SetHistoryLengthAndPrune(GetRoutingID(),
1773 history_length, 1774 history_length,
1774 minimum_page_id)); 1775 minimum_page_id));
1775 } 1776 }
1776 1777
1777 void WebContentsImpl::ReloadFocusedFrame(bool ignore_cache) { 1778 void WebContentsImpl::ReloadFocusedFrame(bool ignore_cache) {
1778 Send(new FrameMsg_Reload(GetFocusedFrame()->GetRoutingID(), ignore_cache)); 1779 RenderFrameHost* focused_frame = GetFocusedFrame();
1780 if (!focused_frame)
1781 return;
1782
1783 Send(new FrameMsg_Reload(focused_frame->GetRoutingID(), ignore_cache));
1784 }
1785
1786 void WebContentsImpl::Replace(const base::string16& word) {
1787 RenderFrameHost* focused_frame = GetFocusedFrame();
1788 if (!focused_frame)
1789 return;
1790
1791 Send(new InputMsg_Replace(focused_frame->GetRoutingID(), word));
1792 }
1793
1794 void WebContentsImpl::ReplaceMisspelling(const base::string16& word) {
1795 RenderFrameHost* focused_frame = GetFocusedFrame();
1796 if (!focused_frame)
1797 return;
1798
1799 Send(new InputMsg_ReplaceMisspelling(focused_frame->GetRoutingID(), word));
1779 } 1800 }
1780 1801
1781 void WebContentsImpl::FocusThroughTabTraversal(bool reverse) { 1802 void WebContentsImpl::FocusThroughTabTraversal(bool reverse) {
1782 if (ShowingInterstitialPage()) { 1803 if (ShowingInterstitialPage()) {
1783 GetRenderManager()->interstitial_page()->FocusThroughTabTraversal(reverse); 1804 GetRenderManager()->interstitial_page()->FocusThroughTabTraversal(reverse);
1784 return; 1805 return;
1785 } 1806 }
1786 GetRenderViewHostImpl()->SetInitialFocus(reverse); 1807 GetRenderViewHostImpl()->SetInitialFocus(reverse);
1787 } 1808 }
1788 1809
(...skipping 1889 matching lines...) Expand 10 before | Expand all | Expand 10 after
3678 3699
3679 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { 3700 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) {
3680 if (!delegate_) 3701 if (!delegate_)
3681 return; 3702 return;
3682 const gfx::Size new_size = GetPreferredSize(); 3703 const gfx::Size new_size = GetPreferredSize();
3683 if (new_size != old_size) 3704 if (new_size != old_size)
3684 delegate_->UpdatePreferredSize(this, new_size); 3705 delegate_->UpdatePreferredSize(this, new_size);
3685 } 3706 }
3686 3707
3687 } // namespace content 3708 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/public/browser/render_widget_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698