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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 2383373002: Reduce SurfaceIdAllocator usage and tie SurfaceFactory to a single FrameSinkId (Closed)
Patch Set: Fix TestRenderViewHost + Mac Created 4 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
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/renderer_host/render_widget_host_view_aura.h" 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
6 6
7 #include <set> 7 #include <set>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 DISALLOW_COPY_AND_ASSIGN(WindowAncestorObserver); 423 DISALLOW_COPY_AND_ASSIGN(WindowAncestorObserver);
424 }; 424 };
425 425
426 //////////////////////////////////////////////////////////////////////////////// 426 ////////////////////////////////////////////////////////////////////////////////
427 // RenderWidgetHostViewAura, public: 427 // RenderWidgetHostViewAura, public:
428 428
429 RenderWidgetHostViewAura::RenderWidgetHostViewAura(RenderWidgetHost* host, 429 RenderWidgetHostViewAura::RenderWidgetHostViewAura(RenderWidgetHost* host,
430 bool is_guest_view_hack) 430 bool is_guest_view_hack)
431 : host_(RenderWidgetHostImpl::From(host)), 431 : host_(RenderWidgetHostImpl::From(host)),
432 window_(nullptr), 432 window_(nullptr),
433 delegated_frame_host_(new DelegatedFrameHost(this)),
434 in_shutdown_(false), 433 in_shutdown_(false),
435 in_bounds_changed_(false), 434 in_bounds_changed_(false),
436 is_fullscreen_(false), 435 is_fullscreen_(false),
437 popup_parent_host_view_(nullptr), 436 popup_parent_host_view_(nullptr),
438 popup_child_host_view_(nullptr), 437 popup_child_host_view_(nullptr),
439 is_loading_(false), 438 is_loading_(false),
440 has_composition_text_(false), 439 has_composition_text_(false),
441 accept_return_character_(false), 440 accept_return_character_(false),
442 begin_frame_source_(nullptr), 441 begin_frame_source_(nullptr),
443 needs_begin_frames_(false), 442 needs_begin_frames_(false),
444 needs_flush_input_(false), 443 needs_flush_input_(false),
445 added_frame_observer_(false), 444 added_frame_observer_(false),
446 synthetic_move_sent_(false), 445 synthetic_move_sent_(false),
447 cursor_visibility_state_in_renderer_(UNKNOWN), 446 cursor_visibility_state_in_renderer_(UNKNOWN),
448 #if defined(OS_WIN) 447 #if defined(OS_WIN)
449 legacy_render_widget_host_HWND_(nullptr), 448 legacy_render_widget_host_HWND_(nullptr),
450 legacy_window_destroyed_(false), 449 legacy_window_destroyed_(false),
451 virtual_keyboard_requested_(false), 450 virtual_keyboard_requested_(false),
452 #endif 451 #endif
453 has_snapped_to_boundary_(false), 452 has_snapped_to_boundary_(false),
454 is_guest_view_hack_(is_guest_view_hack), 453 is_guest_view_hack_(is_guest_view_hack),
455 set_focus_on_mouse_down_or_key_event_(false), 454 set_focus_on_mouse_down_or_key_event_(false),
456 device_scale_factor_(0.0f), 455 device_scale_factor_(0.0f),
457 disable_input_event_router_for_testing_(false), 456 disable_input_event_router_for_testing_(false),
458 last_active_widget_process_id_(ChildProcessHost::kInvalidUniqueID), 457 last_active_widget_process_id_(ChildProcessHost::kInvalidUniqueID),
459 last_active_widget_routing_id_(MSG_ROUTING_NONE), 458 last_active_widget_routing_id_(MSG_ROUTING_NONE),
460 weak_ptr_factory_(this) { 459 weak_ptr_factory_(this) {
460 ImageTransportFactory* factory = ImageTransportFactory::GetInstance();
461 delegated_frame_host_ = base::MakeUnique<DelegatedFrameHost>(
462 factory->GetContextFactory()->AllocateFrameSinkId(), this);
463
461 if (!is_guest_view_hack_) 464 if (!is_guest_view_hack_)
462 host_->SetView(this); 465 host_->SetView(this);
463 466
464 // Let the page-level input event router know about our surface ID 467 // Let the page-level input event router know about our surface ID
465 // namespace for surface-based hit testing. 468 // namespace for surface-based hit testing.
466 if (host_->delegate() && host_->delegate()->GetInputEventRouter()) { 469 if (host_->delegate() && host_->delegate()->GetInputEventRouter()) {
467 host_->delegate()->GetInputEventRouter()->AddFrameSinkIdOwner( 470 host_->delegate()->GetInputEventRouter()->AddFrameSinkIdOwner(
468 GetFrameSinkId(), this); 471 GetFrameSinkId(), this);
469 } 472 }
470 473
(...skipping 2592 matching lines...) Expand 10 before | Expand all | Expand 10 after
3063 ->GetTextSelection(focused_view) 3066 ->GetTextSelection(focused_view)
3064 ->GetSelectedText(&selected_text)) { 3067 ->GetSelectedText(&selected_text)) {
3065 // Set the CLIPBOARD_TYPE_SELECTION to the ui::Clipboard. 3068 // Set the CLIPBOARD_TYPE_SELECTION to the ui::Clipboard.
3066 ui::ScopedClipboardWriter clipboard_writer(ui::CLIPBOARD_TYPE_SELECTION); 3069 ui::ScopedClipboardWriter clipboard_writer(ui::CLIPBOARD_TYPE_SELECTION);
3067 clipboard_writer.WriteText(selected_text); 3070 clipboard_writer.WriteText(selected_text);
3068 } 3071 }
3069 #endif // defined(USE_X11) && !defined(OS_CHROMEOS) 3072 #endif // defined(USE_X11) && !defined(OS_CHROMEOS)
3070 } 3073 }
3071 3074
3072 } // namespace content 3075 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698