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

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: Rebased 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 synthetic_move_sent_(false), 442 synthetic_move_sent_(false),
444 cursor_visibility_state_in_renderer_(UNKNOWN), 443 cursor_visibility_state_in_renderer_(UNKNOWN),
445 #if defined(OS_WIN) 444 #if defined(OS_WIN)
446 legacy_render_widget_host_HWND_(nullptr), 445 legacy_render_widget_host_HWND_(nullptr),
447 legacy_window_destroyed_(false), 446 legacy_window_destroyed_(false),
448 virtual_keyboard_requested_(false), 447 virtual_keyboard_requested_(false),
449 #endif 448 #endif
450 has_snapped_to_boundary_(false), 449 has_snapped_to_boundary_(false),
451 is_guest_view_hack_(is_guest_view_hack), 450 is_guest_view_hack_(is_guest_view_hack),
452 set_focus_on_mouse_down_or_key_event_(false), 451 set_focus_on_mouse_down_or_key_event_(false),
453 device_scale_factor_(0.0f), 452 device_scale_factor_(0.0f),
454 disable_input_event_router_for_testing_(false), 453 disable_input_event_router_for_testing_(false),
455 last_active_widget_process_id_(ChildProcessHost::kInvalidUniqueID), 454 last_active_widget_process_id_(ChildProcessHost::kInvalidUniqueID),
456 last_active_widget_routing_id_(MSG_ROUTING_NONE), 455 last_active_widget_routing_id_(MSG_ROUTING_NONE),
457 weak_ptr_factory_(this) { 456 weak_ptr_factory_(this) {
457 ImageTransportFactory* factory = ImageTransportFactory::GetInstance();
458 delegated_frame_host_ = base::MakeUnique<DelegatedFrameHost>(
459 factory->GetContextFactory()->AllocateFrameSinkId(), this);
460
458 if (!is_guest_view_hack_) 461 if (!is_guest_view_hack_)
459 host_->SetView(this); 462 host_->SetView(this);
460 463
461 // Let the page-level input event router know about our surface ID 464 // Let the page-level input event router know about our surface ID
462 // namespace for surface-based hit testing. 465 // namespace for surface-based hit testing.
463 if (host_->delegate() && host_->delegate()->GetInputEventRouter()) { 466 if (host_->delegate() && host_->delegate()->GetInputEventRouter()) {
464 host_->delegate()->GetInputEventRouter()->AddFrameSinkIdOwner( 467 host_->delegate()->GetInputEventRouter()->AddFrameSinkIdOwner(
465 GetFrameSinkId(), this); 468 GetFrameSinkId(), this);
466 } 469 }
467 470
(...skipping 2574 matching lines...) Expand 10 before | Expand all | Expand 10 after
3042 ->GetTextSelection(focused_view) 3045 ->GetTextSelection(focused_view)
3043 ->GetSelectedText(&selected_text)) { 3046 ->GetSelectedText(&selected_text)) {
3044 // Set the CLIPBOARD_TYPE_SELECTION to the ui::Clipboard. 3047 // Set the CLIPBOARD_TYPE_SELECTION to the ui::Clipboard.
3045 ui::ScopedClipboardWriter clipboard_writer(ui::CLIPBOARD_TYPE_SELECTION); 3048 ui::ScopedClipboardWriter clipboard_writer(ui::CLIPBOARD_TYPE_SELECTION);
3046 clipboard_writer.WriteText(selected_text); 3049 clipboard_writer.WriteText(selected_text);
3047 } 3050 }
3048 #endif // defined(USE_X11) && !defined(OS_CHROMEOS) 3051 #endif // defined(USE_X11) && !defined(OS_CHROMEOS)
3049 } 3052 }
3050 3053
3051 } // namespace content 3054 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698