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

Side by Side Diff: extensions/browser/api/system_display/display_info_provider.cc

Issue 598173003: Run clang-modernize -use-nullptr over src/extensions/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "extensions/browser/api/system_display/display_info_provider.h" 5 #include "extensions/browser/api/system_display/display_info_provider.h"
6 6
7 #include "base/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 #include "extensions/common/api/system_display.h" 8 #include "extensions/common/api/system_display.h"
9 #include "ui/gfx/display.h" 9 #include "ui/gfx/display.h"
10 #include "ui/gfx/screen.h" 10 #include "ui/gfx/screen.h"
11 11
12 namespace extensions { 12 namespace extensions {
13 13
14 namespace { 14 namespace {
15 15
16 // Created on demand and will leak when the process exits. 16 // Created on demand and will leak when the process exits.
17 DisplayInfoProvider* g_display_info_provider = NULL; 17 DisplayInfoProvider* g_display_info_provider = nullptr;
18 18
19 // Converts Rotation enum to integer. 19 // Converts Rotation enum to integer.
20 int RotationToDegrees(gfx::Display::Rotation rotation) { 20 int RotationToDegrees(gfx::Display::Rotation rotation) {
21 switch (rotation) { 21 switch (rotation) {
22 case gfx::Display::ROTATE_0: 22 case gfx::Display::ROTATE_0:
23 return 0; 23 return 0;
24 case gfx::Display::ROTATE_90: 24 case gfx::Display::ROTATE_90:
25 return 90; 25 return 90;
26 case gfx::Display::ROTATE_180: 26 case gfx::Display::ROTATE_180:
27 return 180; 27 return 180;
(...skipping 27 matching lines...) Expand all
55 return unit; 55 return unit;
56 } 56 }
57 57
58 } // namespace 58 } // namespace
59 59
60 DisplayInfoProvider::~DisplayInfoProvider() { 60 DisplayInfoProvider::~DisplayInfoProvider() {
61 } 61 }
62 62
63 // static 63 // static
64 DisplayInfoProvider* DisplayInfoProvider::Get() { 64 DisplayInfoProvider* DisplayInfoProvider::Get() {
65 if (g_display_info_provider == NULL) 65 if (g_display_info_provider == nullptr)
66 g_display_info_provider = DisplayInfoProvider::Create(); 66 g_display_info_provider = DisplayInfoProvider::Create();
67 return g_display_info_provider; 67 return g_display_info_provider;
68 } 68 }
69 69
70 // static 70 // static
71 void DisplayInfoProvider::InitializeForTesting( 71 void DisplayInfoProvider::InitializeForTesting(
72 DisplayInfoProvider* display_info_provider) { 72 DisplayInfoProvider* display_info_provider) {
73 DCHECK(display_info_provider); 73 DCHECK(display_info_provider);
74 g_display_info_provider = display_info_provider; 74 g_display_info_provider = display_info_provider;
75 } 75 }
(...skipping 10 matching lines...) Expand all
86 UpdateDisplayUnitInfoForPlatform(displays[i], unit.get()); 86 UpdateDisplayUnitInfoForPlatform(displays[i], unit.get());
87 all_displays.push_back(unit); 87 all_displays.push_back(unit);
88 } 88 }
89 return all_displays; 89 return all_displays;
90 } 90 }
91 91
92 DisplayInfoProvider::DisplayInfoProvider() { 92 DisplayInfoProvider::DisplayInfoProvider() {
93 } 93 }
94 94
95 } // namespace extensions 95 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698