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

Issue 50603005: Add cross-platform API to get the form factor of the device (Closed)

Created:
7 years, 1 month ago by yao
Modified:
7 years, 1 month ago
CC:
chromium-reviews, Yaron
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Add cross-platform API to get the form factor of the device This API returns whether the device is a phone or a tablet for Android and iOS (for other platforms, it always returns the device as being desktop). The new API is placed in //ui rather than //chrome in order to make it accessible to components. BUG=312903 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=233697

Patch Set 1 #

Total comments: 12

Patch Set 2 : renamed files & variables, formatting change, added gypi exclusion of _desktop.cc #

Total comments: 5

Patch Set 3 : Applied form factor API to other files #

Total comments: 12

Patch Set 4 : relocate form_factor* files and update corresponding changes #

Patch Set 5 : remove kTabletUI from chrome/common #

Total comments: 6

Patch Set 6 : make functions under namespace ui #

Total comments: 12

Patch Set 7 : small formatting changes #

Total comments: 4

Patch Set 8 : small formatting changes #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+103 lines, -18 lines) Patch
M chrome/browser/sync/glue/device_info.cc View 1 2 3 4 5 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/ui/webui/ntp/android/ntp_resource_cache_android.cc View 1 2 3 4 5 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/web_resource/notification_promo.cc View 1 2 3 4 5 6 2 chunks +8 lines, -12 lines 3 comments Download
M chrome/common/chrome_switches.h View 1 2 3 4 1 chunk +0 lines, -1 line 0 comments Download
M chrome/common/chrome_switches.cc View 1 2 3 4 1 chunk +0 lines, -3 lines 0 comments Download
A ui/base/device_form_factor.h View 1 2 3 4 5 6 7 1 chunk +24 lines, -0 lines 0 comments Download
A ui/base/device_form_factor_android.cc View 1 2 3 4 5 6 7 1 chunk +18 lines, -0 lines 0 comments Download
A ui/base/device_form_factor_desktop.cc View 1 2 3 4 5 6 7 1 chunk +13 lines, -0 lines 0 comments Download
A ui/base/device_form_factor_ios.mm View 1 2 3 4 5 6 7 1 chunk +18 lines, -0 lines 2 comments Download
M ui/base/ui_base_switches.h View 1 2 3 4 5 1 chunk +4 lines, -0 lines 0 comments Download
M ui/base/ui_base_switches.cc View 1 2 3 4 5 6 7 1 chunk +5 lines, -0 lines 0 comments Download
M ui/ui.gyp View 1 2 3 2 chunks +9 lines, -0 lines 0 comments Download

Messages

