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

Issue 156493004: Add the ability to show a demo app on OOBE if a machine is derelict. (Closed)

Created:
6 years, 10 months ago by rkc
Modified:
6 years, 10 months ago
CC:
chromium-reviews, extensions-reviews_chromium.org, nkostylev+watch_chromium.org, arv+watch_chromium.org, oshima+watch_chromium.org, chromium-apps-reviews_chromium.org, stevenjb+watch_chromium.org, davemoore+watch_chromium.org
Visibility:
Public.

Description

Add the ability to show a demo app on OOBE if a machine is derelict. If a machine has been idle for 8 hours+, we should start showing a demo app everytime the machine is idle for 5 minutes. This CL depends on https://chrome-internal-review.googlesource.com/#/c/154276/ R=xiyuan@chromium.org, zelidrag@chromium.org BUG=336585 TEST=Use the derelict-* flags to test demo mode app launching. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=250666

Patch Set 1 #

Total comments: 18

Patch Set 2 : #

Total comments: 2

Patch Set 3 : #

Patch Set 4 : add mock method #

Patch Set 5 : #

Total comments: 26

Patch Set 6 : #

Patch Set 7 : #

Total comments: 6

Patch Set 8 : Fixed the mock authenticator. #

Total comments: 2

Patch Set 9 : #

Patch Set 10 : #

Total comments: 103
Unified diffs Side-by-side diffs Delta from patch set Stats (+388 lines, -24 lines) Patch
M chrome/browser/browser_resources.grd View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/chromeos/app_mode/kiosk_profile_loader.h View 1 2 3 4 5 6 2 chunks +3 lines, -4 lines 6 comments Download
M chrome/browser/chromeos/app_mode/kiosk_profile_loader.cc View 1 2 3 4 5 6 2 chunks +6 lines, -10 lines 0 comments Download
A chrome/browser/chromeos/idle_detector.h View 1 2 3 4 5 1 chunk +42 lines, -0 lines 9 comments Download
A chrome/browser/chromeos/idle_detector.cc View 1 2 3 4 5 1 chunk +45 lines, -0 lines 10 comments Download
M chrome/browser/chromeos/login/app_launch_controller.cc View 1 2 3 4 5 6 1 chunk +4 lines, -1 line 2 comments Download
M chrome/browser/chromeos/login/authenticator.h View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -1 line 4 comments Download
A chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h View 1 2 3 4 5 6 1 chunk +38 lines, -0 lines 9 comments Download
A chrome/browser/chromeos/login/demo_mode/demo_app_launcher.cc View 1 2 3 4 5 6 7 8 1 chunk +76 lines, -0 lines 18 comments Download
M chrome/browser/chromeos/login/login_display_host.h View 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/login/login_display_host_impl.h View 3 chunks +5 lines, -0 lines 2 comments Download
M chrome/browser/chromeos/login/login_display_host_impl.cc View 1 chunk +8 lines, -0 lines 2 comments Download
M chrome/browser/chromeos/login/login_performer.h View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 2 comments Download
M chrome/browser/chromeos/login/login_performer.cc View 1 2 3 4 5 6 1 chunk +3 lines, -2 lines 2 comments Download
M chrome/browser/chromeos/login/mock_authenticator.h View 1 2 3 4 5 6 7 1 chunk +2 lines, -1 line 2 comments Download
M chrome/browser/chromeos/login/mock_authenticator.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 2 comments Download
M chrome/browser/chromeos/login/mock_login_display_host.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/chromeos/login/parallel_authenticator.h View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 4 comments Download
M chrome/browser/chromeos/login/parallel_authenticator.cc View 1 2 3 4 5 6 2 chunks +3 lines, -2 lines 4 comments Download
M chrome/browser/prefs/browser_prefs.cc View 2 chunks +2 lines, -0 lines 0 comments Download
A chrome/browser/resources/chromeos/demo_app/manifest.json View 1 2 3 4 1 chunk +14 lines, -0 lines 6 comments Download
M chrome/browser/ui/startup/startup_browser_creator.cc View 1 2 3 4 5 6 7 8 9 2 chunks +11 lines, -0 lines 2 comments Download
M chrome/browser/ui/webui/chromeos/login/network_screen_handler.h View 1 2 3 4 5 5 chunks +22 lines, -0 lines 4 comments Download
M chrome/browser/ui/webui/chromeos/login/network_screen_handler.cc View 1 2 3 4 5 6 chunks +74 lines, -0 lines 11 comments Download
M chrome/chrome_browser_chromeos.gypi View 2 chunks +4 lines, -0 lines 0 comments Download
M chrome/common/pref_names.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/pref_names.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M chromeos/chromeos_switches.h View 1 chunk +2 lines, -0 lines 0 comments Download
M chromeos/chromeos_switches.cc View 1 chunk +6 lines, -0 lines 2 comments Download

