| 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/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 Loading... |
| 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 2405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3059 | 3060 |
| 3060 GURL RenderViewImpl::GetURLForGraphicsContext3D() { | 3061 GURL RenderViewImpl::GetURLForGraphicsContext3D() { |
| 3061 DCHECK(webview()); | 3062 DCHECK(webview()); |
| 3062 if (webview()->mainFrame()->isWebLocalFrame()) | 3063 if (webview()->mainFrame()->isWebLocalFrame()) |
| 3063 return GURL(webview()->mainFrame()->document().url()); | 3064 return GURL(webview()->mainFrame()->document().url()); |
| 3064 else | 3065 else |
| 3065 return GURL("chrome://gpu/RenderViewImpl::CreateGraphicsContext3D"); | 3066 return GURL("chrome://gpu/RenderViewImpl::CreateGraphicsContext3D"); |
| 3066 } | 3067 } |
| 3067 | 3068 |
| 3068 void RenderViewImpl::OnSetFocus(bool enable) { | 3069 void RenderViewImpl::OnSetFocus(bool enable) { |
| 3070 has_focus_ = enable; |
| 3069 RenderWidget::OnSetFocus(enable); | 3071 RenderWidget::OnSetFocus(enable); |
| 3070 | 3072 |
| 3071 #if defined(ENABLE_PLUGINS) | 3073 #if defined(ENABLE_PLUGINS) |
| 3072 if (webview() && webview()->isActive()) { | 3074 if (webview() && webview()->isActive()) { |
| 3073 // Notify all NPAPI plugins. | 3075 // Notify all NPAPI plugins. |
| 3074 std::set<WebPluginDelegateProxy*>::iterator plugin_it; | 3076 std::set<WebPluginDelegateProxy*>::iterator plugin_it; |
| 3075 for (plugin_it = plugin_delegates_.begin(); | 3077 for (plugin_it = plugin_delegates_.begin(); |
| 3076 plugin_it != plugin_delegates_.end(); ++plugin_it) { | 3078 plugin_it != plugin_delegates_.end(); ++plugin_it) { |
| 3077 #if defined(OS_MACOSX) | 3079 #if defined(OS_MACOSX) |
| 3078 // RenderWidget's call to setFocus can cause the underlying webview's | 3080 // RenderWidget's call to setFocus can cause the underlying webview's |
| (...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3682 std::vector<gfx::Size> sizes; | 3684 std::vector<gfx::Size> sizes; |
| 3683 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 3685 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
| 3684 if (!url.isEmpty()) | 3686 if (!url.isEmpty()) |
| 3685 urls.push_back( | 3687 urls.push_back( |
| 3686 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 3688 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
| 3687 } | 3689 } |
| 3688 SendUpdateFaviconURL(urls); | 3690 SendUpdateFaviconURL(urls); |
| 3689 } | 3691 } |
| 3690 | 3692 |
| 3691 } // namespace content | 3693 } // namespace content |
| OLD | NEW |