Total messages: 32 (0 generated)
yao
7 years, 1 month ago (2013-10-29 15:12:43 UTC) #1
Alexei Svitkine (slow)
Looks good. Can you file a new bug at http://crbug.com to track this work and ...
7 years, 1 month ago (2013-10-29 15:26:21 UTC) #2
yao
Please help me to test with the trybot, cause I don't have the right to ...
7 years, 1 month ago (2013-10-29 19:21:57 UTC) #3
Alexei Svitkine (slow)
I sent some try jobs and they look green (yay). Here's some comments below. There's ...
7 years, 1 month ago (2013-10-29 20:25:05 UTC) #4
yao
https://codereview.chromium.org/50603005/diff/80001/chrome/common/device_form_factor.h File chrome/common/device_form_factor.h (right): https://codereview.chromium.org/50603005/diff/80001/chrome/common/device_form_factor.h#newcode10 chrome/common/device_form_factor.h:10: Device_Form_Factor_PHONE = 1, On 2013/10/29 20:25:05, Alexei Svitkine wrote: ...
7 years, 1 month ago (2013-10-29 22:44:12 UTC) #5
Alexei Svitkine (slow)
Some more comments. Per the discussion on the other thread, the API will have to ...
7 years, 1 month ago (2013-10-31 14:52:31 UTC) #6
yao
Could anyone help me to send the trybots? I don't have the permission to do ...
7 years, 1 month ago (2013-11-01 14:37:59 UTC) #7
Alexei Svitkine (slow)
Looks very good, I think we're almost ready to send this out for OWNERS review, ...
7 years, 1 month ago (2013-11-01 18:48:26 UTC) #8
yao
https://codereview.chromium.org/50603005/diff/310002/ui/base/device_form_factor.h File ui/base/device_form_factor.h (right): https://codereview.chromium.org/50603005/diff/310002/ui/base/device_form_factor.h#newcode7 ui/base/device_form_factor.h:7: On 2013/11/01 18:48:27, Alexei Svitkine wrote: > Add "namespace ...
7 years, 1 month ago (2013-11-04 15:56:19 UTC) #9
Alexei Svitkine (slow)
Couple more comments. https://codereview.chromium.org/50603005/diff/150001/chrome/common/device_form_factor_desktop.cc File chrome/common/device_form_factor_desktop.cc (left): https://codereview.chromium.org/50603005/diff/150001/chrome/common/device_form_factor_desktop.cc#oldcode5 chrome/common/device_form_factor_desktop.cc:5: #import "ui/base/cocoa/flipped_view.h" On 2013/10/31 14:52:32, Alexei ...
7 years, 1 month ago (2013-11-04 16:08:51 UTC) #10
yao
https://codereview.chromium.org/50603005/diff/490001/chrome/browser/web_resource/notification_promo.cc File chrome/browser/web_resource/notification_promo.cc (right): https://codereview.chromium.org/50603005/diff/490001/chrome/browser/web_resource/notification_promo.cc#newcode70 chrome/browser/web_resource/notification_promo.cc:70: #elif defined(OS_ANDROID) On 2013/11/04 16:08:51, Alexei Svitkine wrote: > ...
7 years, 1 month ago (2013-11-04 19:38:28 UTC) #11
Alexei Svitkine (slow)
LGTM with a few final nits. Now, you should add some OWNERS for the directories ...
7 years, 1 month ago (2013-11-04 19:44:31 UTC) #12
yao
We are adding an API that returns the form factor (phone, table or desktop) of ...
7 years, 1 month ago (2013-11-04 20:23:26 UTC) #13
achuithb
Ruslan should review notification_promo.cc
7 years, 1 month ago (2013-11-04 20:54:51 UTC) #14
aruslan
notification_promo.cc LGTM, thanks!
7 years, 1 month ago (2013-11-04 20:59:38 UTC) #15
Ted C
On 2013/11/04 20:59:38, aruslan wrote: > notification_promo.cc LGTM, thanks! ntp_resource_cache_android.cc lgtm
7 years, 1 month ago (2013-11-04 21:17:22 UTC) #16
Yaron
+blundell who had a recent thread on this for chrome on ios needs. He should ...
7 years, 1 month ago (2013-11-04 21:25:14 UTC) #17
sky
LGTM
7 years, 1 month ago (2013-11-04 21:45:53 UTC) #18
blundell
LGTM with satisfactory resolution to the question I've posed to noyau@ (note that if the ...
7 years, 1 month ago (2013-11-05 15:03:56 UTC) #19
blundell
rsesek: noyau@ says that you would know whether the change to notification_promo is safe (note ...
7 years, 1 month ago (2013-11-05 15:31:51 UTC) #20
noyau (Ping after 24h)
https://codereview.chromium.org/50603005/diff/970001/chrome/browser/web_resource/notification_promo.cc File chrome/browser/web_resource/notification_promo.cc (right): https://codereview.chromium.org/50603005/diff/970001/chrome/browser/web_resource/notification_promo.cc#newcode65 chrome/browser/web_resource/notification_promo.cc:65: ui::DeviceFormFactor form_factor = ui::GetDeviceFormFactor(); On 2013/11/05 15:03:57, blundell wrote: ...
7 years, 1 month ago (2013-11-05 15:48:02 UTC) #21
Alexei Svitkine (slow)
https://codereview.chromium.org/50603005/diff/970001/ui/base/device_form_factor_ios.mm File ui/base/device_form_factor_ios.mm (right): https://codereview.chromium.org/50603005/diff/970001/ui/base/device_form_factor_ios.mm#newcode12 ui/base/device_form_factor_ios.mm:12: UIUserInterfaceIdiom idiom = [[UIDevice currentDevice] userInterfaceIdiom]; On 2013/11/05 15:48:03, ...
7 years, 1 month ago (2013-11-05 16:27:28 UTC) #22
blundell
On 2013/11/05 16:27:28, Alexei Svitkine wrote: > https://codereview.chromium.org/50603005/diff/970001/ui/base/device_form_factor_ios.mm > File ui/base/device_form_factor_ios.mm (right): > > https://codereview.chromium.org/50603005/diff/970001/ui/base/device_form_factor_ios.mm#newcode12 ...
7 years, 1 month ago (2013-11-05 16:28:11 UTC) #23
aruslan
https://codereview.chromium.org/50603005/diff/970001/chrome/browser/web_resource/notification_promo.cc File chrome/browser/web_resource/notification_promo.cc (right): https://codereview.chromium.org/50603005/diff/970001/chrome/browser/web_resource/notification_promo.cc#newcode65 chrome/browser/web_resource/notification_promo.cc:65: ui::DeviceFormFactor form_factor = ui::GetDeviceFormFactor(); On 2013/11/05 15:48:03, noyau wrote: ...
7 years, 1 month ago (2013-11-05 16:35:36 UTC) #24
noyau1
On Tue, Nov 5, 2013 at 5:35 PM, <aruslan@chromium.org> wrote: > [...] > noyau@ -- ...
7 years, 1 month ago (2013-11-05 16:51:54 UTC) #25
blundell
LGTM
7 years, 1 month ago (2013-11-05 16:53:13 UTC) #26
Robert Sesek
On 2013/11/05 16:35:36, aruslan wrote: > https://codereview.chromium.org/50603005/diff/970001/chrome/browser/web_resource/notification_promo.cc > File chrome/browser/web_resource/notification_promo.cc (right): > > https://codereview.chromium.org/50603005/diff/970001/chrome/browser/web_resource/notification_promo.cc#newcode65 > ...
7 years, 1 month ago (2013-11-05 17:48:28 UTC) #27
blundell
On 2013/11/05 17:48:28, rsesek wrote: > On 2013/11/05 16:35:36, aruslan wrote: > > > https://codereview.chromium.org/50603005/diff/970001/chrome/browser/web_resource/notification_promo.cc ...
7 years, 1 month ago (2013-11-05 21:04:08 UTC) #28
Robert Sesek
On 2013/11/05 21:04:08, blundell wrote: > On 2013/11/05 17:48:28, rsesek wrote: > > On 2013/11/05 ...
7 years, 1 month ago (2013-11-05 21:08:46 UTC) #29
tim (not reviewing)
On 2013/11/05 21:08:46, rsesek wrote: > On 2013/11/05 21:04:08, blundell wrote: > > On 2013/11/05 ...
7 years, 1 month ago (2013-11-06 21:41:53 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/yiyaoliu@chromium.org/50603005/970001
7 years, 1 month ago (2013-11-07 18:52:19 UTC) #31
commit-bot: I haz the power
7 years, 1 month ago (2013-11-07 21:52:12 UTC) #32
Message was sent while issue was closed.
Change committed as 233697

Powered by Google App Engine
This is Rietveld 408576698