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

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: Addressed comments Created 7 years, 6 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 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after
1034 1034
1035 SetNeedsCommit(); 1035 SetNeedsCommit();
1036 } 1036 }
1037 1037
1038 void LayerTreeHost::UpdateTopControlsState(TopControlsState constraints, 1038 void LayerTreeHost::UpdateTopControlsState(TopControlsState constraints,
1039 TopControlsState current, 1039 TopControlsState current,
1040 bool animate) { 1040 bool animate) {
1041 if (!settings_.calculate_top_controls_position) 1041 if (!settings_.calculate_top_controls_position)
1042 return; 1042 return;
1043 1043
1044 top_controls_constraints_ = constraints;
1044 // Top controls are only used in threaded mode. 1045 // Top controls are only used in threaded mode.
1045 proxy_->ImplThread()->PostTask( 1046 proxy_->ImplThread()->PostTask(
1046 base::Bind(&TopControlsManager::UpdateTopControlsState, 1047 base::Bind(&TopControlsManager::UpdateTopControlsState,
1047 top_controls_manager_weak_ptr_, 1048 top_controls_manager_weak_ptr_,
1048 constraints, 1049 constraints,
1049 current, 1050 current,
1050 animate)); 1051 animate));
1051 } 1052 }
1052 1053
1054 void LayerTreeHost::UpdateTopControlsStatePreservingConstraints(
1055 bool show) {
1056 if (!settings_.calculate_top_controls_position)
1057 return;
1058 if (GetTopControlsConstraints() < 0) {
1059 LOG(WARNING) << "Called before top controls constraints is set";
aelias_OOO_until_Jul13 2013/06/10 05:11:25 Please remove this log, nobody will ever pay atten
Jinsuk Kim 2013/06/10 05:37:09 Done.
1060 return;
1061 }
1062 proxy_->ImplThread()->PostTask(
aelias_OOO_until_Jul13 2013/06/10 05:11:25 Please call LayerTreeHost::UpdateTopControlsState(
Jinsuk Kim 2013/06/10 05:37:09 Done.
1063 base::Bind(
1064 &TopControlsManager::UpdateTopControlsState,
1065 top_controls_manager_weak_ptr_,
1066 GetTopControlsConstraints(),
1067 show ? cc::SHOWN : cc::HIDDEN,
1068 true));
1069 }
1070
1053 bool LayerTreeHost::BlocksPendingCommit() const { 1071 bool LayerTreeHost::BlocksPendingCommit() const {
1054 if (!root_layer_.get()) 1072 if (!root_layer_.get())
1055 return false; 1073 return false;
1056 return root_layer_->BlocksPendingCommitRecursive(); 1074 return root_layer_->BlocksPendingCommitRecursive();
1057 } 1075 }
1058 1076
1059 scoped_ptr<base::Value> LayerTreeHost::AsValue() const { 1077 scoped_ptr<base::Value> LayerTreeHost::AsValue() const {
1060 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); 1078 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue());
1061 state->Set("proxy", proxy_->AsValue().release()); 1079 state->Set("proxy", proxy_->AsValue().release());
1062 return state.PassAs<base::Value>(); 1080 return state.PassAs<base::Value>();
(...skipping 18 matching lines...) Expand all
1081 bool start_ready_animations = true; 1099 bool start_ready_animations = true;
1082 (*iter).second->UpdateState(start_ready_animations, NULL); 1100 (*iter).second->UpdateState(start_ready_animations, NULL);
1083 } 1101 }
1084 } 1102 }
1085 1103
1086 skia::RefPtr<SkPicture> LayerTreeHost::CapturePicture() { 1104 skia::RefPtr<SkPicture> LayerTreeHost::CapturePicture() {
1087 return proxy_->CapturePicture(); 1105 return proxy_->CapturePicture();
1088 } 1106 }
1089 1107
1090 } // namespace cc 1108 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698