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

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

Issue 1540753002: Switch to standard integer types in ash/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: arraysize Created 5 years 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_layout.h ('k') | ash/display/display_layout_store.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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "ash/display/display_layout.h" 5 #include "ash/display/display_layout.h"
6 6
7 #include "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/display/display_manager.h" 8 #include "ash/display/display_manager.h"
9 #include "ash/display/display_pref_util.h" 9 #include "ash/display/display_pref_util.h"
10 #include "ash/shell.h" 10 #include "ash/shell.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 LOG(ERROR) << "Invalid position value:" << position; 48 LOG(ERROR) << "Invalid position value:" << position;
49 return false; 49 return false;
50 } 50 }
51 51
52 std::string GetStringFromPosition(DisplayLayout::Position position) { 52 std::string GetStringFromPosition(DisplayLayout::Position position) {
53 const PositionToStringMap* map = GetPositionToStringMap(); 53 const PositionToStringMap* map = GetPositionToStringMap();
54 PositionToStringMap::const_iterator iter = map->find(position); 54 PositionToStringMap::const_iterator iter = map->find(position);
55 return iter != map->end() ? iter->second : std::string("unknown"); 55 return iter != map->end() ? iter->second : std::string("unknown");
56 } 56 }
57 57
58 bool GetDisplayIdFromString(const base::StringPiece& position, int64* field) { 58 bool GetDisplayIdFromString(const base::StringPiece& position, int64_t* field) {
59 return base::StringToInt64(position, field); 59 return base::StringToInt64(position, field);
60 } 60 }
61 61
62 } // namespace 62 } // namespace
63 63
64 //////////////////////////////////////////////////////////////////////////////// 64 ////////////////////////////////////////////////////////////////////////////////
65 // DisplayLayout 65 // DisplayLayout
66 66
67 // static 67 // static
68 DisplayLayout DisplayLayout::FromInts(int position, int offsets) { 68 DisplayLayout DisplayLayout::FromInts(int position, int offsets) {
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 159
160 // static 160 // static
161 void DisplayLayout::RegisterJSONConverter( 161 void DisplayLayout::RegisterJSONConverter(
162 base::JSONValueConverter<DisplayLayout>* converter) { 162 base::JSONValueConverter<DisplayLayout>* converter) {
163 converter->RegisterCustomField<Position>( 163 converter->RegisterCustomField<Position>(
164 kPositionKey, &DisplayLayout::position, &GetPositionFromString); 164 kPositionKey, &DisplayLayout::position, &GetPositionFromString);
165 converter->RegisterIntField(kOffsetKey, &DisplayLayout::offset); 165 converter->RegisterIntField(kOffsetKey, &DisplayLayout::offset);
166 converter->RegisterBoolField(kMirroredKey, &DisplayLayout::mirrored); 166 converter->RegisterBoolField(kMirroredKey, &DisplayLayout::mirrored);
167 converter->RegisterBoolField(kDefaultUnifiedKey, 167 converter->RegisterBoolField(kDefaultUnifiedKey,
168 &DisplayLayout::default_unified); 168 &DisplayLayout::default_unified);
169 converter->RegisterCustomField<int64>( 169 converter->RegisterCustomField<int64_t>(
170 kPrimaryIdKey, &DisplayLayout::primary_id, &GetDisplayIdFromString); 170 kPrimaryIdKey, &DisplayLayout::primary_id, &GetDisplayIdFromString);
171 } 171 }
172 172
173 } // namespace ash 173 } // namespace ash
OLDNEW
« no previous file with comments | « ash/display/display_layout.h ('k') | ash/display/display_layout_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698