OLD | NEW |
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/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 2725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2736 return download_id; | 2736 return download_id; |
2737 } | 2737 } |
2738 | 2738 |
2739 bool WebContentsImpl::IsSubframe() const { | 2739 bool WebContentsImpl::IsSubframe() const { |
2740 return is_subframe_; | 2740 return is_subframe_; |
2741 } | 2741 } |
2742 | 2742 |
2743 void WebContentsImpl::Find(int request_id, | 2743 void WebContentsImpl::Find(int request_id, |
2744 const base::string16& search_text, | 2744 const base::string16& search_text, |
2745 const blink::WebFindOptions& options) { | 2745 const blink::WebFindOptions& options) { |
| 2746 // Cowardly refuse to search for no text. |
| 2747 if (search_text.empty()) { |
| 2748 NOTREACHED(); |
| 2749 return; |
| 2750 } |
| 2751 |
2746 // See if a top level browser plugin handles the find request first. | 2752 // See if a top level browser plugin handles the find request first. |
2747 if (browser_plugin_embedder_ && | 2753 if (browser_plugin_embedder_ && |
2748 browser_plugin_embedder_->Find(request_id, search_text, options)) { | 2754 browser_plugin_embedder_->Find(request_id, search_text, options)) { |
2749 return; | 2755 return; |
2750 } | 2756 } |
2751 Send(new ViewMsg_Find(GetRoutingID(), request_id, search_text, options)); | 2757 Send(new ViewMsg_Find(GetRoutingID(), request_id, search_text, options)); |
2752 } | 2758 } |
2753 | 2759 |
2754 void WebContentsImpl::StopFinding(StopFindAction action) { | 2760 void WebContentsImpl::StopFinding(StopFindAction action) { |
2755 // See if a top level browser plugin handles the stop finding request first. | 2761 // See if a top level browser plugin handles the stop finding request first. |
(...skipping 1934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4690 return NULL; | 4696 return NULL; |
4691 } | 4697 } |
4692 | 4698 |
4693 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { | 4699 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { |
4694 force_disable_overscroll_content_ = force_disable; | 4700 force_disable_overscroll_content_ = force_disable; |
4695 if (view_) | 4701 if (view_) |
4696 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); | 4702 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); |
4697 } | 4703 } |
4698 | 4704 |
4699 } // namespace content | 4705 } // namespace content |
OLD | NEW |