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

Side by Side Diff: ui/gfx/android/shared_device_display_info.cc

Issue 1308823002: Move Singleton and related structs to namespace base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ToT Created 5 years, 3 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 | « ui/gfx/android/shared_device_display_info.h ('k') | ui/gfx/font_fallback_win.cc » ('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 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 "ui/gfx/android/shared_device_display_info.h" 5 #include "ui/gfx/android/shared_device_display_info.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_string.h" 8 #include "base/android/jni_string.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "jni/DeviceDisplayInfo_jni.h" 10 #include "jni/DeviceDisplayInfo_jni.h"
(...skipping 14 matching lines...) Expand all
25 jint rotation_degrees) { 25 jint rotation_degrees) {
26 SharedDeviceDisplayInfo::GetInstance()->InvokeUpdate(env, obj, 26 SharedDeviceDisplayInfo::GetInstance()->InvokeUpdate(env, obj,
27 display_height, display_width, 27 display_height, display_width,
28 physical_display_height, physical_display_width, 28 physical_display_height, physical_display_width,
29 bits_per_pixel, bits_per_component, 29 bits_per_pixel, bits_per_component,
30 dip_scale, smallest_dip_width, rotation_degrees); 30 dip_scale, smallest_dip_width, rotation_degrees);
31 } 31 }
32 32
33 // static 33 // static
34 SharedDeviceDisplayInfo* SharedDeviceDisplayInfo::GetInstance() { 34 SharedDeviceDisplayInfo* SharedDeviceDisplayInfo::GetInstance() {
35 return Singleton<SharedDeviceDisplayInfo>::get(); 35 return base::Singleton<SharedDeviceDisplayInfo>::get();
36 } 36 }
37 37
38 int SharedDeviceDisplayInfo::GetDisplayHeight() { 38 int SharedDeviceDisplayInfo::GetDisplayHeight() {
39 base::AutoLock autolock(lock_); 39 base::AutoLock autolock(lock_);
40 DCHECK_NE(0, display_height_); 40 DCHECK_NE(0, display_height_);
41 return display_height_; 41 return display_height_;
42 } 42 }
43 43
44 int SharedDeviceDisplayInfo::GetDisplayWidth() { 44 int SharedDeviceDisplayInfo::GetDisplayWidth() {
45 base::AutoLock autolock(lock_); 45 base::AutoLock autolock(lock_);
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 physical_display_height_ = static_cast<int>(physical_display_height); 154 physical_display_height_ = static_cast<int>(physical_display_height);
155 physical_display_width_ = static_cast<int>(physical_display_width); 155 physical_display_width_ = static_cast<int>(physical_display_width);
156 bits_per_pixel_ = static_cast<int>(bits_per_pixel); 156 bits_per_pixel_ = static_cast<int>(bits_per_pixel);
157 bits_per_component_ = static_cast<int>(bits_per_component); 157 bits_per_component_ = static_cast<int>(bits_per_component);
158 dip_scale_ = static_cast<double>(dip_scale); 158 dip_scale_ = static_cast<double>(dip_scale);
159 smallest_dip_width_ = static_cast<int>(smallest_dip_width); 159 smallest_dip_width_ = static_cast<int>(smallest_dip_width);
160 rotation_degrees_ = static_cast<int>(rotation_degrees); 160 rotation_degrees_ = static_cast<int>(rotation_degrees);
161 } 161 }
162 162
163 } // namespace gfx 163 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/android/shared_device_display_info.h ('k') | ui/gfx/font_fallback_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698