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

Side by Side Diff: ui/base/cursor/ozone/cursor_factory_ozone.cc

Issue 291473002: ozone: Initialize a subsystem only if necessary. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge-r270817 Created 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ui/base/cursor/ozone/cursor_factory_ozone.h" 5 #include "ui/base/cursor/ozone/cursor_factory_ozone.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace ui { 9 namespace ui {
10 10
11 // static 11 // static
12 CursorFactoryOzone* CursorFactoryOzone::impl_ = NULL; 12 CursorFactoryOzone* CursorFactoryOzone::impl_ = NULL;
13 13
14 CursorFactoryOzone::CursorFactoryOzone() {} 14 CursorFactoryOzone::CursorFactoryOzone() {
15 CHECK(!impl_) << "There should only be a single CursorFactoryOzone.";
16 impl_ = this;
17 }
15 18
16 CursorFactoryOzone::~CursorFactoryOzone() {} 19 CursorFactoryOzone::~CursorFactoryOzone() {
20 CHECK_EQ(impl_, this);
21 impl_ = NULL;
22 }
17 23
18 CursorFactoryOzone* CursorFactoryOzone::GetInstance() { 24 CursorFactoryOzone* CursorFactoryOzone::GetInstance() {
19 CHECK(impl_) << "No CursorFactoryOzone implementation set."; 25 CHECK(impl_) << "No CursorFactoryOzone implementation set.";
20 return impl_; 26 return impl_;
21 } 27 }
22 28
23 void CursorFactoryOzone::SetInstance(CursorFactoryOzone* impl) { impl_ = impl; }
24
25 PlatformCursor CursorFactoryOzone::GetDefaultCursor(int type) { 29 PlatformCursor CursorFactoryOzone::GetDefaultCursor(int type) {
26 NOTIMPLEMENTED(); 30 NOTIMPLEMENTED();
27 return NULL; 31 return NULL;
28 } 32 }
29 33
30 PlatformCursor CursorFactoryOzone::CreateImageCursor( 34 PlatformCursor CursorFactoryOzone::CreateImageCursor(
31 const SkBitmap& bitmap, 35 const SkBitmap& bitmap,
32 const gfx::Point& hotspot) { 36 const gfx::Point& hotspot) {
33 NOTIMPLEMENTED(); 37 NOTIMPLEMENTED();
34 return NULL; 38 return NULL;
(...skipping 11 matching lines...) Expand all
46 PlatformCursor cursor) { 50 PlatformCursor cursor) {
47 NOTIMPLEMENTED(); 51 NOTIMPLEMENTED();
48 } 52 }
49 53
50 gfx::AcceleratedWidget CursorFactoryOzone::GetCursorWindow() { 54 gfx::AcceleratedWidget CursorFactoryOzone::GetCursorWindow() {
51 NOTIMPLEMENTED(); 55 NOTIMPLEMENTED();
52 return 0; 56 return 0;
53 } 57 }
54 58
55 } // namespace ui 59 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/cursor/ozone/cursor_factory_ozone.h ('k') | ui/events/ozone/device/udev/device_manager_udev.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698