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

Side by Side Diff: components/mus/demo/mus_demo.cc

Issue 1921673005: mus: Add PointerWatcher for passively observing mouse and touch events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 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
« no previous file with comments | « components/mus/demo/mus_demo.h ('k') | components/mus/public/cpp/lib/window_tree_client_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "components/mus/demo/mus_demo.h" 5 #include "components/mus/demo/mus_demo.h"
6 6
7 #include "base/time/time.h" 7 #include "base/time/time.h"
8 #include "components/bitmap_uploader/bitmap_uploader.h" 8 #include "components/bitmap_uploader/bitmap_uploader.h"
9 #include "components/mus/public/cpp/window_tree_host_factory.h" 9 #include "components/mus/public/cpp/window_tree_host_factory.h"
10 #include "third_party/skia/include/core/SkCanvas.h" 10 #include "third_party/skia/include/core/SkCanvas.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 timer_.Start(FROM_HERE, base::TimeDelta::FromMilliseconds(kFrameDelay), 83 timer_.Start(FROM_HERE, base::TimeDelta::FromMilliseconds(kFrameDelay),
84 base::Bind(&MusDemo::DrawFrame, base::Unretained(this))); 84 base::Bind(&MusDemo::DrawFrame, base::Unretained(this)));
85 } 85 }
86 86
87 void MusDemo::OnUnembed(mus::Window* root) {} 87 void MusDemo::OnUnembed(mus::Window* root) {}
88 88
89 void MusDemo::OnConnectionLost(mus::WindowTreeConnection* connection) { 89 void MusDemo::OnConnectionLost(mus::WindowTreeConnection* connection) {
90 timer_.Stop(); 90 timer_.Stop();
91 } 91 }
92 92
93 void MusDemo::OnEventObserved(const ui::Event& event) {}
94
93 void MusDemo::SetWindowManagerClient(mus::WindowManagerClient* client) {} 95 void MusDemo::SetWindowManagerClient(mus::WindowManagerClient* client) {}
94 96
95 bool MusDemo::OnWmSetBounds(mus::Window* window, gfx::Rect* bounds) { 97 bool MusDemo::OnWmSetBounds(mus::Window* window, gfx::Rect* bounds) {
96 return true; 98 return true;
97 } 99 }
98 100
99 bool MusDemo::OnWmSetProperty(mus::Window* window, 101 bool MusDemo::OnWmSetProperty(mus::Window* window,
100 const std::string& name, 102 const std::string& name,
101 std::unique_ptr<std::vector<uint8_t>>* new_data) { 103 std::unique_ptr<std::vector<uint8_t>>* new_data) {
102 return true; 104 return true;
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 std::unique_ptr<std::vector<unsigned char>> data( 152 std::unique_ptr<std::vector<unsigned char>> data(
151 new std::vector<unsigned char>(addr, addr + bytes)); 153 new std::vector<unsigned char>(addr, addr + bytes));
152 bitmap_.unlockPixels(); 154 bitmap_.unlockPixels();
153 155
154 // Send frame to MUS via BitmapUploader. 156 // Send frame to MUS via BitmapUploader.
155 uploader_->SetBitmap(bounds.width(), bounds.height(), std::move(data), 157 uploader_->SetBitmap(bounds.width(), bounds.height(), std::move(data),
156 bitmap_uploader::BitmapUploader::BGRA); 158 bitmap_uploader::BitmapUploader::BGRA);
157 } 159 }
158 160
159 } // namespace mus_demo 161 } // namespace mus_demo
OLDNEW
« no previous file with comments | « components/mus/demo/mus_demo.h ('k') | components/mus/public/cpp/lib/window_tree_client_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698