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/browser_plugin/browser_plugin_guest.h" | 5 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 const cc::SurfaceSequence& sequence) { | 420 const cc::SurfaceSequence& sequence) { |
421 has_attached_since_surface_set_ = false; | 421 has_attached_since_surface_set_ = false; |
422 SendMessageToEmbedder(base::MakeUnique<BrowserPluginMsg_SetChildFrameSurface>( | 422 SendMessageToEmbedder(base::MakeUnique<BrowserPluginMsg_SetChildFrameSurface>( |
423 browser_plugin_instance_id(), surface_id, frame_size, scale_factor, | 423 browser_plugin_instance_id(), surface_id, frame_size, scale_factor, |
424 sequence)); | 424 sequence)); |
425 } | 425 } |
426 | 426 |
427 void BrowserPluginGuest::OnSatisfySequence( | 427 void BrowserPluginGuest::OnSatisfySequence( |
428 int instance_id, | 428 int instance_id, |
429 const cc::SurfaceSequence& sequence) { | 429 const cc::SurfaceSequence& sequence) { |
430 std::vector<uint32_t> sequences; | 430 GetSurfaceManager()->SatisfySequence(sequence); |
431 sequences.push_back(sequence.sequence); | |
432 cc::SurfaceManager* manager = GetSurfaceManager(); | |
433 manager->DidSatisfySequences(sequence.frame_sink_id, &sequences); | |
434 } | 431 } |
435 | 432 |
436 void BrowserPluginGuest::OnRequireSequence( | 433 void BrowserPluginGuest::OnRequireSequence( |
437 int instance_id, | 434 int instance_id, |
438 const cc::SurfaceId& id, | 435 const cc::SurfaceId& id, |
439 const cc::SurfaceSequence& sequence) { | 436 const cc::SurfaceSequence& sequence) { |
440 cc::SurfaceManager* manager = GetSurfaceManager(); | 437 GetSurfaceManager()->RequireSequence(id, sequence); |
441 cc::Surface* surface = manager->GetSurfaceForId(id); | |
442 if (!surface) { | |
443 LOG(ERROR) << "Attempting to require callback on nonexistent surface"; | |
444 return; | |
445 } | |
446 surface->AddDestructionDependency(sequence); | |
447 } | 438 } |
448 | 439 |
449 bool BrowserPluginGuest::HandleFindForEmbedder( | 440 bool BrowserPluginGuest::HandleFindForEmbedder( |
450 int request_id, | 441 int request_id, |
451 const base::string16& search_text, | 442 const base::string16& search_text, |
452 const blink::WebFindOptions& options) { | 443 const blink::WebFindOptions& options) { |
453 return delegate_->HandleFindForEmbedder(request_id, search_text, options); | 444 return delegate_->HandleFindForEmbedder(request_id, search_text, options); |
454 } | 445 } |
455 | 446 |
456 bool BrowserPluginGuest::HandleStopFindingForEmbedder(StopFindAction action) { | 447 bool BrowserPluginGuest::HandleStopFindingForEmbedder(StopFindAction action) { |
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1063 range, character_bounds); | 1054 range, character_bounds); |
1064 } | 1055 } |
1065 #endif | 1056 #endif |
1066 | 1057 |
1067 void BrowserPluginGuest::SetContextMenuPosition(const gfx::Point& position) { | 1058 void BrowserPluginGuest::SetContextMenuPosition(const gfx::Point& position) { |
1068 if (delegate_) | 1059 if (delegate_) |
1069 delegate_->SetContextMenuPosition(position); | 1060 delegate_->SetContextMenuPosition(position); |
1070 } | 1061 } |
1071 | 1062 |
1072 } // namespace content | 1063 } // namespace content |
OLD | NEW |