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

Side by Side Diff: chrome/browser/sync/glue/device_info.cc

Issue 50603005: Add cross-platform API to get the form factor of the device (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Applied form factor API to other files Created 7 years, 1 month 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/sync/glue/device_info.h" 5 #include "chrome/browser/sync/glue/device_info.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/threading/sequenced_worker_pool.h" 8 #include "base/threading/sequenced_worker_pool.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/common/chrome_version_info.h" 10 #include "chrome/common/chrome_version_info.h"
11 #include "chrome/common/chrome_switches.h" 11 #include "chrome/common/chrome_switches.h"
12 #include "content/public/browser/browser_thread.h" 12 #include "content/public/browser/browser_thread.h"
13 #include "sync/util/get_session_name.h" 13 #include "sync/util/get_session_name.h"
14 14
15 #if defined(OS_ANDROID)
Alexei Svitkine (slow) 2013/10/31 14:52:32 No need for the ifdef here, just add this include
yao 2013/11/01 14:37:59 Done.
16 #include "chrome/common/device_form_factor.h"
17 #endif
18
15 namespace browser_sync { 19 namespace browser_sync {
16 20
17 namespace { 21 namespace {
18 22
19 #if defined(OS_ANDROID) 23 #if defined(OS_ANDROID)
20 bool IsTabletUI() { 24 bool IsTabletUI() {
21 return CommandLine::ForCurrentProcess()->HasSwitch(switches::kTabletUI); 25 return GetDeviceFormFactor() == DEVICE_FORM_FACTOR_TABLET;
22 } 26 }
23 #endif 27 #endif
24 28
25 // Converts VersionInfo::Channel to string for user-agent string. 29 // Converts VersionInfo::Channel to string for user-agent string.
26 std::string ChannelToString(chrome::VersionInfo::Channel channel) { 30 std::string ChannelToString(chrome::VersionInfo::Channel channel) {
27 switch (channel) { 31 switch (channel) {
28 case chrome::VersionInfo::CHANNEL_UNKNOWN: 32 case chrome::VersionInfo::CHANNEL_UNKNOWN:
29 return "unknown"; 33 return "unknown";
30 case chrome::VersionInfo::CHANNEL_CANARY: 34 case chrome::VersionInfo::CHANNEL_CANARY:
31 return "canary"; 35 return "canary";
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 guid, 238 guid,
235 session_name, 239 session_name,
236 version_info.CreateVersionString(), 240 version_info.CreateVersionString(),
237 MakeUserAgentForSyncApi(version_info), 241 MakeUserAgentForSyncApi(version_info),
238 GetLocalDeviceType()); 242 GetLocalDeviceType());
239 243
240 callback.Run(local_info); 244 callback.Run(local_info);
241 } 245 }
242 246
243 } // namespace browser_sync 247 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698