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

Side by Side Diff: ash/display/display_util.cc

Issue 2095193002: clang-format all of //ash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | « ash/display/display_pref_util.h ('k') | ash/display/event_transformation_handler.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 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 "ash/display/display_util.h" 5 #include "ash/display/display_util.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/common/display/display_info.h" 9 #include "ash/common/display/display_info.h"
10 #include "ash/common/system/system_notifier.h" 10 #include "ash/common/system/system_notifier.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 // Private destructor since NotificationDelegate is ref-counted. 55 // Private destructor since NotificationDelegate is ref-counted.
56 ~DisplayErrorNotificationDelegate() override = default; 56 ~DisplayErrorNotificationDelegate() override = default;
57 57
58 DISALLOW_COPY_AND_ASSIGN(DisplayErrorNotificationDelegate); 58 DISALLOW_COPY_AND_ASSIGN(DisplayErrorNotificationDelegate);
59 }; 59 };
60 60
61 // List of value UI Scale values. Scales for 2x are equivalent to 640, 61 // List of value UI Scale values. Scales for 2x are equivalent to 640,
62 // 800, 1024, 1280, 1440, 1600 and 1920 pixel width respectively on 62 // 800, 1024, 1280, 1440, 1600 and 1920 pixel width respectively on
63 // 2560 pixel width 2x density display. Please see crbug.com/233375 63 // 2560 pixel width 2x density display. Please see crbug.com/233375
64 // for the full list of resolutions. 64 // for the full list of resolutions.
65 const float kUIScalesFor2x[] = 65 const float kUIScalesFor2x[] = {0.5f, 0.625f, 0.8f, 1.0f,
66 {0.5f, 0.625f, 0.8f, 1.0f, 1.125f, 1.25f, 1.5f, 2.0f}; 66 1.125f, 1.25f, 1.5f, 2.0f};
67 const float kUIScalesFor1_25x[] = {0.5f, 0.625f, 0.8f, 1.0f, 1.25f }; 67 const float kUIScalesFor1_25x[] = {0.5f, 0.625f, 0.8f, 1.0f, 1.25f};
68 const float kUIScalesFor1280[] = {0.5f, 0.625f, 0.8f, 1.0f, 1.125f }; 68 const float kUIScalesFor1280[] = {0.5f, 0.625f, 0.8f, 1.0f, 1.125f};
69 const float kUIScalesFor1366[] = {0.5f, 0.6f, 0.75f, 1.0f, 1.125f }; 69 const float kUIScalesFor1366[] = {0.5f, 0.6f, 0.75f, 1.0f, 1.125f};
70 70
71 std::vector<float> GetScalesForDisplay(const DisplayMode& native_mode) { 71 std::vector<float> GetScalesForDisplay(const DisplayMode& native_mode) {
72 #define ASSIGN_ARRAY(v, a) v.assign(a, a + arraysize(a)) 72 #define ASSIGN_ARRAY(v, a) v.assign(a, a + arraysize(a))
73 73
74 std::vector<float> ret; 74 std::vector<float> ret;
75 if (native_mode.device_scale_factor == 2.0f) { 75 if (native_mode.device_scale_factor == 2.0f) {
76 ASSIGN_ARRAY(ret, kUIScalesFor2x); 76 ASSIGN_ARRAY(ret, kUIScalesFor2x);
77 return ret; 77 return ret;
78 } else if (native_mode.device_scale_factor == 1.25f) { 78 } else if (native_mode.device_scale_factor == 1.25f) {
79 ASSIGN_ARRAY(ret, kUIScalesFor1_25x); 79 ASSIGN_ARRAY(ret, kUIScalesFor1_25x);
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 message_center::NotificationList::Notifications notifications = 466 message_center::NotificationList::Notifications notifications =
467 message_center::MessageCenter::Get()->GetVisibleNotifications(); 467 message_center::MessageCenter::Get()->GetVisibleNotifications();
468 for (auto const notification : notifications) { 468 for (auto const notification : notifications) {
469 if (notification->id() == kDisplayErrorNotificationId) 469 if (notification->id() == kDisplayErrorNotificationId)
470 return notification->message(); 470 return notification->message();
471 } 471 }
472 return base::string16(); 472 return base::string16();
473 } 473 }
474 474
475 } // namespace ash 475 } // namespace ash
OLDNEW
« no previous file with comments | « ash/display/display_pref_util.h ('k') | ash/display/event_transformation_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698