Messages

Total messages: 30 (0 generated)
rkc
6 years, 10 months ago (2014-02-11 03:05:19 UTC) #1
xiyuan
https://codereview.chromium.org/156493004/diff/1/chrome/browser/chromeos/idle_detector.cc File chrome/browser/chromeos/idle_detector.cc (right): https://codereview.chromium.org/156493004/diff/1/chrome/browser/chromeos/idle_detector.cc#newcode27 chrome/browser/chromeos/idle_detector.cc:27: active_callback_.Run(); OnUserActivity is called quite frequently and we should ...
6 years, 10 months ago (2014-02-11 03:42:45 UTC) #2
rkc
https://codereview.chromium.org/156493004/diff/1/chrome/browser/chromeos/idle_detector.cc File chrome/browser/chromeos/idle_detector.cc (right): https://codereview.chromium.org/156493004/diff/1/chrome/browser/chromeos/idle_detector.cc#newcode27 chrome/browser/chromeos/idle_detector.cc:27: active_callback_.Run(); On 2014/02/11 03:42:45, xiyuan wrote: > OnUserActivity is ...
6 years, 10 months ago (2014-02-11 04:35:57 UTC) #3
xiyuan
LGTM https://codereview.chromium.org/156493004/diff/120001/chrome/browser/ui/webui/chromeos/login/network_screen_handler.cc File chrome/browser/ui/webui/chromeos/login/network_screen_handler.cc (right): https://codereview.chromium.org/156493004/diff/120001/chrome/browser/ui/webui/chromeos/login/network_screen_handler.cc#newcode300 chrome/browser/ui/webui/chromeos/login/network_screen_handler.cc:300: derelict_detection_timeout = kDerelectDetectionTimeoutSeconds; nit: Optimize a little bit ...
6 years, 10 months ago (2014-02-11 04:47:44 UTC) #4
rkc
https://codereview.chromium.org/156493004/diff/120001/chrome/browser/ui/webui/chromeos/login/network_screen_handler.cc File chrome/browser/ui/webui/chromeos/login/network_screen_handler.cc (right): https://codereview.chromium.org/156493004/diff/120001/chrome/browser/ui/webui/chromeos/login/network_screen_handler.cc#newcode300 chrome/browser/ui/webui/chromeos/login/network_screen_handler.cc:300: derelict_detection_timeout = kDerelectDetectionTimeoutSeconds; On 2014/02/11 04:47:45, xiyuan wrote: > ...
6 years, 10 months ago (2014-02-11 19:44:49 UTC) #5
rkc
The CQ bit was checked by rkc@chromium.org
6 years, 10 months ago (2014-02-11 19:50:55 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rkc@chromium.org/156493004/290001
6 years, 10 months ago (2014-02-11 19:53:44 UTC) #7
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 10 months ago (2014-02-11 20:15:18 UTC) #8
commit-bot: I haz the power
Retried try job too often on chromium_presubmit for step(s) presubmit http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=chromium_presubmit&number=49558
6 years, 10 months ago (2014-02-11 20:15:20 UTC) #9
rkc
Adding thestig@ for OWNERS reviews.
6 years, 10 months ago (2014-02-11 22:06:27 UTC) #10
Lei Zhang
lgtm with some nits. https://codereview.chromium.org/156493004/diff/450001/chrome/browser/chromeos/idle_detector.cc File chrome/browser/chromeos/idle_detector.cc (right): https://codereview.chromium.org/156493004/diff/450001/chrome/browser/chromeos/idle_detector.cc#newcode1 chrome/browser/chromeos/idle_detector.cc:1: // Copyright (c) 2012 The ...
6 years, 10 months ago (2014-02-11 22:13:58 UTC) #11
rkc
https://codereview.chromium.org/156493004/diff/450001/chrome/browser/chromeos/idle_detector.cc File chrome/browser/chromeos/idle_detector.cc (right): https://codereview.chromium.org/156493004/diff/450001/chrome/browser/chromeos/idle_detector.cc#newcode1 chrome/browser/chromeos/idle_detector.cc:1: // Copyright (c) 2012 The Chromium Authors. All rights ...
6 years, 10 months ago (2014-02-11 22:37:38 UTC) #12
rkc
The CQ bit was checked by rkc@chromium.org
6 years, 10 months ago (2014-02-11 22:58:38 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rkc@chromium.org/156493004/580001
6 years, 10 months ago (2014-02-11 23:02:48 UTC) #14
rkc
The CQ bit was unchecked by rkc@chromium.org
6 years, 10 months ago (2014-02-11 23:52:51 UTC) #15
rkc
The last patch fixes 2 major issues with the CL; one is making sure we ...
6 years, 10 months ago (2014-02-11 23:58:59 UTC) #16
xiyuan
SLGTM https://codereview.chromium.org/156493004/diff/650002/chrome/browser/chromeos/login/authenticator.h File chrome/browser/chromeos/login/authenticator.h (right): https://codereview.chromium.org/156493004/diff/650002/chrome/browser/chromeos/login/authenticator.h#newcode62 chrome/browser/chromeos/login/authenticator.h:62: const std::string& app_user_id, bool force_ephemeral) = 0; nit: ...
6 years, 10 months ago (2014-02-12 00:03:22 UTC) #17
rkc
https://codereview.chromium.org/156493004/diff/650002/chrome/browser/chromeos/login/authenticator.h File chrome/browser/chromeos/login/authenticator.h (right): https://codereview.chromium.org/156493004/diff/650002/chrome/browser/chromeos/login/authenticator.h#newcode62 chrome/browser/chromeos/login/authenticator.h:62: const std::string& app_user_id, bool force_ephemeral) = 0; On 2014/02/12 ...
6 years, 10 months ago (2014-02-12 00:08:06 UTC) #18
Lei Zhang
The non-CrOS files didn't change much, so still LGTM https://codereview.chromium.org/156493004/diff/960001/chrome/browser/ui/startup/startup_browser_creator.cc File chrome/browser/ui/startup/startup_browser_creator.cc (right): https://codereview.chromium.org/156493004/diff/960001/chrome/browser/ui/startup/startup_browser_creator.cc#newcode43 chrome/browser/ui/startup/startup_browser_creator.cc:43: ...
6 years, 10 months ago (2014-02-12 00:13:57 UTC) #19
rkc
https://codereview.chromium.org/156493004/diff/960001/chrome/browser/ui/startup/startup_browser_creator.cc File chrome/browser/ui/startup/startup_browser_creator.cc (right): https://codereview.chromium.org/156493004/diff/960001/chrome/browser/ui/startup/startup_browser_creator.cc#newcode43 chrome/browser/ui/startup/startup_browser_creator.cc:43: #include "chrome/browser/lifetime/application_lifetime.h" On 2014/02/12 00:13:57, Lei Zhang wrote: > ...
6 years, 10 months ago (2014-02-12 00:20:50 UTC) #20
rkc
The CQ bit was checked by rkc@chromium.org
6 years, 10 months ago (2014-02-12 00:21:13 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rkc@chromium.org/156493004/1050001
6 years, 10 months ago (2014-02-12 00:23:52 UTC) #22
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 10 months ago (2014-02-12 02:21:23 UTC) #23
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) app_list_unittests, ash_unittests, aura_unittests, cacheinvalidation_unittests, cc_unittests, check_deps, ...
6 years, 10 months ago (2014-02-12 02:21:24 UTC) #24
rkc
The CQ bit was checked by rkc@chromium.org
6 years, 10 months ago (2014-02-12 02:24:10 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rkc@chromium.org/156493004/1050001
6 years, 10 months ago (2014-02-12 02:25:03 UTC) #26
commit-bot: I haz the power
Change committed as 250666
6 years, 10 months ago (2014-02-12 09:41:47 UTC) #27
bartfab (slow)
I am concerned about the quality of this CL. This is a big feature that ...
6 years, 10 months ago (2014-02-13 19:51:52 UTC) #28
rkc
Hey Bartosz, Thanks for the extensive review. I've addressed all the comments here but the ...
6 years, 10 months ago (2014-02-13 23:22:00 UTC) #29
bartfab (slow)
6 years, 10 months ago (2014-02-17 15:53:45 UTC) #30
Message was sent while issue was closed.
Thanks for uploading the clean-up CL. I left some comments there and replied to
a few others here.

https://codereview.chromium.org/156493004/diff/1050001/chrome/browser/chromeo...
File chrome/browser/chromeos/idle_detector.h (right):

https://codereview.chromium.org/156493004/diff/1050001/chrome/browser/chromeo...
chrome/browser/chromeos/idle_detector.h:17: IdleDetector(const base::Closure&
on_active_callback,
On 2014/02/13 23:22:01, Rahul Chaturvedi wrote:
> On 2014/02/13 19:51:53, bartfab wrote:
> > What is |on_active_callback| meant for? Nobody ever uses it.
> 
> This code is entirely reusable for the idle_logout dialog code in retail mode,
> provided we also have an on_active callback. I intend to use this class for
that
> code but wouldn't like to refactor this class again when I do.

As discussed offline, the retail mode idle logout dialog is obsolete and can be
removed very soon (yay!) rather than being refactored. Thus, my comments stand:
This class should be renamed into something that indicates it is a one-shot
implementation for demo mode only and the |on_active_callback| that nobody uses
should be removed.

https://codereview.chromium.org/156493004/diff/1050001/chrome/browser/resourc...
File chrome/browser/resources/chromeos/demo_app/manifest.json (right):

https://codereview.chromium.org/156493004/diff/1050001/chrome/browser/resourc...
chrome/browser/resources/chromeos/demo_app/manifest.json:1: {
On 2014/02/13 23:22:01, Rahul Chaturvedi wrote:
> On 2014/02/13 19:51:53, bartfab wrote:
> > I find it strange that we ship the manifest with the Chrome source code and
> the
> > app separately. Is there any reason that the manifest cannot reside inside
> > /usr/share/chromeos-assets/demo_app so that it gets updated automatically
> > together with the app?
> 
> We're loading this as a component app, not a regular app. If we switch to
> loading this just as a regular app, we can move this manifest out. I am
> discussing the pros/cons of that with a few folks here before deciding what to
> do with it in M35.

When loading the app, you specify the path to the manifest. Why would you be
unable to load it as a component app if the path pointed to somewhere inside
/usr/share/chromeos-assets/demo_app?

https://codereview.chromium.org/156493004/diff/1050001/chrome/browser/resourc...
chrome/browser/resources/chromeos/demo_app/manifest.json:2: //
chrome-extension://klimoghijjogocdbaikffefjfcfheiel
On 2014/02/13 23:22:01, Rahul Chaturvedi wrote:
> On 2014/02/13 19:51:53, bartfab wrote:
> > Comments are not allowed in JSON. This file is invalid.
> 
> Almost every component app manifest in the tree has that comment, so I am
pretty
> sure that the manifest parser handles comments fine.
> 

It's still invalid JSON :).

https://codereview.chromium.org/156493004/diff/1050001/chrome/browser/ui/webu...
File chrome/browser/ui/webui/chromeos/login/network_screen_handler.cc (right):

https://codereview.chromium.org/156493004/diff/1050001/chrome/browser/ui/webu...
chrome/browser/ui/webui/chromeos/login/network_screen_handler.cc:51: const int64
kDerelectDetectionTimeoutSeconds = 8 * 60 * 60; // 8 hours.
On 2014/02/13 23:22:01, Rahul Chaturvedi wrote:
> On 2014/02/13 19:51:53, bartfab wrote:
> > Why is this an int64? int would have been entirely sufficient, even on
16-bit
> > machines.
> > 
> > Nit: 2 spaces before trailing comment.
> 
> To keep the type consistent with what base::Time::FromSeconds expects.
> I am probably going to change this to milliseconds anyway once I check in the
> tests since I don't really want us to have to wait 1s during tests.

1) C++ will implicitly up-cast an |int| to an |int64| when needed. There is no
need to have these constants be |int64|.
2) In tests, we do not want any waits, not even 1ms. For tests, you should test
the timeout to zero and at that point, it does not matter whether you specify
that as 0s or 0ms.

Powered by Google App Engine
This is Rietveld 408576698