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

Side by Side Diff: blimp/client/core/render_widget/blimp_document_manager.cc

Issue 2400923002: Move BlimpInputManager to BlimpDocument from BlimpCompositor. (Closed)
Patch Set: Removed unnecessary DCHECK. 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "blimp/client/core/render_widget/blimp_document_manager.h" 5 #include "blimp/client/core/render_widget/blimp_document_manager.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "blimp/client/core/compositor/blimp_compositor_dependencies.h" 8 #include "blimp/client/core/compositor/blimp_compositor_dependencies.h"
9 #include "blimp/client/core/render_widget/blimp_document.h" 9 #include "blimp/client/core/render_widget/blimp_document.h"
10 #include "cc/proto/compositor_message.pb.h" 10 #include "cc/proto/compositor_message.pb.h"
(...skipping 22 matching lines...) Expand all
33 } 33 }
34 34
35 void BlimpDocumentManager::SetVisible(bool visible) { 35 void BlimpDocumentManager::SetVisible(bool visible) {
36 visible_ = visible; 36 visible_ = visible;
37 if (active_document_) 37 if (active_document_)
38 active_document_->GetCompositor()->SetVisible(visible_); 38 active_document_->GetCompositor()->SetVisible(visible_);
39 } 39 }
40 40
41 bool BlimpDocumentManager::OnTouchEvent(const ui::MotionEvent& motion_event) { 41 bool BlimpDocumentManager::OnTouchEvent(const ui::MotionEvent& motion_event) {
42 if (active_document_) 42 if (active_document_)
43 return active_document_->GetCompositor()->OnTouchEvent(motion_event); 43 return active_document_->OnTouchEvent(motion_event);
44 return false; 44 return false;
45 } 45 }
46 46
47 void BlimpDocumentManager::NotifyWhenDonePendingCommits( 47 void BlimpDocumentManager::NotifyWhenDonePendingCommits(
48 base::Closure callback) { 48 base::Closure callback) {
49 if (!active_document_ || !visible_) { 49 if (!active_document_ || !visible_) {
50 callback.Run(); 50 callback.Run();
51 return; 51 return;
52 } 52 }
53 53
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 127
128 BlimpDocument* BlimpDocumentManager::GetDocument(int document_id) { 128 BlimpDocument* BlimpDocumentManager::GetDocument(int document_id) {
129 DocumentMap::const_iterator it = documents_.find(document_id); 129 DocumentMap::const_iterator it = documents_.find(document_id);
130 if (it == documents_.end()) 130 if (it == documents_.end())
131 return nullptr; 131 return nullptr;
132 return it->second.get(); 132 return it->second.get();
133 } 133 }
134 134
135 } // namespace client 135 } // namespace client
136 } // namespace blimp 136 } // namespace blimp
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698