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

Side by Side Diff: cc/trees/layer_tree_host.cc

Issue 14999010: Allows fullscreen to be triggered with the key events used for scrolling. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 7 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 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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 "cc/trees/layer_tree_host.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <stack> 8 #include <stack>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 proxy_.get(), 485 proxy_.get(),
486 rendering_stats_instrumentation_.get()); 486 rendering_stats_instrumentation_.get());
487 if (settings_.calculate_top_controls_position && 487 if (settings_.calculate_top_controls_position &&
488 host_impl->top_controls_manager()) { 488 host_impl->top_controls_manager()) {
489 top_controls_manager_weak_ptr_ = 489 top_controls_manager_weak_ptr_ =
490 host_impl->top_controls_manager()->AsWeakPtr(); 490 host_impl->top_controls_manager()->AsWeakPtr();
491 } 491 }
492 return host_impl.Pass(); 492 return host_impl.Pass();
493 } 493 }
494 494
495 void LayerTreeHost::ShowTopControls(bool show) {
496 top_controls_manager_weak_ptr_->ScrollBegin();
aelias_OOO_until_Jul13 2013/05/21 05:51:41 This isn't thread-safe. LayerTreeHost functions a
Jinsuk Kim 2013/05/24 09:57:13 Done. Instead of keeping an additional copy I adde
497 gfx::Vector2dF delta(0.f, show ? -settings_.top_controls_height
498 : settings_.top_controls_height);
499 top_controls_manager_weak_ptr_->ScrollBy(delta);
500 top_controls_manager_weak_ptr_->ScrollEnd();
501 }
502
503 float LayerTreeHost::GetTopControlsOffset() {
504 return top_controls_manager_weak_ptr_->controls_top_offset();
aelias_OOO_until_Jul13 2013/05/21 05:51:41 Not thread-safe either. I don't think you really
Jinsuk Kim 2013/05/24 09:57:13 Right. removed.
505 }
506
495 void LayerTreeHost::DidLoseOutputSurface() { 507 void LayerTreeHost::DidLoseOutputSurface() {
496 TRACE_EVENT0("cc", "LayerTreeHost::DidLoseOutputSurface"); 508 TRACE_EVENT0("cc", "LayerTreeHost::DidLoseOutputSurface");
497 DCHECK(proxy_->IsMainThread()); 509 DCHECK(proxy_->IsMainThread());
498 510
499 if (output_surface_lost_) 511 if (output_surface_lost_)
500 return; 512 return;
501 513
502 num_failed_recreate_attempts_ = 0; 514 num_failed_recreate_attempts_ = 0;
503 output_surface_lost_ = true; 515 output_surface_lost_ = true;
504 SetNeedsCommit(); 516 SetNeedsCommit();
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after
1095 bool start_ready_animations = true; 1107 bool start_ready_animations = true;
1096 (*iter).second->UpdateState(start_ready_animations, NULL); 1108 (*iter).second->UpdateState(start_ready_animations, NULL);
1097 } 1109 }
1098 } 1110 }
1099 1111
1100 skia::RefPtr<SkPicture> LayerTreeHost::CapturePicture() { 1112 skia::RefPtr<SkPicture> LayerTreeHost::CapturePicture() {
1101 return proxy_->CapturePicture(); 1113 return proxy_->CapturePicture();
1102 } 1114 }
1103 1115
1104 } // namespace cc 1116 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698