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

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 1400003003: Move has_focus_ tracking from RenderWidget to RenderView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 2 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/renderer/render_view_impl.h ('k') | content/renderer/render_widget.h » ('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/renderer/render_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after
634 page_id_(-1), 634 page_id_(-1),
635 next_page_id_(params.next_page_id), 635 next_page_id_(params.next_page_id),
636 history_list_offset_(-1), 636 history_list_offset_(-1),
637 history_list_length_(0), 637 history_list_length_(0),
638 frames_in_progress_(0), 638 frames_in_progress_(0),
639 target_url_status_(TARGET_NONE), 639 target_url_status_(TARGET_NONE),
640 uses_temporary_zoom_level_(false), 640 uses_temporary_zoom_level_(false),
641 #if defined(OS_ANDROID) 641 #if defined(OS_ANDROID)
642 top_controls_constraints_(TOP_CONTROLS_STATE_BOTH), 642 top_controls_constraints_(TOP_CONTROLS_STATE_BOTH),
643 #endif 643 #endif
644 has_focus_(false),
644 has_scrolled_focused_editable_node_into_rect_(false), 645 has_scrolled_focused_editable_node_into_rect_(false),
645 main_render_frame_(nullptr), 646 main_render_frame_(nullptr),
646 speech_recognition_dispatcher_(NULL), 647 speech_recognition_dispatcher_(NULL),
647 mouse_lock_dispatcher_(NULL), 648 mouse_lock_dispatcher_(NULL),
648 #if defined(OS_ANDROID) 649 #if defined(OS_ANDROID)
649 expected_content_intent_id_(0), 650 expected_content_intent_id_(0),
650 #endif 651 #endif
651 #if defined(OS_WIN) 652 #if defined(OS_WIN)
652 focused_plugin_id_(-1), 653 focused_plugin_id_(-1),
653 #endif 654 #endif
(...skipping 2413 matching lines...) Expand 10 before | Expand all | Expand 10 after
3067 if (webview()->mainFrame()->isWebLocalFrame()) 3068 if (webview()->mainFrame()->isWebLocalFrame())
3068 return GURL(webview()->mainFrame()->document().url()); 3069 return GURL(webview()->mainFrame()->document().url());
3069 else 3070 else
3070 return GURL("chrome://gpu/RenderViewImpl::CreateGraphicsContext3D"); 3071 return GURL("chrome://gpu/RenderViewImpl::CreateGraphicsContext3D");
3071 } 3072 }
3072 3073
3073 void RenderViewImpl::OnSetFocus(bool enable) { 3074 void RenderViewImpl::OnSetFocus(bool enable) {
3074 // This message must always be received when the main frame is a 3075 // This message must always be received when the main frame is a
3075 // WebLocalFrame. 3076 // WebLocalFrame.
3076 CHECK(webview()->mainFrame()->isWebLocalFrame()); 3077 CHECK(webview()->mainFrame()->isWebLocalFrame());
3078
3079 has_focus_ = enable;
3077 RenderWidget::OnSetFocus(enable); 3080 RenderWidget::OnSetFocus(enable);
3078 3081
3079 #if defined(ENABLE_PLUGINS) 3082 #if defined(ENABLE_PLUGINS)
3080 if (webview() && webview()->isActive()) { 3083 if (webview() && webview()->isActive()) {
3081 // Notify all NPAPI plugins. 3084 // Notify all NPAPI plugins.
3082 std::set<WebPluginDelegateProxy*>::iterator plugin_it; 3085 std::set<WebPluginDelegateProxy*>::iterator plugin_it;
3083 for (plugin_it = plugin_delegates_.begin(); 3086 for (plugin_it = plugin_delegates_.begin();
3084 plugin_it != plugin_delegates_.end(); ++plugin_it) { 3087 plugin_it != plugin_delegates_.end(); ++plugin_it) {
3085 #if defined(OS_MACOSX) 3088 #if defined(OS_MACOSX)
3086 // RenderWidget's call to setFocus can cause the underlying webview's 3089 // RenderWidget's call to setFocus can cause the underlying webview's
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after
3690 std::vector<gfx::Size> sizes; 3693 std::vector<gfx::Size> sizes;
3691 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); 3694 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes);
3692 if (!url.isEmpty()) 3695 if (!url.isEmpty())
3693 urls.push_back( 3696 urls.push_back(
3694 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); 3697 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes));
3695 } 3698 }
3696 SendUpdateFaviconURL(urls); 3699 SendUpdateFaviconURL(urls);
3697 } 3700 }
3698 3701
3699 } // namespace content 3702 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | content/renderer/render_widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698