New issue
Advanced search Search tips

Issue 657687 link

Starred by 3 users

Issue metadata

Status: Started
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

ARC: Refactor startup code

Project Member Reported by lhchavez@chromium.org, Oct 20 2016

Issue description

This primarily involves removing all non-auth-related responsibilities from ArcAuthHost and then cleaning up the startup logic.
 
Components: Platform>ARC
Labels: OS-Chrome
Owner: lhchavez@chromium.org
Project Member

Comment 2 by bugdroid1@chromium.org, Oct 25 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/88cd832f54cd34331040e1489de6a13cfb921922

commit 88cd832f54cd34331040e1489de6a13cfb921922
Author: lhchavez <lhchavez@chromium.org>
Date: Tue Oct 25 02:44:56 2016

arc: Create intermediate directories in c/b/c/arc

chrome/browser/chromeos/arc directory has become very cluttered. In
preparation for a big refactor, let's create intermediate directories
for most of the files. The ones that are still in the top-level
directory will undergo significant change, so it doesn't make sense to
move them just yet since all their callsites will also need to be
changed soon.

BUG=657687
TEST=git cl try

Review-Url: https://codereview.chromium.org/2441563002
Cr-Commit-Position: refs/heads/master@{#427250}

[modify] https://crrev.com/88cd832f54cd34331040e1489de6a13cfb921922/chrome/browser/chrome_content_browser_client.cc
[modify] https://crrev.com/88cd832f54cd34331040e1489de6a13cfb921922/chrome/browser/chromeos/BUILD.gn
[modify] https://crrev.com/88cd832f54cd34331040e1489de6a13cfb921922/chrome/browser/chromeos/arc/arc_auth_service.cc
[modify] https://crrev.com/88cd832f54cd34331040e1489de6a13cfb921922/chrome/browser/chromeos/arc/arc_auth_service.h
[modify] https://crrev.com/88cd832f54cd34331040e1489de6a13cfb921922/chrome/browser/chromeos/arc/arc_service_launcher.cc
[rename] https://crrev.com/88cd832f54cd34331040e1489de6a13cfb921922/chrome/browser/chromeos/arc/downloads_watcher/arc_downloads_watcher_service.cc
[rename] https://crrev.com/88cd832f54cd34331040e1489de6a13cfb921922/chrome/browser/chromeos/arc/downloads_watcher/arc_downloads_watcher_service.h
[rename] https://crrev.com/88cd832f54cd34331040e1489de6a13cfb921922/chrome/browser/chromeos/arc/downloads_watcher/arc_downloads_watcher_service_unittest.cc
[rename] https://crrev.com/88cd832f54cd34331040e1489de6a13cfb921922/chrome/browser/chromeos/arc/enterprise/arc_enterprise_reporting_service.cc
[rename] https://crrev.com/88cd832f54cd34331040e1489de6a13cfb921922/chrome/browser/chromeos/arc/enterprise/arc_enterprise_reporting_service.h
[rename] https://crrev.com/88cd832f54cd34331040e1489de6a13cfb921922/chrome/browser/chromeos/arc/intent_helper/arc_external_protocol_dialog.cc
[rename] https://crrev.com/88cd832f54cd34331040e1489de6a13cfb921922/chrome/browser/chromeos/arc/intent_helper/arc_external_protocol_dialog.h
[rename] https://crrev.com/88cd832f54cd34331040e1489de6a13cfb921922/chrome/browser/chromeos/arc/intent_helper/arc_navigation_throttle.cc
[rename] https://crrev.com/88cd832f54cd34331040e1489de6a13cfb921922/chrome/browser/chromeos/arc/intent_helper/arc_navigation_throttle.h
[rename] https://crrev.com/88cd832f54cd34331040e1489de6a13cfb921922/chrome/browser/chromeos/arc/intent_helper/arc_navigation_throttle_unittest.cc
[rename] https://crrev.com/88cd832f54cd34331040e1489de6a13cfb921922/chrome/browser/chromeos/arc/intent_helper/arc_settings_service.cc
[rename] https://crrev.com/88cd832f54cd34331040e1489de6a13cfb921922/chrome/browser/chromeos/arc/intent_helper/arc_settings_service.h
[rename] https://crrev.com/88cd832f54cd34331040e1489de6a13cfb921922/chrome/browser/chromeos/arc/intent_helper/arc_settings_service_browsertest.cc
[rename] https://crrev.com/88cd832f54cd34331040e1489de6a13cfb921922/chrome/browser/chromeos/arc/notification/arc_boot_error_notification.cc
[rename] https://crrev.com/88cd832f54cd34331040e1489de6a13cfb921922/chrome/browser/chromeos/arc/notification/arc_boot_error_notification.h
[rename] https://crrev.com/88cd832f54cd34331040e1489de6a13cfb921922/chrome/browser/chromeos/arc/policy/arc_android_management_checker.cc
[rename] https://crrev.com/88cd832f54cd34331040e1489de6a13cfb921922/chrome/browser/chromeos/arc/policy/arc_android_management_checker.h
[rename] https://crrev.com/88cd832f54cd34331040e1489de6a13cfb921922/chrome/browser/chromeos/arc/policy/arc_android_management_checker_delegate.h
[rename] https://crrev.com/88cd832f54cd34331040e1489de6a13cfb921922/chrome/browser/chromeos/arc/policy/arc_policy_bridge.cc
[rename] https://crrev.com/88cd832f54cd34331040e1489de6a13cfb921922/chrome/browser/chromeos/arc/policy/arc_policy_bridge.h
[rename] https://crrev.com/88cd832f54cd34331040e1489de6a13cfb921922/chrome/browser/chromeos/arc/policy/arc_policy_bridge_unittest.cc
[rename] https://crrev.com/88cd832f54cd34331040e1489de6a13cfb921922/chrome/browser/chromeos/arc/print/arc_print_service.cc
[rename] https://crrev.com/88cd832f54cd34331040e1489de6a13cfb921922/chrome/browser/chromeos/arc/print/arc_print_service.h
[rename] https://crrev.com/88cd832f54cd34331040e1489de6a13cfb921922/chrome/browser/chromeos/arc/process/arc_process.cc
[rename] https://crrev.com/88cd832f54cd34331040e1489de6a13cfb921922/chrome/browser/chromeos/arc/process/arc_process.h
[rename] https://crrev.com/88cd832f54cd34331040e1489de6a13cfb921922/chrome/browser/chromeos/arc/process/arc_process_service.cc
[rename] https://crrev.com/88cd832f54cd34331040e1489de6a13cfb921922/chrome/browser/chromeos/arc/process/arc_process_service.h
[rename] https://crrev.com/88cd832f54cd34331040e1489de6a13cfb921922/chrome/browser/chromeos/arc/tts/arc_tts_service.cc
[rename] https://crrev.com/88cd832f54cd34331040e1489de6a13cfb921922/chrome/browser/chromeos/arc/tts/arc_tts_service.h
[rename] https://crrev.com/88cd832f54cd34331040e1489de6a13cfb921922/chrome/browser/chromeos/arc/video/gpu_arc_video_service_host.cc
[rename] https://crrev.com/88cd832f54cd34331040e1489de6a13cfb921922/chrome/browser/chromeos/arc/video/gpu_arc_video_service_host.h
[rename] https://crrev.com/88cd832f54cd34331040e1489de6a13cfb921922/chrome/browser/chromeos/arc/wallpaper/arc_wallpaper_service.cc
[rename] https://crrev.com/88cd832f54cd34331040e1489de6a13cfb921922/chrome/browser/chromeos/arc/wallpaper/arc_wallpaper_service.h
[modify] https://crrev.com/88cd832f54cd34331040e1489de6a13cfb921922/chrome/browser/chromeos/external_protocol_dialog.cc
[modify] https://crrev.com/88cd832f54cd34331040e1489de6a13cfb921922/chrome/browser/memory/tab_manager_delegate_chromeos.cc
[modify] https://crrev.com/88cd832f54cd34331040e1489de6a13cfb921922/chrome/browser/memory/tab_manager_delegate_chromeos.h
[modify] https://crrev.com/88cd832f54cd34331040e1489de6a13cfb921922/chrome/browser/memory/tab_manager_delegate_chromeos_unittest.cc
[modify] https://crrev.com/88cd832f54cd34331040e1489de6a13cfb921922/chrome/browser/task_manager/providers/arc/arc_process_task_provider.cc
[modify] https://crrev.com/88cd832f54cd34331040e1489de6a13cfb921922/chrome/browser/task_manager/providers/arc/arc_process_task_provider.h
[modify] https://crrev.com/88cd832f54cd34331040e1489de6a13cfb921922/chrome/browser/ui/browser_dialogs.h
[modify] https://crrev.com/88cd832f54cd34331040e1489de6a13cfb921922/chrome/browser/ui/views/intent_picker_bubble_view.h
[modify] https://crrev.com/88cd832f54cd34331040e1489de6a13cfb921922/chrome/browser/ui/views/intent_picker_bubble_view_unittest.cc
[modify] https://crrev.com/88cd832f54cd34331040e1489de6a13cfb921922/chrome/test/BUILD.gn

Project Member

Comment 3 by bugdroid1@chromium.org, Oct 25 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e0eb7942096fb4945f5d5d3ed23632148d5348bd

commit e0eb7942096fb4945f5d5d3ed23632148d5348bd
Author: hidehiko <hidehiko@chromium.org>
Date: Tue Oct 25 04:56:29 2016

Extract ArcSupportMessageHost.

Currently ArcSupportHost is the ARC's implementation of
NativeMessageHost. Because of the system structure, the instance
is created and managed by the module outside of ARC.

This CL extracts the implementation of that part into
ArcSupportMessageHost so that the ArcSupportHost, which will
be the main interface to show UI things for ARC, can be managed
along with the ARC's life-time.

There is a plan to extract non authorization related part from
ArcAuthSerivce. Meanwhile, the instance is managed by
ArcAuthService, temporarily.

BUG=657687, 636218,  633258 , b/31079732
TEST=Ran on test device. Ran trybots.

Review-Url: https://codereview.chromium.org/2436903003
Cr-Commit-Position: refs/heads/master@{#427277}

[modify] https://crrev.com/e0eb7942096fb4945f5d5d3ed23632148d5348bd/chrome/browser/chromeos/BUILD.gn
[modify] https://crrev.com/e0eb7942096fb4945f5d5d3ed23632148d5348bd/chrome/browser/chromeos/arc/arc_auth_service.cc
[modify] https://crrev.com/e0eb7942096fb4945f5d5d3ed23632148d5348bd/chrome/browser/chromeos/arc/arc_auth_service.h
[modify] https://crrev.com/e0eb7942096fb4945f5d5d3ed23632148d5348bd/chrome/browser/chromeos/arc/arc_auth_service_unittest.cc
[modify] https://crrev.com/e0eb7942096fb4945f5d5d3ed23632148d5348bd/chrome/browser/chromeos/arc/arc_support_host.cc
[modify] https://crrev.com/e0eb7942096fb4945f5d5d3ed23632148d5348bd/chrome/browser/chromeos/arc/arc_support_host.h
[add] https://crrev.com/e0eb7942096fb4945f5d5d3ed23632148d5348bd/chrome/browser/chromeos/arc/extensions/arc_support_message_host.cc
[add] https://crrev.com/e0eb7942096fb4945f5d5d3ed23632148d5348bd/chrome/browser/chromeos/arc/extensions/arc_support_message_host.h
[modify] https://crrev.com/e0eb7942096fb4945f5d5d3ed23632148d5348bd/chrome/browser/extensions/api/messaging/native_message_host_chromeos.cc

Project Member

Comment 5 by bugdroid1@chromium.org, Oct 26 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b1fb427de5a8fc9d3c1a5c5abaddd023a0e2ca52

commit b1fb427de5a8fc9d3c1a5c5abaddd023a0e2ca52
Author: hidehiko <hidehiko@chromium.org>
Date: Wed Oct 26 13:11:34 2016

Refactor ArcAndroidManagementChecker.

This is the preparation to remove management check from re-auth
flow. Also, this is preparation to introduce ArcSessionManager.
- Move more management check logic from CheckAndroidManagement(),
  to ArcAndroidManagementChecker, so that CheckAndroidManagement()
  is removed. Management check is not a part of authorization.
- Get rid of Delegate, instead use Callback to easily switch the
  following operations.
- Remove "background" concept from ArcAndroidManagementChecker.
- IsAccountManaged() is moved to arc_policy_util, so that it can be
  shared with current ArcAuthService and ArcAndroidManagementChecker.
- Use base::ResetAndReturn in AndroidManagementClient, so that
  callback can destruct the instance.

BUG=657687
BUG=b/31079732
TEST=Ran on test device. Tried to inject RESULT_MANAGED and it works.
     Ran trybots.

Review-Url: https://codereview.chromium.org/2446563002
Cr-Commit-Position: refs/heads/master@{#427672}

[modify] https://crrev.com/b1fb427de5a8fc9d3c1a5c5abaddd023a0e2ca52/chrome/browser/chromeos/arc/arc_auth_service.cc
[modify] https://crrev.com/b1fb427de5a8fc9d3c1a5c5abaddd023a0e2ca52/chrome/browser/chromeos/arc/arc_auth_service.h
[modify] https://crrev.com/b1fb427de5a8fc9d3c1a5c5abaddd023a0e2ca52/chrome/browser/chromeos/arc/policy/arc_android_management_checker.cc
[modify] https://crrev.com/b1fb427de5a8fc9d3c1a5c5abaddd023a0e2ca52/chrome/browser/chromeos/arc/policy/arc_android_management_checker.h
[delete] https://crrev.com/d0b87ba0dc7ef09521a813d97d33d71e19f91c07/chrome/browser/chromeos/arc/policy/arc_android_management_checker_delegate.h
[modify] https://crrev.com/b1fb427de5a8fc9d3c1a5c5abaddd023a0e2ca52/chrome/browser/chromeos/policy/android_management_client.cc

Project Member

Comment 6 by bugdroid1@chromium.org, Oct 28 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/bbb459c611c30ecad20b6b2912df9489c395871f

commit bbb459c611c30ecad20b6b2912df9489c395871f
Author: hidehiko <hidehiko@chromium.org>
Date: Fri Oct 28 15:14:55 2016

Remove async load concept for ToS from native code.

This CL removes the async-load concept for ToS from native
ArcSupportHost / ArcAuthService, because it is unused.
Now, it is encapsulated in the arc_support App.

To integrate ToS related code into one place, for the maintainability, this CL introduces
a class, TermsOfServicePage, which implements the ToS page
of the arc_support App.

After this CL, native can just say "Show ToS page" to ArcSupportHost,
so that arc_support app handles async loading.

This is the preparation to resolve the dependency between
ArcAuthService and ArcSupportHost.

BUG=657687
BUG=b/31079732
BUG=b/32424636
TEST=Ran on test device manually. Ran bots.
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2450823002
Cr-Commit-Position: refs/heads/master@{#428375}

[modify] https://crrev.com/bbb459c611c30ecad20b6b2912df9489c395871f/chrome/browser/chromeos/arc/arc_auth_service.cc
[modify] https://crrev.com/bbb459c611c30ecad20b6b2912df9489c395871f/chrome/browser/chromeos/arc/arc_auth_service.h
[modify] https://crrev.com/bbb459c611c30ecad20b6b2912df9489c395871f/chrome/browser/resources/chromeos/arc_support/background.js
[modify] https://crrev.com/bbb459c611c30ecad20b6b2912df9489c395871f/chrome/browser/resources/chromeos/arc_support/main.html

Project Member

Comment 7 by bugdroid1@chromium.org, Nov 4 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6bba4da10ab15b7ad7b8c1bda0cf04f1fa20d31f

commit 6bba4da10ab15b7ad7b8c1bda0cf04f1fa20d31f
Author: lhchavez <lhchavez@chromium.org>
Date: Fri Nov 04 16:33:36 2016

arc: Shuffle ArcAuthService's interface

This change introduces a new method that will provide ARC with all the
information it needs to completely sign in and provision itself,
reducing the number of round trips needed and allowing us to restructure
ARC's code in a much simpler way.

This change also now assumes that OnSignInComplete/OnSignInFailed can be
called at any time (and in fact the former will be called every time ARC
boots).

BUG=657687
TEST=ARC still boots

Review-Url: https://codereview.chromium.org/2474663003
Cr-Commit-Position: refs/heads/master@{#429909}

[modify] https://crrev.com/6bba4da10ab15b7ad7b8c1bda0cf04f1fa20d31f/chrome/browser/chromeos/arc/arc_auth_service.cc
[modify] https://crrev.com/6bba4da10ab15b7ad7b8c1bda0cf04f1fa20d31f/chrome/browser/chromeos/arc/arc_auth_service.h
[modify] https://crrev.com/6bba4da10ab15b7ad7b8c1bda0cf04f1fa20d31f/components/arc/common/auth.mojom

Project Member

Comment 8 by bugdroid1@chromium.org, Nov 4 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/954755088fb179bb7feb9427ea084eb82daaaaa8

commit 954755088fb179bb7feb9427ea084eb82daaaaa8
Author: hidehiko <hidehiko@chromium.org>
Date: Fri Nov 04 16:35:48 2016

Remove OnOptInChanged callback.

The callback is used in two different purposes.
- Callback in browsertest.
  This is unused, so just removed.
- Trigger to update the badge.
  The actual trigger timing is opt-in preference change.
  Replace it by OnOptInEnabled().

BUG=657687
BUG=b/31079732
TEST=Ran on test device.
     Enable ARC. Install conflict app. Verify the badge. Disable
     ARC. Verify the badge is disappeared.

Review-Url: https://codereview.chromium.org/2456803002
Cr-Commit-Position: refs/heads/master@{#429911}

[modify] https://crrev.com/954755088fb179bb7feb9427ea084eb82daaaaa8/chrome/browser/chromeos/arc/arc_auth_service.cc
[modify] https://crrev.com/954755088fb179bb7feb9427ea084eb82daaaaa8/chrome/browser/chromeos/arc/arc_auth_service.h
[modify] https://crrev.com/954755088fb179bb7feb9427ea084eb82daaaaa8/chrome/browser/chromeos/arc/arc_auth_service_browsertest.cc
[modify] https://crrev.com/954755088fb179bb7feb9427ea084eb82daaaaa8/chrome/browser/chromeos/extensions/gfx_utils.cc
[modify] https://crrev.com/954755088fb179bb7feb9427ea084eb82daaaaa8/chrome/browser/ui/ash/launcher/launcher_extension_app_updater.cc
[modify] https://crrev.com/954755088fb179bb7feb9427ea084eb82daaaaa8/chrome/browser/ui/ash/launcher/launcher_extension_app_updater.h

Project Member

Comment 9 by bugdroid1@chromium.org, Nov 4 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0eed93bebd58e2ed526edd3c8fbafc442d07b486

commit 0eed93bebd58e2ed526edd3c8fbafc442d07b486
Author: hidehiko <hidehiko@chromium.org>
Date: Fri Nov 04 23:14:53 2016

Remove initial_opt_in_ field.

The field is always set before StartUI(), checked in StartUI(),
and is reset. It is just redundant. Removes it.
initial_opt_in_ = false case is migrated into
PrepareContextForAuthCodeRequest(), instead.

BUG=657687
BUG=b/31079732
TEST=Ran on test device. Ran trybots.

Review-Url: https://codereview.chromium.org/2476973003
Cr-Commit-Position: refs/heads/master@{#430062}

[modify] https://crrev.com/0eed93bebd58e2ed526edd3c8fbafc442d07b486/chrome/browser/chromeos/arc/arc_auth_service.cc
[modify] https://crrev.com/0eed93bebd58e2ed526edd3c8fbafc442d07b486/chrome/browser/chromeos/arc/arc_auth_service.h

Project Member

Comment 10 by bugdroid1@chromium.org, Nov 5 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/dc74e57a2c0f1e7bea8bd858ac7ce5a30809dbf4

commit dc74e57a2c0f1e7bea8bd858ac7ce5a30809dbf4
Author: hidehiko <hidehiko@chromium.org>
Date: Sat Nov 05 00:17:11 2016

Split ShowPage message into two.

This is preparation to fix the dependency in arc_support_host.
ShowPage is now have two different kinds.
- One for normal page.
- One for error page.

BUG=657687
BUG=b/31079732
TEST=Ran on test device. Ran bots.
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2479633004
Cr-Commit-Position: refs/heads/master@{#430076}

[modify] https://crrev.com/dc74e57a2c0f1e7bea8bd858ac7ce5a30809dbf4/chrome/browser/chromeos/arc/arc_support_host.cc
[modify] https://crrev.com/dc74e57a2c0f1e7bea8bd858ac7ce5a30809dbf4/chrome/browser/resources/chromeos/arc_support/background.js

Project Member

Comment 11 by bugdroid1@chromium.org, Nov 8 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e929bc07aa6ce653f7df89f425f01f307839e89c

commit e929bc07aa6ce653f7df89f425f01f307839e89c
Author: hidehiko <hidehiko@chromium.org>
Date: Tue Nov 08 03:09:41 2016

Refactor ArcSupportHost and ArcAuthService part 1.

This CL contains three simple refactoring:
- Move UIPage from ArcAuthService to ArcSupportHost.
- Move logic in ArcSupportHost::OnMessage to ArcAuthService.
  For this purpose, Observer is introduced.
- Move ArcOptInPreferenceHandler from ArcSupportHost to
  ArcAuthService.

Moved code will be extracted again, when ArcSessionManager
is introduced.

BUG=657687
BUG=b/31079732
TEST=Ran on test device. Ran bots.

Review-Url: https://codereview.chromium.org/2475073003
Cr-Commit-Position: refs/heads/master@{#430497}

[modify] https://crrev.com/e929bc07aa6ce653f7df89f425f01f307839e89c/chrome/browser/chromeos/arc/arc_auth_service.cc
[modify] https://crrev.com/e929bc07aa6ce653f7df89f425f01f307839e89c/chrome/browser/chromeos/arc/arc_auth_service.h
[modify] https://crrev.com/e929bc07aa6ce653f7df89f425f01f307839e89c/chrome/browser/chromeos/arc/arc_support_host.cc
[modify] https://crrev.com/e929bc07aa6ce653f7df89f425f01f307839e89c/chrome/browser/chromeos/arc/arc_support_host.h

Project Member

Comment 12 by bugdroid1@chromium.org, Nov 15 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/60e845bca3f291f751495b1ae9f119acd1bccae7

commit 60e845bca3f291f751495b1ae9f119acd1bccae7
Author: hidehiko <hidehiko@chromium.org>
Date: Tue Nov 15 00:12:39 2016

Remove ArcAuthService::GetAuthCodeDeprecated0() implementation.

The method is no longer used. With this CL, the implementation
is removed.

BUG=657687
BUG=b/31079732
TEST=Trybots.

Review-Url: https://codereview.chromium.org/2499933002
Cr-Commit-Position: refs/heads/master@{#432005}

[modify] https://crrev.com/60e845bca3f291f751495b1ae9f119acd1bccae7/chrome/browser/chromeos/arc/arc_auth_service.cc

Project Member

Comment 13 by bugdroid1@chromium.org, Nov 15 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7f74db3b9daf5ea99df3a30d272c80271750e89a

commit 7f74db3b9daf5ea99df3a30d272c80271750e89a
Author: hidehiko <hidehiko@chromium.org>
Date: Tue Nov 15 06:07:38 2016

Do not run Android management check for re-auth case.

This CL removes the Android management check from re-auth
code flow and OOBE flow. Along with the change, onRetry
implementation is moved from UI code to native code.

BUG=657687
BUG=b/31079732
BUG=b/32431329
TEST=Ran on test device. Ran bots.
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2485233002
Cr-Commit-Position: refs/heads/master@{#432128}

[modify] https://crrev.com/7f74db3b9daf5ea99df3a30d272c80271750e89a/chrome/browser/chromeos/arc/arc_auth_service.cc
[modify] https://crrev.com/7f74db3b9daf5ea99df3a30d272c80271750e89a/chrome/browser/chromeos/arc/arc_auth_service.h
[modify] https://crrev.com/7f74db3b9daf5ea99df3a30d272c80271750e89a/chrome/browser/chromeos/arc/arc_auth_service_unittest.cc
[modify] https://crrev.com/7f74db3b9daf5ea99df3a30d272c80271750e89a/chrome/browser/chromeos/arc/arc_support_host.cc
[modify] https://crrev.com/7f74db3b9daf5ea99df3a30d272c80271750e89a/chrome/browser/chromeos/arc/arc_support_host.h
[modify] https://crrev.com/7f74db3b9daf5ea99df3a30d272c80271750e89a/chrome/browser/resources/chromeos/arc_support/background.js
[modify] https://crrev.com/7f74db3b9daf5ea99df3a30d272c80271750e89a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_unittest.cc

Project Member

Comment 14 by bugdroid1@chromium.org, Nov 16 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/41e94820ce6ca738bdb2d319740ae79d875380e2

commit 41e94820ce6ca738bdb2d319740ae79d875380e2
Author: hidehiko <hidehiko@chromium.org>
Date: Wed Nov 16 06:25:13 2016

Migrate opt-in auth flow to re-auth flow.

This CL migrates pre-fetch auth-token flow into re-auth flow.
So, internally, AuthHost implementation is split from
other arc container/enable statement management.

BUG=657687
BUG=b/31079732
TEST=Trybots. Ran on test device.

Review-Url: https://codereview.chromium.org/2490093002
Cr-Commit-Position: refs/heads/master@{#432389}

[modify] https://crrev.com/41e94820ce6ca738bdb2d319740ae79d875380e2/chrome/browser/chromeos/arc/arc_auth_service.cc
[modify] https://crrev.com/41e94820ce6ca738bdb2d319740ae79d875380e2/chrome/browser/chromeos/arc/arc_auth_service.h
[modify] https://crrev.com/41e94820ce6ca738bdb2d319740ae79d875380e2/chrome/browser/chromeos/arc/arc_auth_service_unittest.cc

Project Member

Comment 15 by bugdroid1@chromium.org, Nov 17 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/999d64e15ddfde5a8b6f2332db63caf8234871be

commit 999d64e15ddfde5a8b6f2332db63caf8234871be
Author: hidehiko <hidehiko@chromium.org>
Date: Thu Nov 17 10:32:51 2016

Refactor ArcSupportHost and ArcAuthService part2.

This CL moves more UI related implementation from ArcAuthService
to ArcSupportHost, and remove the dependency from ArcSupportHost
to ArcAuthService.

BUG=657687
BUG=b/31079732
TEST=Ran on test device. Ran bots.

Review-Url: https://codereview.chromium.org/2501013002
Cr-Commit-Position: refs/heads/master@{#432833}

[modify] https://crrev.com/999d64e15ddfde5a8b6f2332db63caf8234871be/chrome/browser/chromeos/arc/arc_auth_service.cc
[modify] https://crrev.com/999d64e15ddfde5a8b6f2332db63caf8234871be/chrome/browser/chromeos/arc/arc_auth_service.h
[modify] https://crrev.com/999d64e15ddfde5a8b6f2332db63caf8234871be/chrome/browser/chromeos/arc/arc_support_host.cc
[modify] https://crrev.com/999d64e15ddfde5a8b6f2332db63caf8234871be/chrome/browser/chromeos/arc/arc_support_host.h

Project Member

Comment 16 by bugdroid1@chromium.org, Nov 17 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/61e0e4de34b41832362b3ba8f15054f2f280926d

commit 61e0e4de34b41832362b3ba8f15054f2f280926d
Author: hidehiko <hidehiko@chromium.org>
Date: Thu Nov 17 11:33:28 2016

Merge provisioning success/error handling.

This CL merges all provisioning success and error handling
into OnProvisioningFinished().
The function will be the callback after ArcAuthService separation.

BUG=657687
BUG=b/31079732
TEST=Trybots. Ran on test device.

Review-Url: https://codereview.chromium.org/2504583002
Cr-Commit-Position: refs/heads/master@{#432844}

[modify] https://crrev.com/61e0e4de34b41832362b3ba8f15054f2f280926d/chrome/browser/chromeos/arc/arc_auth_service.cc
[modify] https://crrev.com/61e0e4de34b41832362b3ba8f15054f2f280926d/chrome/browser/chromeos/arc/arc_auth_service.h
[modify] https://crrev.com/61e0e4de34b41832362b3ba8f15054f2f280926d/chrome/browser/chromeos/arc/arc_optin_uma.cc
[modify] https://crrev.com/61e0e4de34b41832362b3ba8f15054f2f280926d/chrome/browser/chromeos/arc/arc_optin_uma.h

Project Member

Comment 17 by bugdroid1@chromium.org, Nov 17 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e4d65b979e7ccd7834db7d5c3037b1df9091f1d1

commit e4d65b979e7ccd7834db7d5c3037b1df9091f1d1
Author: hidehiko <hidehiko@chromium.org>
Date: Thu Nov 17 13:47:07 2016

Remove delegates from ArcAuthCodeFetcher and ArcAuthContext.

This CL replaces many "delegate" implementation by
callbacks.
Also, now ArcAuthContext's preparation is only for ArcAuthCodeFetcher,
so it is done in the class.

BUG=657687
BUG=b/31079732
TEST=Ran on test device. Ran bots.

Review-Url: https://codereview.chromium.org/2498363002
Cr-Commit-Position: refs/heads/master@{#432859}

[modify] https://crrev.com/e4d65b979e7ccd7834db7d5c3037b1df9091f1d1/chrome/browser/chromeos/BUILD.gn
[modify] https://crrev.com/e4d65b979e7ccd7834db7d5c3037b1df9091f1d1/chrome/browser/chromeos/arc/arc_auth_code_fetcher.cc
[modify] https://crrev.com/e4d65b979e7ccd7834db7d5c3037b1df9091f1d1/chrome/browser/chromeos/arc/arc_auth_code_fetcher.h
[delete] https://crrev.com/0589d1e77106779929525de308943c2f3c477c43/chrome/browser/chromeos/arc/arc_auth_code_fetcher_delegate.h
[modify] https://crrev.com/e4d65b979e7ccd7834db7d5c3037b1df9091f1d1/chrome/browser/chromeos/arc/arc_auth_context.cc
[modify] https://crrev.com/e4d65b979e7ccd7834db7d5c3037b1df9091f1d1/chrome/browser/chromeos/arc/arc_auth_context.h
[delete] https://crrev.com/0589d1e77106779929525de308943c2f3c477c43/chrome/browser/chromeos/arc/arc_auth_context_delegate.h
[modify] https://crrev.com/e4d65b979e7ccd7834db7d5c3037b1df9091f1d1/chrome/browser/chromeos/arc/arc_auth_service.cc
[modify] https://crrev.com/e4d65b979e7ccd7834db7d5c3037b1df9091f1d1/chrome/browser/chromeos/arc/arc_auth_service.h

Project Member

Comment 18 by bugdroid1@chromium.org, Nov 17 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/685dd76fbc10e816e880286a43c1487ac6dcf60b

commit 685dd76fbc10e816e880286a43c1487ac6dcf60b
Author: hidehiko <hidehiko@chromium.org>
Date: Thu Nov 17 14:35:13 2016

Support multiple Observer instances for ArcSupportHost.

ArcAuthService will be split into smaller pieces, and split
classes need to communicate with ArcSupportHost.
To support such a situation, this CL introduces base::ObserverList
into ArcSupportHost.

BUG=657687
BUG=b/31079732
TEST=Ran on test device. Ran bots.

Review-Url: https://codereview.chromium.org/2502243002
Cr-Commit-Position: refs/heads/master@{#432867}

[modify] https://crrev.com/685dd76fbc10e816e880286a43c1487ac6dcf60b/chrome/browser/chromeos/arc/arc_auth_service.cc
[modify] https://crrev.com/685dd76fbc10e816e880286a43c1487ac6dcf60b/chrome/browser/chromeos/arc/arc_support_host.cc
[modify] https://crrev.com/685dd76fbc10e816e880286a43c1487ac6dcf60b/chrome/browser/chromeos/arc/arc_support_host.h

Project Member

Comment 19 by bugdroid1@chromium.org, Nov 18 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5d94408675c787c6be6e1c7129d3180d9ca7786a

commit 5d94408675c787c6be6e1c7129d3180d9ca7786a
Author: hidehiko <hidehiko@chromium.org>
Date: Fri Nov 18 06:16:04 2016

Split ArcSessionManager from ArcAuthService.

ArcAuthService has multiple responsibility.
Specifically, handling on ARC boot-phase proceder and
AuthHost implementation should be independent.

This CL extracts everything other than AuthHost implementation
into another class, named ArcSessionManager.

BUG=657687
BUG=b/31079732
TEST=Ran on test device. Ran bots.
TBR=stevenjb@chromium.org

Review-Url: https://codereview.chromium.org/2507073002
Cr-Commit-Position: refs/heads/master@{#433131}

[modify] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/chrome_content_browser_client.cc
[modify] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/chromeos/BUILD.gn
[modify] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/chromeos/arc/arc_auth_service.cc
[modify] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/chromeos/arc/arc_auth_service.h
[delete] https://crrev.com/5f2fe79fcb79b28111dcdb37e226cff0a1ee5745/chrome/browser/chromeos/arc/arc_auth_service_browsertest.cc
[modify] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/chromeos/arc/arc_optin_uma.h
[modify] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/chromeos/arc/arc_service_launcher.cc
[add] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/chromeos/arc/arc_session_manager.cc
[add] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/chromeos/arc/arc_session_manager.h
[add] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/chromeos/arc/arc_session_manager_browsertest.cc
[rename] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/chromeos/arc/arc_session_manager_unittest.cc
[add] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/chromeos/arc/auth/arc_robot_auth_browsertest.cc
[modify] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/chromeos/arc/enterprise/arc_enterprise_reporting_service.cc
[modify] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/chromeos/arc/extensions/arc_support_message_host.cc
[modify] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/chromeos/arc/intent_helper/arc_settings_service.cc
[modify] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/chromeos/extensions/info_private_api.cc
[modify] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/chromeos/login/session/chrome_session_manager.cc
[modify] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/chromeos/login/session/user_session_manager.cc
[modify] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/chromeos/login/wizard_controller.cc
[modify] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/chromeos/policy/device_status_collector_browsertest.cc
[modify] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/extensions/api/feedback_private/feedback_private_api.cc
[modify] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/metrics/chromeos_metrics_provider.cc
[modify] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/policy/policy_browsertest.cc
[modify] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/prefs/browser_prefs.cc
[modify] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/sync/test/integration/sync_arc_package_helper.cc
[modify] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/ui/app_list/app_list_service_views_browsertest.cc
[modify] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/ui/app_list/app_list_syncable_service.cc
[modify] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc
[modify] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/ui/app_list/arc/arc_app_list_prefs.h
[modify] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/ui/app_list/arc/arc_app_list_prefs_factory.cc
[modify] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/ui/app_list/arc/arc_app_model_builder.cc
[modify] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/ui/app_list/arc/arc_app_test.cc
[modify] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/ui/app_list/arc/arc_app_test.h
[modify] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/ui/app_list/arc/arc_app_unittest.cc
[modify] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/ui/app_list/arc/arc_app_utils.cc
[modify] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/ui/app_list/arc/arc_package_sync_data_type_controller.cc
[modify] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/ui/app_list/search/app_search_provider.cc
[modify] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/ui/ash/chrome_launcher_prefs.cc
[modify] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/ui/ash/launcher/arc_app_deferred_launcher_controller.cc
[modify] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/ui/ash/launcher/arc_app_deferred_launcher_controller.h
[modify] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/ui/ash/launcher/arc_app_launcher_browsertest.cc
[modify] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.cc
[modify] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/ui/ash/launcher/arc_playstore_shortcut_launcher_item_controller.cc
[modify] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc
[modify] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.cc
[modify] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_unittest.cc
[modify] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/ui/ash/launcher/launcher_controller_helper.cc
[modify] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/ui/extensions/app_launch_params.cc
[modify] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_ash_unittest.cc
[modify] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.cc
[modify] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views_unittest.cc
[modify] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/ui/webui/options/browser_options_handler.cc
[modify] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/ui/webui/options/chromeos/storage_manager_handler.cc
[modify] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/browser/ui/webui/settings/chromeos/device_storage_handler.cc
[modify] https://crrev.com/5d94408675c787c6be6e1c7129d3180d9ca7786a/chrome/test/BUILD.gn

Project Member

Comment 20 by bugdroid1@chromium.org, Nov 29 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/79a569780d9e7e234a0d6d8777b91db4f9b2b8d9

commit 79a569780d9e7e234a0d6d8777b91db4f9b2b8d9
Author: hidehiko <hidehiko@chromium.org>
Date: Tue Nov 29 15:15:04 2016

Resolve initialize/destory order between ArcService and ArcSessionManager.

This CL ensures that the ArcSessionManager is alive during the whole
each ArcService's life time, by merging two class initialization
list in ArcSessionManager and ArcServiceLauncher.

BUG=657687
BUG=b/31079732
TEST=Ran on test device. Ran bots.

Review-Url: https://codereview.chromium.org/2531543003
Cr-Commit-Position: refs/heads/master@{#434990}

[modify] https://crrev.com/79a569780d9e7e234a0d6d8777b91db4f9b2b8d9/chrome/browser/chromeos/BUILD.gn
[modify] https://crrev.com/79a569780d9e7e234a0d6d8777b91db4f9b2b8d9/chrome/browser/chromeos/arc/arc_service_launcher.cc
[modify] https://crrev.com/79a569780d9e7e234a0d6d8777b91db4f9b2b8d9/chrome/browser/chromeos/arc/arc_service_launcher.h
[modify] https://crrev.com/79a569780d9e7e234a0d6d8777b91db4f9b2b8d9/chrome/browser/chromeos/arc/arc_session_manager_browsertest.cc
[modify] https://crrev.com/79a569780d9e7e234a0d6d8777b91db4f9b2b8d9/chrome/browser/chromeos/login/session/chrome_session_manager.cc
[modify] https://crrev.com/79a569780d9e7e234a0d6d8777b91db4f9b2b8d9/chrome/browser/chromeos/login/session/user_session_manager.cc
[modify] https://crrev.com/79a569780d9e7e234a0d6d8777b91db4f9b2b8d9/components/arc/BUILD.gn
[modify] https://crrev.com/79a569780d9e7e234a0d6d8777b91db4f9b2b8d9/components/arc/DEPS
[modify] https://crrev.com/79a569780d9e7e234a0d6d8777b91db4f9b2b8d9/components/arc/arc_service_manager.cc
[modify] https://crrev.com/79a569780d9e7e234a0d6d8777b91db4f9b2b8d9/components/arc/arc_service_manager.h

Project Member

Comment 21 by bugdroid1@chromium.org, Dec 2 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3b196d322a4a334c17879af6b2f7bbe284eedb1c

commit 3b196d322a4a334c17879af6b2f7bbe284eedb1c
Author: hidehiko <hidehiko@chromium.org>
Date: Fri Dec 02 11:05:21 2016

Extract ArcTermsOfServiceNegotiator implementation.

This extracts Terms-Of-Service agreement handling into
a standalone class.

BUG=657687
BUG=b/31079732
TEST=Ran on test device. Ran bots.

Review-Url: https://codereview.chromium.org/2534883002
Cr-Commit-Position: refs/heads/master@{#435910}

[modify] https://crrev.com/3b196d322a4a334c17879af6b2f7bbe284eedb1c/chrome/browser/BUILD.gn
[modify] https://crrev.com/3b196d322a4a334c17879af6b2f7bbe284eedb1c/chrome/browser/chromeos/BUILD.gn
[modify] https://crrev.com/3b196d322a4a334c17879af6b2f7bbe284eedb1c/chrome/browser/chromeos/arc/arc_session_manager.cc
[modify] https://crrev.com/3b196d322a4a334c17879af6b2f7bbe284eedb1c/chrome/browser/chromeos/arc/arc_session_manager.h
[modify] https://crrev.com/3b196d322a4a334c17879af6b2f7bbe284eedb1c/chrome/browser/chromeos/arc/arc_session_manager_browsertest.cc
[modify] https://crrev.com/3b196d322a4a334c17879af6b2f7bbe284eedb1c/chrome/browser/chromeos/arc/arc_session_manager_unittest.cc
[modify] https://crrev.com/3b196d322a4a334c17879af6b2f7bbe284eedb1c/chrome/browser/chromeos/arc/arc_support_host.cc
[modify] https://crrev.com/3b196d322a4a334c17879af6b2f7bbe284eedb1c/chrome/browser/chromeos/arc/arc_support_host.h
[add] https://crrev.com/3b196d322a4a334c17879af6b2f7bbe284eedb1c/chrome/browser/chromeos/arc/extensions/fake_arc_support.cc
[add] https://crrev.com/3b196d322a4a334c17879af6b2f7bbe284eedb1c/chrome/browser/chromeos/arc/extensions/fake_arc_support.h
[modify] https://crrev.com/3b196d322a4a334c17879af6b2f7bbe284eedb1c/chrome/browser/chromeos/arc/optin/arc_optin_preference_handler.cc
[add] https://crrev.com/3b196d322a4a334c17879af6b2f7bbe284eedb1c/chrome/browser/chromeos/arc/optin/arc_terms_of_service_negotiator.cc
[add] https://crrev.com/3b196d322a4a334c17879af6b2f7bbe284eedb1c/chrome/browser/chromeos/arc/optin/arc_terms_of_service_negotiator.h
[add] https://crrev.com/3b196d322a4a334c17879af6b2f7bbe284eedb1c/chrome/browser/chromeos/arc/optin/arc_terms_of_service_negotiator_unittest.cc
[modify] https://crrev.com/3b196d322a4a334c17879af6b2f7bbe284eedb1c/chrome/browser/policy/policy_browsertest.cc

Project Member

Comment 22 by bugdroid1@chromium.org, Dec 5 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f44a3339cce8208c9b308fe95d99bc5faf7fbfc5

commit f44a3339cce8208c9b308fe95d99bc5faf7fbfc5
Author: hidehiko <hidehiko@chromium.org>
Date: Mon Dec 05 18:11:37 2016

Fix race issue in ArcAuthService.

ArcAuthService had an race issue, around manual "SIGN IN"
click flow.
This CL fixes it by moving everyting into ArcManualAuthCodeFetcher
implementation, and make it cancellable by deleting.

For that purpose, this CL introduces ArcAuthFetcher interface,
and has (old) ArcAuthCodeFetcher and ArcRobotAuth implement it, as well.
Along the change, these are renamed into ArcBackgroundAuthCodeFetcher
and ArcRobotAuthCodeFetchere respectively.

Note that, on error page, there still remains a race issue that
a user can click "TRY AGAIN" button quickly, so that OnRetryClicked()
can be invoked twice (or more) quickly. This problem will be addressed in another CL.

BUG=657687
BUG=b/31079732
TEST=Ran on test device. Ran bots.

Review-Url: https://codereview.chromium.org/2547073002
Cr-Commit-Position: refs/heads/master@{#436349}

[modify] https://crrev.com/f44a3339cce8208c9b308fe95d99bc5faf7fbfc5/chrome/browser/chromeos/BUILD.gn
[modify] https://crrev.com/f44a3339cce8208c9b308fe95d99bc5faf7fbfc5/chrome/browser/chromeos/arc/arc_auth_service.cc
[modify] https://crrev.com/f44a3339cce8208c9b308fe95d99bc5faf7fbfc5/chrome/browser/chromeos/arc/arc_auth_service.h
[modify] https://crrev.com/f44a3339cce8208c9b308fe95d99bc5faf7fbfc5/chrome/browser/chromeos/arc/arc_session_manager.cc
[add] https://crrev.com/f44a3339cce8208c9b308fe95d99bc5faf7fbfc5/chrome/browser/chromeos/arc/auth/arc_auth_code_fetcher.h
[rename] https://crrev.com/f44a3339cce8208c9b308fe95d99bc5faf7fbfc5/chrome/browser/chromeos/arc/auth/arc_background_auth_code_fetcher.cc
[rename] https://crrev.com/f44a3339cce8208c9b308fe95d99bc5faf7fbfc5/chrome/browser/chromeos/arc/auth/arc_background_auth_code_fetcher.h
[add] https://crrev.com/f44a3339cce8208c9b308fe95d99bc5faf7fbfc5/chrome/browser/chromeos/arc/auth/arc_manual_auth_code_fetcher.cc
[add] https://crrev.com/f44a3339cce8208c9b308fe95d99bc5faf7fbfc5/chrome/browser/chromeos/arc/auth/arc_manual_auth_code_fetcher.h
[delete] https://crrev.com/8592ce0a3fd37846a92824d40c714181e71ea557/chrome/browser/chromeos/arc/auth/arc_robot_auth.h
[rename] https://crrev.com/f44a3339cce8208c9b308fe95d99bc5faf7fbfc5/chrome/browser/chromeos/arc/auth/arc_robot_auth_code_fetcher.cc
[add] https://crrev.com/f44a3339cce8208c9b308fe95d99bc5faf7fbfc5/chrome/browser/chromeos/arc/auth/arc_robot_auth_code_fetcher.h
[rename] https://crrev.com/f44a3339cce8208c9b308fe95d99bc5faf7fbfc5/chrome/browser/chromeos/arc/auth/arc_robot_auth_code_fetcher_browsertest.cc
[modify] https://crrev.com/f44a3339cce8208c9b308fe95d99bc5faf7fbfc5/chrome/test/BUILD.gn

Project Member

Comment 24 by bugdroid1@chromium.org, Dec 8 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4573cdea03df32f06dbf9d0357a17ea3327cde24

commit 4573cdea03df32f06dbf9d0357a17ea3327cde24
Author: hidehiko <hidehiko@chromium.org>
Date: Thu Dec 08 09:15:53 2016

Remove explicit singletonness of ArcBridgeService part 3.

This CL replaces ArcBridgeService::Get() by
ArcServiceManager::Get()->arc_bridge_service() conceptually.
For error handling, now ArcServiceManager::Get() can return
nullptr, if not available.

BUG=657687
BUG=b/31079732
TEST=Ran bots.

Review-Url: https://codereview.chromium.org/2557513004
Cr-Commit-Position: refs/heads/master@{#437219}

[modify] https://crrev.com/4573cdea03df32f06dbf9d0357a17ea3327cde24/chrome/browser/chromeos/arc/arc_session_manager_unittest.cc
[modify] https://crrev.com/4573cdea03df32f06dbf9d0357a17ea3327cde24/chrome/browser/chromeos/arc/intent_helper/arc_settings_service_browsertest.cc
[modify] https://crrev.com/4573cdea03df32f06dbf9d0357a17ea3327cde24/chrome/browser/chromeos/policy/device_status_collector.cc
[modify] https://crrev.com/4573cdea03df32f06dbf9d0357a17ea3327cde24/chrome/browser/memory/tab_manager_delegate_chromeos.cc
[modify] https://crrev.com/4573cdea03df32f06dbf9d0357a17ea3327cde24/chrome/browser/policy/policy_browsertest.cc
[modify] https://crrev.com/4573cdea03df32f06dbf9d0357a17ea3327cde24/chrome/browser/speech/tts_chromeos.cc
[modify] https://crrev.com/4573cdea03df32f06dbf9d0357a17ea3327cde24/chrome/browser/task_manager/providers/arc/arc_process_task.cc
[modify] https://crrev.com/4573cdea03df32f06dbf9d0357a17ea3327cde24/chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc
[modify] https://crrev.com/4573cdea03df32f06dbf9d0357a17ea3327cde24/chrome/browser/ui/app_list/arc/arc_app_list_prefs_factory.cc
[modify] https://crrev.com/4573cdea03df32f06dbf9d0357a17ea3327cde24/chrome/browser/ui/app_list/arc/arc_app_test.cc
[modify] https://crrev.com/4573cdea03df32f06dbf9d0357a17ea3327cde24/chrome/browser/ui/app_list/arc/arc_app_test.h
[modify] https://crrev.com/4573cdea03df32f06dbf9d0357a17ea3327cde24/chrome/browser/ui/app_list/arc/arc_app_utils.cc
[modify] https://crrev.com/4573cdea03df32f06dbf9d0357a17ea3327cde24/chrome/browser/ui/views/arc_app_dialog_view_browsertest.cc
[modify] https://crrev.com/4573cdea03df32f06dbf9d0357a17ea3327cde24/components/arc/arc_service_manager.cc
[modify] https://crrev.com/4573cdea03df32f06dbf9d0357a17ea3327cde24/components/arc/intent_helper/arc_intent_helper_bridge.cc

Project Member

Comment 26 by bugdroid1@chromium.org, Dec 12 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/26b2f7b619d9a83b2151b47ad175ed9e1ecf3ccf

commit 26b2f7b619d9a83b2151b47ad175ed9e1ecf3ccf
Author: hidehiko <hidehiko@chromium.org>
Date: Mon Dec 12 02:27:29 2016

Remove explicit singletonness of ArcBridgeService part 4.

This CL gets rid of using ArcBridgeService::Get() in
arc_robot_auto_code_fetcher_browsertest, by getting rid of
depending of ArcAuthService.

Test for AttemptUserExit is moved to arc_session_manager_unittest.
For that purpose, fixed username_hash for ARC Kiosk fake user.

BUG=657687
BUG=b/31079732
TEST=Ran bots.

Review-Url: https://codereview.chromium.org/2553193002
Cr-Commit-Position: refs/heads/master@{#437811}

[modify] https://crrev.com/26b2f7b619d9a83b2151b47ad175ed9e1ecf3ccf/chrome/browser/chromeos/arc/arc_session_manager.cc
[modify] https://crrev.com/26b2f7b619d9a83b2151b47ad175ed9e1ecf3ccf/chrome/browser/chromeos/arc/arc_session_manager.h
[modify] https://crrev.com/26b2f7b619d9a83b2151b47ad175ed9e1ecf3ccf/chrome/browser/chromeos/arc/arc_session_manager_unittest.cc
[modify] https://crrev.com/26b2f7b619d9a83b2151b47ad175ed9e1ecf3ccf/chrome/browser/chromeos/arc/auth/arc_robot_auth_code_fetcher_browsertest.cc
[modify] https://crrev.com/26b2f7b619d9a83b2151b47ad175ed9e1ecf3ccf/chrome/browser/chromeos/login/users/fake_chrome_user_manager.cc

Project Member

Comment 29 by bugdroid1@chromium.org, Dec 14 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e6d8a9e5c89bacf4b77c5f1ddfa4580741561ed1

commit e6d8a9e5c89bacf4b77c5f1ddfa4580741561ed1
Author: hidehiko <hidehiko@chromium.org>
Date: Wed Dec 14 03:45:08 2016

Reduce FakeArcBridgeService usage.

We'll extract a part of ArcBridgeService to run ArcSession
into a dedicated class. As its preparation, this CL
reduces the usage of FakeArcBridgeService, from where RequestStart()
RequestStop() or OnShutdown() is not used.

Alternatively, ArcBridgeService is now directly instantiated,
if the instance's RequestStart(), RequestStop() or OnShutdown() are
not accessed.

BUG=657687
BUG=b/31079732
TEST=Ran bots.

Review-Url: https://codereview.chromium.org/2571763003
Cr-Commit-Position: refs/heads/master@{#438417}

[modify] https://crrev.com/e6d8a9e5c89bacf4b77c5f1ddfa4580741561ed1/chrome/browser/chromeos/arc/fileapi/arc_content_file_system_async_file_util_unittest.cc
[modify] https://crrev.com/e6d8a9e5c89bacf4b77c5f1ddfa4580741561ed1/chrome/browser/chromeos/arc/fileapi/arc_content_file_system_file_stream_reader_unittest.cc
[modify] https://crrev.com/e6d8a9e5c89bacf4b77c5f1ddfa4580741561ed1/chrome/browser/chromeos/arc/intent_helper/arc_settings_service_browsertest.cc
[modify] https://crrev.com/e6d8a9e5c89bacf4b77c5f1ddfa4580741561ed1/chrome/browser/chromeos/arc/policy/arc_policy_bridge_unittest.cc
[modify] https://crrev.com/e6d8a9e5c89bacf4b77c5f1ddfa4580741561ed1/chrome/browser/memory/tab_manager_delegate_chromeos_unittest.cc
[modify] https://crrev.com/e6d8a9e5c89bacf4b77c5f1ddfa4580741561ed1/components/arc/arc_bridge_service.cc
[modify] https://crrev.com/e6d8a9e5c89bacf4b77c5f1ddfa4580741561ed1/components/arc/arc_bridge_service.h
[modify] https://crrev.com/e6d8a9e5c89bacf4b77c5f1ddfa4580741561ed1/components/arc/bluetooth/arc_bluetooth_bridge_unittest.cc
[modify] https://crrev.com/e6d8a9e5c89bacf4b77c5f1ddfa4580741561ed1/components/arc/ime/arc_ime_service_unittest.cc
[modify] https://crrev.com/e6d8a9e5c89bacf4b77c5f1ddfa4580741561ed1/components/arc/intent_helper/arc_intent_helper_bridge_unittest.cc
[modify] https://crrev.com/e6d8a9e5c89bacf4b77c5f1ddfa4580741561ed1/components/arc/test/fake_arc_bridge_service.cc
[modify] https://crrev.com/e6d8a9e5c89bacf4b77c5f1ddfa4580741561ed1/components/arc/test/fake_arc_bridge_service.h
[modify] https://crrev.com/e6d8a9e5c89bacf4b77c5f1ddfa4580741561ed1/ui/arc/notification/arc_notification_manager_unittest.cc

Project Member

Comment 30 by bugdroid1@chromium.org, Dec 14 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9bc9ba5d39432da1cf6ab12bd8ab5146004fbcc5

commit 9bc9ba5d39432da1cf6ab12bd8ab5146004fbcc5
Author: hidehiko <hidehiko@chromium.org>
Date: Wed Dec 14 09:01:18 2016

Migrate ArcBridgeService::Observer and ArcSession::Observer.

Both are conceptually same. So merge them into ArcSessionObserver.

BUG=657687
BUG=b/31079732
TEST=Ran bots.

Review-Url: https://codereview.chromium.org/2567083002
Cr-Commit-Position: refs/heads/master@{#438467}

[modify] https://crrev.com/9bc9ba5d39432da1cf6ab12bd8ab5146004fbcc5/chrome/browser/chromeos/arc/arc_session_manager.cc
[modify] https://crrev.com/9bc9ba5d39432da1cf6ab12bd8ab5146004fbcc5/chrome/browser/chromeos/arc/arc_session_manager.h
[modify] https://crrev.com/9bc9ba5d39432da1cf6ab12bd8ab5146004fbcc5/chrome/browser/chromeos/arc/notification/arc_boot_error_notification.cc
[modify] https://crrev.com/9bc9ba5d39432da1cf6ab12bd8ab5146004fbcc5/chrome/browser/chromeos/arc/notification/arc_boot_error_notification.h
[modify] https://crrev.com/9bc9ba5d39432da1cf6ab12bd8ab5146004fbcc5/chrome/browser/chromeos/arc/print/arc_print_service.h
[modify] https://crrev.com/9bc9ba5d39432da1cf6ab12bd8ab5146004fbcc5/components/arc/BUILD.gn
[modify] https://crrev.com/9bc9ba5d39432da1cf6ab12bd8ab5146004fbcc5/components/arc/arc_bridge_service.cc
[modify] https://crrev.com/9bc9ba5d39432da1cf6ab12bd8ab5146004fbcc5/components/arc/arc_bridge_service.h
[modify] https://crrev.com/9bc9ba5d39432da1cf6ab12bd8ab5146004fbcc5/components/arc/arc_bridge_service_impl.cc
[modify] https://crrev.com/9bc9ba5d39432da1cf6ab12bd8ab5146004fbcc5/components/arc/arc_bridge_service_impl.h
[modify] https://crrev.com/9bc9ba5d39432da1cf6ab12bd8ab5146004fbcc5/components/arc/arc_bridge_service_unittest.cc
[modify] https://crrev.com/9bc9ba5d39432da1cf6ab12bd8ab5146004fbcc5/components/arc/arc_session.cc
[modify] https://crrev.com/9bc9ba5d39432da1cf6ab12bd8ab5146004fbcc5/components/arc/arc_session.h
[add] https://crrev.com/9bc9ba5d39432da1cf6ab12bd8ab5146004fbcc5/components/arc/arc_session_observer.cc
[add] https://crrev.com/9bc9ba5d39432da1cf6ab12bd8ab5146004fbcc5/components/arc/arc_session_observer.h
[modify] https://crrev.com/9bc9ba5d39432da1cf6ab12bd8ab5146004fbcc5/components/arc/test/fake_arc_session.cc
[modify] https://crrev.com/9bc9ba5d39432da1cf6ab12bd8ab5146004fbcc5/components/arc/test/fake_arc_session.h

Project Member

Comment 31 by bugdroid1@chromium.org, Dec 18 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/10eca614af2ff7e3bc0f37b8f481558a562e10a6

commit 10eca614af2ff7e3bc0f37b8f481558a562e10a6
Author: hidehiko <hidehiko@chromium.org>
Date: Sun Dec 18 17:07:40 2016

Refactor ArcBridgeTest.

This is preparation to split ArcSession running part
from ArcbridgeService.
- Remove friend test declaration, and use public interface only.
- Rework ArcBridgeTest so that we can almost simply rename
  the ArcBridgeServiceImpl.
- Use EXPECT rather than ASSERT.

BUG=657687
BUG=b/31079732
TEST=Ran bots.

Review-Url: https://codereview.chromium.org/2581533004
Cr-Commit-Position: refs/heads/master@{#439373}

[modify] https://crrev.com/10eca614af2ff7e3bc0f37b8f481558a562e10a6/components/arc/arc_bridge_service.h
[modify] https://crrev.com/10eca614af2ff7e3bc0f37b8f481558a562e10a6/components/arc/arc_bridge_service_impl.h
[modify] https://crrev.com/10eca614af2ff7e3bc0f37b8f481558a562e10a6/components/arc/arc_bridge_service_unittest.cc

Project Member

Comment 32 by bugdroid1@chromium.org, Dec 20 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e18e9bcb729ce33f96a7b90c659cb5016bf97dbc

commit e18e9bcb729ce33f96a7b90c659cb5016bf97dbc
Author: hidehiko <hidehiko@chromium.org>
Date: Tue Dec 20 18:28:25 2016

Refactor ArcBridgeServiceImpl part 1.

This CL refactors ArcBridgeServiceImpl focusing on the
retry mechanism.
- With this CL, it starts to use OneShotTimer, which supports
cancel operation.
- Rename "reconnect" to "restart" for wording consistency.
- Introduce restart_delay_ for testing, instead of special
  bool flag. Also, for restarting of testing, get rid of
  synchronous PrerequisitesChanged() call, instead PostTask always.
- Extract StartArcSession() for sharing PrerequisitesChanged()
  and restarting.
- Added more DCHECKs.

BUG=657687
BUG=b/31079732
TEST=Ran bots.

Review-Url: https://codereview.chromium.org/2582003002
Cr-Commit-Position: refs/heads/master@{#439850}

[modify] https://crrev.com/e18e9bcb729ce33f96a7b90c659cb5016bf97dbc/components/arc/arc_bridge_service_impl.cc
[modify] https://crrev.com/e18e9bcb729ce33f96a7b90c659cb5016bf97dbc/components/arc/arc_bridge_service_impl.h
[modify] https://crrev.com/e18e9bcb729ce33f96a7b90c659cb5016bf97dbc/components/arc/arc_bridge_service_unittest.cc

Project Member

Comment 33 by bugdroid1@chromium.org, Dec 20 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/70586e6fd361f66febe643223e61c08caf776c86

commit 70586e6fd361f66febe643223e61c08caf776c86
Author: hidehiko <hidehiko@chromium.org>
Date: Tue Dec 20 20:19:50 2016

Refactor ArcBridgeServiceImpl part 2.

This CL is the preparation to split ArcSession running parts
from ArcBridgeService.
- Rename ArcBridgeService::State names to be consistent with
  terms used in other ARC modules.
- Remove unused CONNECTED from State.
- Migrate PrerequisitesChanged() and StopInstance() into
  RequestStart() and RequestStop().
- Rename some fields of ArcBridgeServiceImpl for consistency.
- Cleaned up include directives.

BUG=657687
BUG=b/31079732
TEST=Ran bots.

Review-Url: https://codereview.chromium.org/2577373002
Cr-Commit-Position: refs/heads/master@{#439875}

[modify] https://crrev.com/70586e6fd361f66febe643223e61c08caf776c86/components/arc/arc_bridge_service.cc
[modify] https://crrev.com/70586e6fd361f66febe643223e61c08caf776c86/components/arc/arc_bridge_service.h
[modify] https://crrev.com/70586e6fd361f66febe643223e61c08caf776c86/components/arc/arc_bridge_service_impl.cc
[modify] https://crrev.com/70586e6fd361f66febe643223e61c08caf776c86/components/arc/arc_bridge_service_impl.h
[modify] https://crrev.com/70586e6fd361f66febe643223e61c08caf776c86/components/arc/test/fake_arc_bridge_service.cc

Project Member

Comment 34 by bugdroid1@chromium.org, Dec 21 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/359b352bc1b60c0de02e27d2373078d17a5473a2

commit 359b352bc1b60c0de02e27d2373078d17a5473a2
Author: hidehiko <hidehiko@chromium.org>
Date: Wed Dec 21 04:49:35 2016

Refactor ArcSessionRunner part 1.

This CL renames ArcBridgeServiceImpl to ArcSessionRunner,
and had  as a preparation to get rid of inheritance.
Along with the change, FakeArcBridgeService is removed
and replaced by ArcSessionRunner + FakeArcSession factory.

TBR=bartfab@chromium.org
BUG=657687
BUG=b/31079732
TEST=Ran bots.

Review-Url: https://codereview.chromium.org/2574013003
Cr-Commit-Position: refs/heads/master@{#440019}

[modify] https://crrev.com/359b352bc1b60c0de02e27d2373078d17a5473a2/chrome/browser/chromeos/arc/arc_session_manager_browsertest.cc
[modify] https://crrev.com/359b352bc1b60c0de02e27d2373078d17a5473a2/chrome/browser/chromeos/arc/arc_session_manager_unittest.cc
[modify] https://crrev.com/359b352bc1b60c0de02e27d2373078d17a5473a2/chrome/browser/policy/policy_browsertest.cc
[modify] https://crrev.com/359b352bc1b60c0de02e27d2373078d17a5473a2/chrome/browser/sync/test/integration/sync_arc_package_helper.cc
[modify] https://crrev.com/359b352bc1b60c0de02e27d2373078d17a5473a2/chrome/browser/ui/app_list/app_context_menu_unittest.cc
[modify] https://crrev.com/359b352bc1b60c0de02e27d2373078d17a5473a2/chrome/browser/ui/app_list/arc/arc_app_test.cc
[modify] https://crrev.com/359b352bc1b60c0de02e27d2373078d17a5473a2/chrome/browser/ui/app_list/arc/arc_app_unittest.cc
[modify] https://crrev.com/359b352bc1b60c0de02e27d2373078d17a5473a2/chrome/browser/ui/app_list/search/app_search_provider_unittest.cc
[modify] https://crrev.com/359b352bc1b60c0de02e27d2373078d17a5473a2/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_ash_unittest.cc
[modify] https://crrev.com/359b352bc1b60c0de02e27d2373078d17a5473a2/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views_unittest.cc
[modify] https://crrev.com/359b352bc1b60c0de02e27d2373078d17a5473a2/components/arc/BUILD.gn
[modify] https://crrev.com/359b352bc1b60c0de02e27d2373078d17a5473a2/components/arc/arc_bridge_service.h
[delete] https://crrev.com/edf25b6144b0d85f851455e00e6aa8d43a1dfb24/components/arc/arc_bridge_service_unittest.cc
[modify] https://crrev.com/359b352bc1b60c0de02e27d2373078d17a5473a2/components/arc/arc_service_manager.cc
[modify] https://crrev.com/359b352bc1b60c0de02e27d2373078d17a5473a2/components/arc/arc_service_manager.h
[rename] https://crrev.com/359b352bc1b60c0de02e27d2373078d17a5473a2/components/arc/arc_session_runner.cc
[rename] https://crrev.com/359b352bc1b60c0de02e27d2373078d17a5473a2/components/arc/arc_session_runner.h
[add] https://crrev.com/359b352bc1b60c0de02e27d2373078d17a5473a2/components/arc/arc_session_runner_unittest.cc
[modify] https://crrev.com/359b352bc1b60c0de02e27d2373078d17a5473a2/components/arc/ime/arc_ime_service_unittest.cc
[delete] https://crrev.com/edf25b6144b0d85f851455e00e6aa8d43a1dfb24/components/arc/test/fake_arc_bridge_service.cc
[delete] https://crrev.com/edf25b6144b0d85f851455e00e6aa8d43a1dfb24/components/arc/test/fake_arc_bridge_service.h
[modify] https://crrev.com/359b352bc1b60c0de02e27d2373078d17a5473a2/ui/arc/notification/arc_notification_manager_unittest.cc

Project Member

Comment 35 by bugdroid1@chromium.org, Dec 21 2016

Project Member

Comment 36 by bugdroid1@chromium.org, Dec 27 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5cc0f2f484ee3475b1f590f9809cea30817efb54

commit 5cc0f2f484ee3475b1f590f9809cea30817efb54
Author: hidehiko <hidehiko@chromium.org>
Date: Tue Dec 27 07:14:24 2016

Move ArcSessionRunner from ArcBridgeService to ArcSessionManager.

With this CL, as named, ArcSessionManager starts to manage
ArcSession.
ArcBridgeService is now simple Arc*Instance mojo object holder.

TBR=bartfab@chromium.org
BUG=657687
BUG=b/31079732
TEST=Ran bots.

Review-Url: https://codereview.chromium.org/2596273002
Cr-Commit-Position: refs/heads/master@{#440737}

[modify] https://crrev.com/5cc0f2f484ee3475b1f590f9809cea30817efb54/chrome/browser/chromeos/arc/arc_service_launcher.cc
[modify] https://crrev.com/5cc0f2f484ee3475b1f590f9809cea30817efb54/chrome/browser/chromeos/arc/arc_session_manager.cc
[modify] https://crrev.com/5cc0f2f484ee3475b1f590f9809cea30817efb54/chrome/browser/chromeos/arc/arc_session_manager.h
[modify] https://crrev.com/5cc0f2f484ee3475b1f590f9809cea30817efb54/chrome/browser/chromeos/arc/arc_session_manager_browsertest.cc
[modify] https://crrev.com/5cc0f2f484ee3475b1f590f9809cea30817efb54/chrome/browser/chromeos/arc/arc_session_manager_unittest.cc
[modify] https://crrev.com/5cc0f2f484ee3475b1f590f9809cea30817efb54/chrome/browser/chromeos/arc/notification/arc_boot_error_notification.cc
[modify] https://crrev.com/5cc0f2f484ee3475b1f590f9809cea30817efb54/chrome/browser/policy/policy_browsertest.cc
[modify] https://crrev.com/5cc0f2f484ee3475b1f590f9809cea30817efb54/chrome/browser/ui/app_list/arc/arc_app_test.cc
[modify] https://crrev.com/5cc0f2f484ee3475b1f590f9809cea30817efb54/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_ash_unittest.cc
[modify] https://crrev.com/5cc0f2f484ee3475b1f590f9809cea30817efb54/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views_unittest.cc
[modify] https://crrev.com/5cc0f2f484ee3475b1f590f9809cea30817efb54/components/arc/arc_bridge_service.cc
[modify] https://crrev.com/5cc0f2f484ee3475b1f590f9809cea30817efb54/components/arc/arc_bridge_service.h
[modify] https://crrev.com/5cc0f2f484ee3475b1f590f9809cea30817efb54/components/arc/arc_service_manager.cc
[modify] https://crrev.com/5cc0f2f484ee3475b1f590f9809cea30817efb54/components/arc/arc_service_manager.h

Project Member

Comment 37 by bugdroid1@chromium.org, Jan 31 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0b75bce63b6fc6a882337f92bb8780ba703efeb8

commit 0b75bce63b6fc6a882337f92bb8780ba703efeb8
Author: hidehiko <hidehiko@chromium.org>
Date: Tue Jan 31 13:13:01 2017

Move more utility functions to arc_util.

ArcSessionManager also as static utility methods
which are not directly related to the class.
This CL extracts them into arc_util.
IsArcAllowedForProfile() is still in chrome/browser/chromeos/arc,
because of its dependency.
Others are in components/arc/.

This is preparation to split state machine inside arc_session_manager.
Also, it's time to add unittest for each.

BUG=657687
BUG=b/31079732
TEST=Ran bots.
TBR=benwells@chromium.org

Review-Url: https://codereview.chromium.org/2642783003
Cr-Commit-Position: refs/heads/master@{#447223}

[modify] https://crrev.com/0b75bce63b6fc6a882337f92bb8780ba703efeb8/chrome/browser/chromeos/BUILD.gn
[modify] https://crrev.com/0b75bce63b6fc6a882337f92bb8780ba703efeb8/chrome/browser/chromeos/arc/arc_auth_service.cc
[modify] https://crrev.com/0b75bce63b6fc6a882337f92bb8780ba703efeb8/chrome/browser/chromeos/arc/arc_session_manager.cc
[modify] https://crrev.com/0b75bce63b6fc6a882337f92bb8780ba703efeb8/chrome/browser/chromeos/arc/arc_session_manager.h
[add] https://crrev.com/0b75bce63b6fc6a882337f92bb8780ba703efeb8/chrome/browser/chromeos/arc/arc_util.cc
[add] https://crrev.com/0b75bce63b6fc6a882337f92bb8780ba703efeb8/chrome/browser/chromeos/arc/arc_util.h
[add] https://crrev.com/0b75bce63b6fc6a882337f92bb8780ba703efeb8/chrome/browser/chromeos/arc/arc_util_unittest.cc
[modify] https://crrev.com/0b75bce63b6fc6a882337f92bb8780ba703efeb8/chrome/browser/chromeos/extensions/file_manager/event_router.cc
[modify] https://crrev.com/0b75bce63b6fc6a882337f92bb8780ba703efeb8/chrome/browser/chromeos/extensions/info_private_api.cc
[modify] https://crrev.com/0b75bce63b6fc6a882337f92bb8780ba703efeb8/chrome/browser/chromeos/extensions/info_private_apitest.cc
[modify] https://crrev.com/0b75bce63b6fc6a882337f92bb8780ba703efeb8/chrome/browser/chromeos/file_manager/volume_manager.cc
[modify] https://crrev.com/0b75bce63b6fc6a882337f92bb8780ba703efeb8/chrome/browser/chromeos/login/wizard_controller.cc
[modify] https://crrev.com/0b75bce63b6fc6a882337f92bb8780ba703efeb8/chrome/browser/chromeos/note_taking_helper.cc
[modify] https://crrev.com/0b75bce63b6fc6a882337f92bb8780ba703efeb8/chrome/browser/ui/app_list/app_list_syncable_service.cc
[modify] https://crrev.com/0b75bce63b6fc6a882337f92bb8780ba703efeb8/chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc
[modify] https://crrev.com/0b75bce63b6fc6a882337f92bb8780ba703efeb8/chrome/browser/ui/app_list/arc/arc_app_list_prefs_factory.cc
[modify] https://crrev.com/0b75bce63b6fc6a882337f92bb8780ba703efeb8/chrome/browser/ui/app_list/arc/arc_package_sync_data_type_controller.cc
[modify] https://crrev.com/0b75bce63b6fc6a882337f92bb8780ba703efeb8/chrome/browser/ui/app_list/search/app_search_provider.cc
[modify] https://crrev.com/0b75bce63b6fc6a882337f92bb8780ba703efeb8/chrome/browser/ui/ash/launcher/arc_app_deferred_launcher_controller.cc
[modify] https://crrev.com/0b75bce63b6fc6a882337f92bb8780ba703efeb8/chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.cc
[modify] https://crrev.com/0b75bce63b6fc6a882337f92bb8780ba703efeb8/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc
[modify] https://crrev.com/0b75bce63b6fc6a882337f92bb8780ba703efeb8/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.cc
[modify] https://crrev.com/0b75bce63b6fc6a882337f92bb8780ba703efeb8/chrome/browser/ui/ash/launcher/launcher_controller_helper.cc
[modify] https://crrev.com/0b75bce63b6fc6a882337f92bb8780ba703efeb8/chrome/browser/ui/extensions/app_launch_params.cc
[modify] https://crrev.com/0b75bce63b6fc6a882337f92bb8780ba703efeb8/chrome/browser/ui/webui/options/browser_options_handler.cc
[modify] https://crrev.com/0b75bce63b6fc6a882337f92bb8780ba703efeb8/chrome/browser/ui/webui/options/chromeos/storage_manager_handler.cc
[modify] https://crrev.com/0b75bce63b6fc6a882337f92bb8780ba703efeb8/chrome/browser/ui/webui/settings/chromeos/android_apps_handler.cc
[modify] https://crrev.com/0b75bce63b6fc6a882337f92bb8780ba703efeb8/chrome/browser/ui/webui/settings/chromeos/device_storage_handler.cc
[modify] https://crrev.com/0b75bce63b6fc6a882337f92bb8780ba703efeb8/chrome/browser/ui/webui/settings/md_settings_ui.cc
[modify] https://crrev.com/0b75bce63b6fc6a882337f92bb8780ba703efeb8/components/arc/arc_util.cc
[modify] https://crrev.com/0b75bce63b6fc6a882337f92bb8780ba703efeb8/components/arc/arc_util.h
[modify] https://crrev.com/0b75bce63b6fc6a882337f92bb8780ba703efeb8/components/arc/arc_util_unittest.cc
[modify] https://crrev.com/0b75bce63b6fc6a882337f92bb8780ba703efeb8/components/arc/intent_helper/arc_intent_helper_bridge.cc

Sheriff here. I'm about to land a revert for the CL in #37. The newly added test ChromeArcUtilTest.IsArcAllowedForProfile_SupervisedUserFlow fails on the Chrome OS ASan bots.

See example failure:

https://luci-milo.appspot.com/buildbot/chromium.memory/Linux%20Chromium%20OS%20ASan%20LSan%20Tests%20%281%29/19296

Leak information from logs:

Direct leak of 72 byte(s) in 1 object(s) allocated from:
    #0 0xb721eb in operator new(unsigned long) (/b/s/w/irKoBCB5/out/Release/unit_tests+0xb721eb)
    #1 0x5bf85da in arc::util::ChromeArcUtilTest_IsArcAllowedForProfile_SupervisedUserFlow_Test::TestBody() chrome/browser/chromeos/arc/arc_util_unittest.cc:172:19
    #2 0xe57c8ac in HandleExceptionsInMethodIfSupported<testing::Test, void> testing/gtest/src/gtest.cc:2458:12
    #3 0xe57c8ac in testing::Test::Run() testing/gtest/src/gtest.cc:2474
    #4 0xe57ea44 in testing::TestInfo::Run() testing/gtest/src/gtest.cc:2656:11
    #5 0xe57f6f6 in testing::TestCase::Run() testing/gtest/src/gtest.cc:2774:28
    #6 0xe593d76 in testing::internal::UnitTestImpl::RunAllTests() testing/gtest/src/gtest.cc:4647:43
    #7 0xe5932f9 in HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> testing/gtest/src/gtest.cc:2458:12
    #8 0xe5932f9 in testing::UnitTest::Run() testing/gtest/src/gtest.cc:4255
    #9 0xd7c3a18 in RUN_ALL_TESTS testing/gtest/include/gtest/gtest.h:2237:46
    #10 0xd7c3a18 in base::TestSuite::Run() base/test/test_suite.cc:271
    #11 0xd7c8778 in Run base/callback.h:85:12
    #12 0xd7c8778 in base::(anonymous namespace)::LaunchUnitTestsInternal(base::Callback<int (), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> const&, int, int, bool, base::Callback<void (), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> const&) base/test/launcher/unit_test_launcher.cc:211
    #13 0xd7c8236 in base::LaunchUnitTests(int, char**, base::Callback<int (), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> const&) base/test/launcher/unit_test_launcher.cc:453:10
    #14 0xd7a98a3 in main chrome/test/base/run_all_unittests.cc:21:10
    #15 0x7fae2e2f67ec in __libc_start_main /build/eglibc-oqps9y/eglibc-2.15/csu/libc-start.c:226
go ahead
Project Member

Comment 40 by bugdroid1@chromium.org, Feb 8 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/32e8ee260dfbd9c3da830f2c9cde9eddadfaf40f

commit 32e8ee260dfbd9c3da830f2c9cde9eddadfaf40f
Author: hidehiko <hidehiko@chromium.org>
Date: Wed Feb 08 02:56:43 2017

Get rid of sync_preferences::SyncedPrefObserver inheritance.

ArcSessionManager inherits SyncedPrefObserver, but it is not
used now, because kArcEnabled is not sync pref.
The callback is called from OnOptInPreferenceChanged() only,
so this CL inlines the function to there.

This is preparation to extract preference handling from
ArcSessionManager into a dedicated class.

BUG=657687
BUG=b/31079732
TEST=Ran bots. Made sure "removing pinned icon from shelf" works manually.

Review-Url: https://codereview.chromium.org/2683613002
Cr-Commit-Position: refs/heads/master@{#448878}

[modify] https://crrev.com/32e8ee260dfbd9c3da830f2c9cde9eddadfaf40f/chrome/browser/chromeos/arc/arc_session_manager.cc
[modify] https://crrev.com/32e8ee260dfbd9c3da830f2c9cde9eddadfaf40f/chrome/browser/chromeos/arc/arc_session_manager.h
[modify] https://crrev.com/32e8ee260dfbd9c3da830f2c9cde9eddadfaf40f/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_unittest.cc

Project Member

Comment 41 by bugdroid1@chromium.org, Feb 16 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8983a9ebba43f3935f7e1481022f4865e6c5c5bd

commit 8983a9ebba43f3935f7e1481022f4865e6c5c5bd
Author: hidehiko <hidehiko@chromium.org>
Date: Thu Feb 16 03:23:36 2017

Remove ArcSessionManager::Observer::OnArcBridgeShutdown.

The method is;
- Used only in one browser test.
- It is not called on ArcBridgeShutdown, but on beginning of
  ARC session stopping.
So, its name is not what it is.
Because the browser test can be rewritten with another callback,
so this CL removes the method.

BUG=657687
BUG=b/31079732
TEST=Ran trybots.

Review-Url: https://codereview.chromium.org/2692993007
Cr-Commit-Position: refs/heads/master@{#450856}

[modify] https://crrev.com/8983a9ebba43f3935f7e1481022f4865e6c5c5bd/chrome/browser/chromeos/arc/arc_session_manager.cc
[modify] https://crrev.com/8983a9ebba43f3935f7e1481022f4865e6c5c5bd/chrome/browser/chromeos/arc/arc_session_manager.h
[modify] https://crrev.com/8983a9ebba43f3935f7e1481022f4865e6c5c5bd/chrome/browser/chromeos/arc/arc_session_manager_browsertest.cc

Project Member

Comment 42 by bugdroid1@chromium.org, Feb 16 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f6655f54e44faf766d0a3dd6f67524bc0548e2c9

commit f6655f54e44faf766d0a3dd6f67524bc0548e2c9
Author: hidehiko <hidehiko@chromium.org>
Date: Thu Feb 16 17:23:54 2017

Split IsArcPlayStoreEnabled() and ArcSessionManager's enabled concepts.

This CL refactors ArcSessionManager internally.
This CL introduces |enabled_| and Enable()/Disable() methods to
the ArcSessionManager, by extracting code from OnOptInPreferenceChanged().

BUG=657687
BUG=b/31079732
TEST=Ran trybots.

Review-Url: https://codereview.chromium.org/2695113004
Cr-Commit-Position: refs/heads/master@{#451003}

[modify] https://crrev.com/f6655f54e44faf766d0a3dd6f67524bc0548e2c9/chrome/browser/chromeos/arc/arc_session_manager.cc
[modify] https://crrev.com/f6655f54e44faf766d0a3dd6f67524bc0548e2c9/chrome/browser/chromeos/arc/arc_session_manager.h
[modify] https://crrev.com/f6655f54e44faf766d0a3dd6f67524bc0548e2c9/chrome/browser/chromeos/note_taking_helper_unittest.cc

Cc: yusukes@chromium.org
Project Member

Comment 44 by bugdroid1@chromium.org, Feb 23 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/653559e3d446669fe50661afb09ffdc464a37c5c

commit 653559e3d446669fe50661afb09ffdc464a37c5c
Author: hidehiko <hidehiko@chromium.org>
Date: Thu Feb 23 03:06:10 2017

Add DCHECK to make sure Profile instance is same.

The Profile instance owned by ArcAppListPrefs and
ArcSessionManager::profile() must be same.
This CL adds the DCHECK.

During the test, it turned out that ARC is enabled for
unexpected tests.
As a result, ArcAppListPrefs is expected to be alive at most
one instance (for Primary user Profile), but many instances
are created. Such tests are not designed to use ARC,
so disable ARC for them to pass them.

The command_line flag is moved from sync_arc_package_helper.cc.
However, tests using sync_arc_package_helper are currently
failing ( crbug.com/694261 ), and redesign looks needed.
Thus, this CL leaves those tests as is. In future, probably
with fixing the bug, the flag needs to be added there.

BUG= 694261 
BUG=657687
BUG=b/31079732
TEST=Ran trybots.

Review-Url: https://codereview.chromium.org/2708693002
Cr-Commit-Position: refs/heads/master@{#452366}

[modify] https://crrev.com/653559e3d446669fe50661afb09ffdc464a37c5c/chrome/browser/sync/test/integration/sync_test.cc
[modify] https://crrev.com/653559e3d446669fe50661afb09ffdc464a37c5c/chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc

Project Member

Comment 45 by bugdroid1@chromium.org, Feb 23 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0846083cfdbea5d902953540a4220599eb0fe9e1

commit 0846083cfdbea5d902953540a4220599eb0fe9e1
Author: hidehiko <hidehiko@chromium.org>
Date: Thu Feb 23 05:10:18 2017

Extract kArcEnabled preference from ArcSessionManager part 1.

This CL extracts following methods:
- IsArcPlayStoreEnabled() -> IsArcPlayStoreEnabledForProfile()
- IsArcManaged() -> IsArcPlayStoreEnabledPreferenceManagedForProfile()
- SetArcPlayStoreEnabled() -> SetArcPlayStoreEnabledForProfile()

New functions takes Profile as its arguments explicitly, instead of
acting to the primary user Profile implicitly.

BUG=657687
BUG=b/31079732
TEST=Ran trybots.

Review-Url: https://codereview.chromium.org/2702723002
Cr-Commit-Position: refs/heads/master@{#452400}

[modify] https://crrev.com/0846083cfdbea5d902953540a4220599eb0fe9e1/chrome/browser/chrome_content_browser_client.cc
[modify] https://crrev.com/0846083cfdbea5d902953540a4220599eb0fe9e1/chrome/browser/chromeos/arc/arc_auth_notification.cc
[modify] https://crrev.com/0846083cfdbea5d902953540a4220599eb0fe9e1/chrome/browser/chromeos/arc/arc_session_manager.cc
[modify] https://crrev.com/0846083cfdbea5d902953540a4220599eb0fe9e1/chrome/browser/chromeos/arc/arc_session_manager.h
[modify] https://crrev.com/0846083cfdbea5d902953540a4220599eb0fe9e1/chrome/browser/chromeos/arc/arc_session_manager_unittest.cc
[modify] https://crrev.com/0846083cfdbea5d902953540a4220599eb0fe9e1/chrome/browser/chromeos/arc/arc_util.cc
[modify] https://crrev.com/0846083cfdbea5d902953540a4220599eb0fe9e1/chrome/browser/chromeos/arc/arc_util.h
[modify] https://crrev.com/0846083cfdbea5d902953540a4220599eb0fe9e1/chrome/browser/chromeos/arc/arc_util_unittest.cc
[modify] https://crrev.com/0846083cfdbea5d902953540a4220599eb0fe9e1/chrome/browser/chromeos/arc/fileapi/arc_file_system_operation_runner.cc
[modify] https://crrev.com/0846083cfdbea5d902953540a4220599eb0fe9e1/chrome/browser/chromeos/extensions/wallpaper_manager_util.cc
[modify] https://crrev.com/0846083cfdbea5d902953540a4220599eb0fe9e1/chrome/browser/chromeos/file_manager/volume_manager.cc
[modify] https://crrev.com/0846083cfdbea5d902953540a4220599eb0fe9e1/chrome/browser/chromeos/note_taking_helper.cc
[modify] https://crrev.com/0846083cfdbea5d902953540a4220599eb0fe9e1/chrome/browser/extensions/api/feedback_private/feedback_private_api.cc
[modify] https://crrev.com/0846083cfdbea5d902953540a4220599eb0fe9e1/chrome/browser/sync/test/integration/sync_arc_package_helper.cc
[modify] https://crrev.com/0846083cfdbea5d902953540a4220599eb0fe9e1/chrome/browser/ui/app_list/app_list_syncable_service.cc
[modify] https://crrev.com/0846083cfdbea5d902953540a4220599eb0fe9e1/chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc
[modify] https://crrev.com/0846083cfdbea5d902953540a4220599eb0fe9e1/chrome/browser/ui/app_list/arc/arc_app_model_builder.cc
[modify] https://crrev.com/0846083cfdbea5d902953540a4220599eb0fe9e1/chrome/browser/ui/app_list/arc/arc_app_test.cc
[modify] https://crrev.com/0846083cfdbea5d902953540a4220599eb0fe9e1/chrome/browser/ui/app_list/arc/arc_app_unittest.cc
[modify] https://crrev.com/0846083cfdbea5d902953540a4220599eb0fe9e1/chrome/browser/ui/app_list/arc/arc_app_utils.cc
[modify] https://crrev.com/0846083cfdbea5d902953540a4220599eb0fe9e1/chrome/browser/ui/ash/launcher/arc_app_launcher_browsertest.cc
[modify] https://crrev.com/0846083cfdbea5d902953540a4220599eb0fe9e1/chrome/browser/ui/ash/launcher/arc_playstore_shortcut_launcher_item_controller.cc
[modify] https://crrev.com/0846083cfdbea5d902953540a4220599eb0fe9e1/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_unittest.cc
[modify] https://crrev.com/0846083cfdbea5d902953540a4220599eb0fe9e1/chrome/browser/ui/ash/launcher/launcher_controller_helper.cc
[modify] https://crrev.com/0846083cfdbea5d902953540a4220599eb0fe9e1/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.cc
[modify] https://crrev.com/0846083cfdbea5d902953540a4220599eb0fe9e1/chrome/browser/ui/views/arc_app_dialog_view_browsertest.cc
[modify] https://crrev.com/0846083cfdbea5d902953540a4220599eb0fe9e1/chrome/browser/ui/webui/options/browser_options_handler.cc
[modify] https://crrev.com/0846083cfdbea5d902953540a4220599eb0fe9e1/chrome/browser/ui/webui/options/chromeos/storage_manager_handler.cc
[modify] https://crrev.com/0846083cfdbea5d902953540a4220599eb0fe9e1/chrome/browser/ui/webui/settings/chromeos/android_apps_handler.cc
[modify] https://crrev.com/0846083cfdbea5d902953540a4220599eb0fe9e1/chrome/browser/ui/webui/settings/chromeos/device_storage_handler.cc
[modify] https://crrev.com/0846083cfdbea5d902953540a4220599eb0fe9e1/chrome/common/pref_names.cc

Project Member

Comment 46 by bugdroid1@chromium.org, Feb 23 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8514e79471d9dfa4a9376317b86f45b57e11eea6

commit 8514e79471d9dfa4a9376317b86f45b57e11eea6
Author: nya <nya@chromium.org>
Date: Thu Feb 23 09:29:56 2017

mediaview: Fix ARC file system operation deferring.

After recent changes of ARC startup refactoring (crbug.com/657687), ARC
file system operation deferring of media views was broken.

Formerly ArcFileSystemOperationRunner was constructed in
ArcServiceLauncher::Initialize(), which happens before a primary profile
is created. Thus it was wrong to check ARC opt-in status in its
constructor. Nevertheless it seemed to work because
ArcFileSystemOperationRunner::OnArcPlayStoreEnabledChanged() was always
called soon after login, which is no longer the case after the
refactoring.

This patch moves the construction of ArcFileSystemOperationRunner to
ArcServiceLauncher::OnPrimaryUserProfilePrepared() and passes Profile to
ArcFileSystemOperationRunner explicitly.

Due to this change, ARC file operations issued before a primary profile
gets ready are dropped, but we do not expect such operations. But just
in case, we emit error logs in such cases.

BUG= chromium:695358 
BUG=chromium:657687
TEST=unit_tests
TEST=No "operations are dropped" lines in /var/log/ui/ui.LATEST

Review-Url: https://codereview.chromium.org/2704123007
Cr-Commit-Position: refs/heads/master@{#452441}

[modify] https://crrev.com/8514e79471d9dfa4a9376317b86f45b57e11eea6/chrome/browser/chromeos/arc/arc_service_launcher.cc
[modify] https://crrev.com/8514e79471d9dfa4a9376317b86f45b57e11eea6/chrome/browser/chromeos/arc/fileapi/arc_file_system_operation_runner.cc
[modify] https://crrev.com/8514e79471d9dfa4a9376317b86f45b57e11eea6/chrome/browser/chromeos/arc/fileapi/arc_file_system_operation_runner.h
[modify] https://crrev.com/8514e79471d9dfa4a9376317b86f45b57e11eea6/chrome/browser/chromeos/arc/fileapi/arc_file_system_operation_runner_util.cc

Project Member

Comment 47 by bugdroid1@chromium.org, Feb 23 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5cb64f9cf9fbe97e44fdedaf319308768424f62e

commit 5cb64f9cf9fbe97e44fdedaf319308768424f62e
Author: hidehiko <hidehiko@chromium.org>
Date: Thu Feb 23 19:16:34 2017

Split ArcAuthNotification UI control flag from ArcSessionManager.

ArcSessionManager is now depending on ArcAuthNotification.
In a later CL, it will be extracted into another new class.
As its preparation, this CL extracts the "disabling for testing"
code into the class.

BUG=657687
BUG=b/31079732
TEST=Ran trybots.

Review-Url: https://codereview.chromium.org/2709393003
Cr-Commit-Position: refs/heads/master@{#452577}

[modify] https://crrev.com/5cb64f9cf9fbe97e44fdedaf319308768424f62e/chrome/browser/chromeos/arc/arc_auth_notification.cc
[modify] https://crrev.com/5cb64f9cf9fbe97e44fdedaf319308768424f62e/chrome/browser/chromeos/arc/arc_auth_notification.h
[modify] https://crrev.com/5cb64f9cf9fbe97e44fdedaf319308768424f62e/chrome/browser/chromeos/arc/arc_session_manager.cc

Owner: hidehiko@chromium.org
At this point it doesn't make sense for me to own the bug since my part is finished and hidehiko@ has been doing the vast majority of it. Assigning to him so he gets the satisfaction of closing the bug :)
Project Member

Comment 49 by bugdroid1@chromium.org, Feb 23 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/74be432e0e54671c12f63a8a6fd30cd49687e8c2

commit 74be432e0e54671c12f63a8a6fd30cd49687e8c2
Author: hidehiko <hidehiko@chromium.org>
Date: Thu Feb 23 19:20:25 2017

Split DisabledForEphemeralDataUsers tests into ChromeArcUtilTest.

The test case is for IsArcAllowedForProfile().
This CL splits it into several test cases, and test each.

BUG=657687
BUG=b/31079732
TEST=Ran trybots.

Review-Url: https://codereview.chromium.org/2710273002
Cr-Commit-Position: refs/heads/master@{#452579}

[modify] https://crrev.com/74be432e0e54671c12f63a8a6fd30cd49687e8c2/chrome/browser/chromeos/arc/arc_session_manager_unittest.cc
[modify] https://crrev.com/74be432e0e54671c12f63a8a6fd30cd49687e8c2/chrome/browser/chromeos/arc/arc_util_unittest.cc

Project Member

Comment 50 by bugdroid1@chromium.org, Feb 24 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a3397e3e75e6338d188b713f36593c54c0b2b469

commit a3397e3e75e6338d188b713f36593c54c0b2b469
Author: hidehiko <hidehiko@chromium.org>
Date: Fri Feb 24 06:19:47 2017

Remove ArcSessionManager::SetShelfDelegateForTesting.

This CL removes the injecting method for testing.
Instead, in testing, use WmShell::SetShelfDelegateForTesting,
only when needed.

BUG=657687
BUG=b/31079732
TEST=Ran trybots.

Review-Url: https://codereview.chromium.org/2708353007
Cr-Commit-Position: refs/heads/master@{#452771}

[modify] https://crrev.com/a3397e3e75e6338d188b713f36593c54c0b2b469/chrome/browser/chromeos/arc/arc_session_manager.cc
[modify] https://crrev.com/a3397e3e75e6338d188b713f36593c54c0b2b469/chrome/browser/chromeos/arc/arc_session_manager.h
[modify] https://crrev.com/a3397e3e75e6338d188b713f36593c54c0b2b469/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_unittest.cc

Project Member

Comment 51 by bugdroid1@chromium.org, Feb 28 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2ad9932506a578cd937848e2c7b2904ee4d67268

commit 2ad9932506a578cd937848e2c7b2904ee4d67268
Author: hidehiko <hidehiko@chromium.org>
Date: Tue Feb 28 18:07:40 2017

Split ArcSessionManager::OnPrimaryUserProfilePrepared().

The operations in the method can be categorlized into two groups:
1) Set Profile instance and instantiate several objects
  which depends on the Profile instnace.
2) Start observing arc.enabled preference, and sets initial state
  based on its initial value.

This CL splits the method into them. 1) is SetProfile() and 2) is
StartPreferenceHandler().
For that perspective, IsArcAllowedForProfile() check is moved
into ArcServiceLauncher::OnPrimaryUserProfilePrepared(), which is
the only caller of the original
ArcSessionManager::OnPrimaryUserProfilePrepared().

Along with the change, tests, specifically ArcSessionManagerTests
are rewritten.

BUG=657687
BUG=b/31079732
TEST=Ran trybots.

Review-Url: https://codereview.chromium.org/2708923013
Cr-Commit-Position: refs/heads/master@{#453640}

[modify] https://crrev.com/2ad9932506a578cd937848e2c7b2904ee4d67268/chrome/browser/chromeos/arc/arc_service_launcher.cc
[modify] https://crrev.com/2ad9932506a578cd937848e2c7b2904ee4d67268/chrome/browser/chromeos/arc/arc_session_manager.cc
[modify] https://crrev.com/2ad9932506a578cd937848e2c7b2904ee4d67268/chrome/browser/chromeos/arc/arc_session_manager.h
[modify] https://crrev.com/2ad9932506a578cd937848e2c7b2904ee4d67268/chrome/browser/chromeos/arc/arc_session_manager_unittest.cc
[modify] https://crrev.com/2ad9932506a578cd937848e2c7b2904ee4d67268/chrome/browser/sync/test/integration/sync_arc_package_helper.cc
[modify] https://crrev.com/2ad9932506a578cd937848e2c7b2904ee4d67268/chrome/browser/ui/app_list/arc/arc_app_test.cc
[modify] https://crrev.com/2ad9932506a578cd937848e2c7b2904ee4d67268/chrome/browser/ui/ash/launcher/arc_app_launcher_browsertest.cc
[modify] https://crrev.com/2ad9932506a578cd937848e2c7b2904ee4d67268/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_unittest.cc
[modify] https://crrev.com/2ad9932506a578cd937848e2c7b2904ee4d67268/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_ash_unittest.cc

Project Member

Comment 52 by bugdroid1@chromium.org, Mar 1 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ae82e3ad7862628f263303d750ee7e1ac5775219

commit ae82e3ad7862628f263303d750ee7e1ac5775219
Author: hidehiko <hidehiko@chromium.org>
Date: Wed Mar 01 20:05:39 2017

Do nothing on OnSessionStopped if ARC is being restarted.

ArcSessionManager::OnSessionStopped() implements operations
running on ARC session is stopped.
However, ArcSessionRunner supports automatic restarting,
and the function does not expect such cases, so that state
machine gets into a wrong state.

Along with the behavior change, unifies the observers
for ArcSessionManager.

BUG=657687
BUG=636218
BUG= 633258 
TEST=Ran bots.

Review-Url: https://codereview.chromium.org/2720303002
Cr-Commit-Position: refs/heads/master@{#454007}

[modify] https://crrev.com/ae82e3ad7862628f263303d750ee7e1ac5775219/chrome/browser/chromeos/arc/arc_session_manager.cc
[modify] https://crrev.com/ae82e3ad7862628f263303d750ee7e1ac5775219/chrome/browser/chromeos/arc/arc_session_manager.h
[modify] https://crrev.com/ae82e3ad7862628f263303d750ee7e1ac5775219/chrome/browser/chromeos/arc/notification/arc_boot_error_notification.cc
[modify] https://crrev.com/ae82e3ad7862628f263303d750ee7e1ac5775219/chrome/browser/chromeos/arc/notification/arc_boot_error_notification.h
[modify] https://crrev.com/ae82e3ad7862628f263303d750ee7e1ac5775219/components/arc/BUILD.gn
[modify] https://crrev.com/ae82e3ad7862628f263303d750ee7e1ac5775219/components/arc/arc_session.cc
[modify] https://crrev.com/ae82e3ad7862628f263303d750ee7e1ac5775219/components/arc/arc_session.h
[delete] https://crrev.com/b2d4d4ba555e4658e5b2ea2ba4cbd9b95ac84442/components/arc/arc_session_observer.cc
[delete] https://crrev.com/b2d4d4ba555e4658e5b2ea2ba4cbd9b95ac84442/components/arc/arc_session_observer.h
[modify] https://crrev.com/ae82e3ad7862628f263303d750ee7e1ac5775219/components/arc/arc_session_runner.cc
[modify] https://crrev.com/ae82e3ad7862628f263303d750ee7e1ac5775219/components/arc/arc_session_runner.h
[modify] https://crrev.com/ae82e3ad7862628f263303d750ee7e1ac5775219/components/arc/arc_session_runner_unittest.cc
[add] https://crrev.com/ae82e3ad7862628f263303d750ee7e1ac5775219/components/arc/arc_stop_reason.cc
[add] https://crrev.com/ae82e3ad7862628f263303d750ee7e1ac5775219/components/arc/arc_stop_reason.h
[modify] https://crrev.com/ae82e3ad7862628f263303d750ee7e1ac5775219/components/arc/test/fake_arc_session.cc
[modify] https://crrev.com/ae82e3ad7862628f263303d750ee7e1ac5775219/components/arc/test/fake_arc_session.h

Project Member

Comment 53 by bugdroid1@chromium.org, Mar 2 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f6f68f0cde9cde5b35b4f13bb5933d0166e64173

commit f6f68f0cde9cde5b35b4f13bb5933d0166e64173
Author: hidehiko <hidehiko@chromium.org>
Date: Thu Mar 02 23:55:15 2017

Extract kArcEnabled preference from ArcSessionManager part 2.

This extracts ArcPlayStoreEnabledPreferenceHandler from
ArcSessionManager.
The new class observes preference change, and notifies ArcSessionManager.
With this extraction, ArcSessionManager is no longer depends on
Google Play Store enabled preference.
The extraction makes ArcSessionManager's focus clearer. More clean up allow us for better testing.
Also, this is towards to ARC on login screen and pARC world.

This CL extracts the dependency to ArcAuthNotification from
ArcSessionManager and moved to ArcPlayStoreEnabledPreferenceHandler, too.
So, ArcAuthNotification::DisableForTesting is also extracted from
ArcSessionManager::DisableUIForTesting. Each test has responsibility
to call them individually if necessary.

BUG=657687
BUG=b/31079732
TEST=Ran trybots. Still boot ARC.

Review-Url: https://codereview.chromium.org/2723073002
Cr-Commit-Position: refs/heads/master@{#454441}

[modify] https://crrev.com/f6f68f0cde9cde5b35b4f13bb5933d0166e64173/chrome/browser/chromeos/BUILD.gn
[add] https://crrev.com/f6f68f0cde9cde5b35b4f13bb5933d0166e64173/chrome/browser/chromeos/arc/arc_play_store_enabled_preference_handler.cc
[add] https://crrev.com/f6f68f0cde9cde5b35b4f13bb5933d0166e64173/chrome/browser/chromeos/arc/arc_play_store_enabled_preference_handler.h
[add] https://crrev.com/f6f68f0cde9cde5b35b4f13bb5933d0166e64173/chrome/browser/chromeos/arc/arc_play_store_enabled_preference_handler_unittest.cc
[modify] https://crrev.com/f6f68f0cde9cde5b35b4f13bb5933d0166e64173/chrome/browser/chromeos/arc/arc_service_launcher.cc
[modify] https://crrev.com/f6f68f0cde9cde5b35b4f13bb5933d0166e64173/chrome/browser/chromeos/arc/arc_service_launcher.h
[modify] https://crrev.com/f6f68f0cde9cde5b35b4f13bb5933d0166e64173/chrome/browser/chromeos/arc/arc_session_manager.cc
[modify] https://crrev.com/f6f68f0cde9cde5b35b4f13bb5933d0166e64173/chrome/browser/chromeos/arc/arc_session_manager.h
[modify] https://crrev.com/f6f68f0cde9cde5b35b4f13bb5933d0166e64173/chrome/browser/chromeos/arc/arc_session_manager_browsertest.cc
[modify] https://crrev.com/f6f68f0cde9cde5b35b4f13bb5933d0166e64173/chrome/browser/chromeos/arc/arc_session_manager_unittest.cc
[modify] https://crrev.com/f6f68f0cde9cde5b35b4f13bb5933d0166e64173/chrome/browser/sync/test/integration/sync_arc_package_helper.cc
[modify] https://crrev.com/f6f68f0cde9cde5b35b4f13bb5933d0166e64173/chrome/browser/ui/app_list/arc/arc_app_test.cc
[modify] https://crrev.com/f6f68f0cde9cde5b35b4f13bb5933d0166e64173/chrome/browser/ui/app_list/arc/arc_app_test.h
[modify] https://crrev.com/f6f68f0cde9cde5b35b4f13bb5933d0166e64173/chrome/browser/ui/ash/launcher/arc_app_launcher_browsertest.cc
[modify] https://crrev.com/f6f68f0cde9cde5b35b4f13bb5933d0166e64173/chrome/browser/ui/views/arc_app_dialog_view_browsertest.cc

Project Member

Comment 54 by bugdroid1@chromium.org, Mar 2 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f6f68f0cde9cde5b35b4f13bb5933d0166e64173

commit f6f68f0cde9cde5b35b4f13bb5933d0166e64173
Author: hidehiko <hidehiko@chromium.org>
Date: Thu Mar 02 23:55:15 2017

Extract kArcEnabled preference from ArcSessionManager part 2.

This extracts ArcPlayStoreEnabledPreferenceHandler from
ArcSessionManager.
The new class observes preference change, and notifies ArcSessionManager.
With this extraction, ArcSessionManager is no longer depends on
Google Play Store enabled preference.
The extraction makes ArcSessionManager's focus clearer. More clean up allow us for better testing.
Also, this is towards to ARC on login screen and pARC world.

This CL extracts the dependency to ArcAuthNotification from
ArcSessionManager and moved to ArcPlayStoreEnabledPreferenceHandler, too.
So, ArcAuthNotification::DisableForTesting is also extracted from
ArcSessionManager::DisableUIForTesting. Each test has responsibility
to call them individually if necessary.

BUG=657687
BUG=b/31079732
TEST=Ran trybots. Still boot ARC.

Review-Url: https://codereview.chromium.org/2723073002
Cr-Commit-Position: refs/heads/master@{#454441}

[modify] https://crrev.com/f6f68f0cde9cde5b35b4f13bb5933d0166e64173/chrome/browser/chromeos/BUILD.gn
[add] https://crrev.com/f6f68f0cde9cde5b35b4f13bb5933d0166e64173/chrome/browser/chromeos/arc/arc_play_store_enabled_preference_handler.cc
[add] https://crrev.com/f6f68f0cde9cde5b35b4f13bb5933d0166e64173/chrome/browser/chromeos/arc/arc_play_store_enabled_preference_handler.h
[add] https://crrev.com/f6f68f0cde9cde5b35b4f13bb5933d0166e64173/chrome/browser/chromeos/arc/arc_play_store_enabled_preference_handler_unittest.cc
[modify] https://crrev.com/f6f68f0cde9cde5b35b4f13bb5933d0166e64173/chrome/browser/chromeos/arc/arc_service_launcher.cc
[modify] https://crrev.com/f6f68f0cde9cde5b35b4f13bb5933d0166e64173/chrome/browser/chromeos/arc/arc_service_launcher.h
[modify] https://crrev.com/f6f68f0cde9cde5b35b4f13bb5933d0166e64173/chrome/browser/chromeos/arc/arc_session_manager.cc
[modify] https://crrev.com/f6f68f0cde9cde5b35b4f13bb5933d0166e64173/chrome/browser/chromeos/arc/arc_session_manager.h
[modify] https://crrev.com/f6f68f0cde9cde5b35b4f13bb5933d0166e64173/chrome/browser/chromeos/arc/arc_session_manager_browsertest.cc
[modify] https://crrev.com/f6f68f0cde9cde5b35b4f13bb5933d0166e64173/chrome/browser/chromeos/arc/arc_session_manager_unittest.cc
[modify] https://crrev.com/f6f68f0cde9cde5b35b4f13bb5933d0166e64173/chrome/browser/sync/test/integration/sync_arc_package_helper.cc
[modify] https://crrev.com/f6f68f0cde9cde5b35b4f13bb5933d0166e64173/chrome/browser/ui/app_list/arc/arc_app_test.cc
[modify] https://crrev.com/f6f68f0cde9cde5b35b4f13bb5933d0166e64173/chrome/browser/ui/app_list/arc/arc_app_test.h
[modify] https://crrev.com/f6f68f0cde9cde5b35b4f13bb5933d0166e64173/chrome/browser/ui/ash/launcher/arc_app_launcher_browsertest.cc
[modify] https://crrev.com/f6f68f0cde9cde5b35b4f13bb5933d0166e64173/chrome/browser/ui/views/arc_app_dialog_view_browsertest.cc

Project Member

Comment 55 by bugdroid1@chromium.org, Mar 7 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/20e3c142aad1cc086b840a647f0fce829299290e

commit 20e3c142aad1cc086b840a647f0fce829299290e
Author: hidehiko <hidehiko@chromium.org>
Date: Tue Mar 07 09:30:02 2017

Keep state even if AndroidManagement check returns MANAGED or ERROR.

This is the first CL to fix the state machine in ArcSessionManager.
With this CL, even if AndroidManagement check returns MANAGED or ERROR,
the state will be left as is (= CHECKING_ANDROID_MANAGEMENT),
expecting more action is done later.
On clicking RETRY button, the management check should re-run.
On giving up the check, Google Play Store enabled preference
should be set to false, which should trigger RequestDisable().

Along with the change, several refactoring is done.
- Renamed the function. (Removed "Arc" prefix, because it is
  ArcSessionManager's private method so redundant.)
- Extract StartBackgroundAndroidManagementCheck() method, to be
  consistent non-background method.

BUG=657687
BUG=b/31079732
TEST=Ran trybots.

Review-Url: https://codereview.chromium.org/2732983002
Cr-Commit-Position: refs/heads/master@{#455047}

[modify] https://crrev.com/20e3c142aad1cc086b840a647f0fce829299290e/chrome/browser/chromeos/arc/arc_session_manager.cc
[modify] https://crrev.com/20e3c142aad1cc086b840a647f0fce829299290e/chrome/browser/chromeos/arc/arc_session_manager.h

Project Member

Comment 56 by bugdroid1@chromium.org, Mar 9 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/13c620a0df3f13dfb9f43c92faf2b608e0c63215

commit 13c620a0df3f13dfb9f43c92faf2b608e0c63215
Author: hidehiko <hidehiko@chromium.org>
Date: Thu Mar 09 07:27:04 2017

Fix ArcSessionManager state machine, part 1.

This CL fixes the SHOWING_TERMS_OF_SERVICE part.
- Renamed to NEGOTIATING_ to reflect its actual responsibility.
- Move checks if ToS negotiation is skipped into the state.
  - For better encapsulation.
  - Removing state machine transition from STOPPED to
    CHECKING_ANDROID_MANAGEMENT as simplification.
- Get rid of CancelAuthCode() on Terms of Service rejecting.

BUG=657687
BUG=b/31079732
TEST=Ran trybots.

Review-Url: https://codereview.chromium.org/2737453003
Cr-Commit-Position: refs/heads/master@{#455690}

[modify] https://crrev.com/13c620a0df3f13dfb9f43c92faf2b608e0c63215/chrome/browser/chromeos/arc/arc_play_store_enabled_preference_handler_unittest.cc
[modify] https://crrev.com/13c620a0df3f13dfb9f43c92faf2b608e0c63215/chrome/browser/chromeos/arc/arc_session_manager.cc
[modify] https://crrev.com/13c620a0df3f13dfb9f43c92faf2b608e0c63215/chrome/browser/chromeos/arc/arc_session_manager.h
[modify] https://crrev.com/13c620a0df3f13dfb9f43c92faf2b608e0c63215/chrome/browser/chromeos/arc/arc_session_manager_unittest.cc
[modify] https://crrev.com/13c620a0df3f13dfb9f43c92faf2b608e0c63215/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_unittest.cc

Project Member

Comment 57 by bugdroid1@chromium.org, Mar 9 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/73c55143f033177c23833094fecdc51056063aab

commit 73c55143f033177c23833094fecdc51056063aab
Author: hidehiko <hidehiko@chromium.org>
Date: Thu Mar 09 14:05:43 2017

Fix ArcSessionManager state machine, part 2.

This CL fixes REMOVING_DATA_DIR part.
Conceptually, this splits RemoveArcData() into two methods.
- RequestArcDataRemoval(): Requests to remove the data when possible.
- StartArcDataRemoval(): Actually triggers to remove the data.

Note: the state transition cannot be simplified in this CL yet,
because OnSessionStopped(), it is unknown whether the stop is triggered
by RequestDisable() or not (existing race problem, but not regression).
When its state is fixed, the state transition related to REMOVING_DATA_DIR
can also be simplified.

cf) Part1: crrev.com/2737453003

BUG=657687
BUG=b/31079732
TEST=Ran trybots.

Review-Url: https://codereview.chromium.org/2734873002
Cr-Commit-Position: refs/heads/master@{#455738}

[modify] https://crrev.com/73c55143f033177c23833094fecdc51056063aab/chrome/browser/chromeos/arc/arc_play_store_enabled_preference_handler.cc
[modify] https://crrev.com/73c55143f033177c23833094fecdc51056063aab/chrome/browser/chromeos/arc/arc_session_manager.cc
[modify] https://crrev.com/73c55143f033177c23833094fecdc51056063aab/chrome/browser/chromeos/arc/arc_session_manager.h
[modify] https://crrev.com/73c55143f033177c23833094fecdc51056063aab/chrome/browser/chromeos/arc/arc_session_manager_browsertest.cc
[modify] https://crrev.com/73c55143f033177c23833094fecdc51056063aab/chrome/browser/chromeos/arc/arc_session_manager_unittest.cc
[modify] https://crrev.com/73c55143f033177c23833094fecdc51056063aab/chrome/browser/chromeos/arc/enterprise/arc_enterprise_reporting_service.cc

Project Member

Comment 58 by bugdroid1@chromium.org, Mar 12 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/12fb4ebfdafb2660d75e85b8b4d233fd3cfe1507

commit 12fb4ebfdafb2660d75e85b8b4d233fd3cfe1507
Author: emaxx <emaxx@chromium.org>
Date: Sun Mar 12 16:55:48 2017

Don't skip ARC ToS due to policies if ArcEnabled is not managed

This fixes unintentional change made in commit
13c620a0df3f13dfb9f43c92faf2b608e0c63215 that made the ARC Terms of
Service screen being skipped when only ArcBackupRestoreEnabled and
ArcLocationServiceEnabled are managed, while the ARC itself is not.
That was an incorrect change, because the user must consent with ARC
Terms when ArcEnabled is not set via policy.

This CL changes this back to the original behavior that was
introduced in commit f392d837d227d79a9b8dec1d298e9c562929c7cf, that is:

> Skip the ARC initial screen during provision when there is nothing
> to be requested from the user on that screen, i.e. when the following
> conditions are all true:
> 1. ArcEnabled policy is set to true;
> 2. ArcBackupRestoreEnabled policy is set to some value;
> 3. ArcLocationServiceEnabled policy is set to some value.

The unit tests are now extended to cover this piece of logic.

BUG=657687
BUG=b/31079732
TEST=new unit tests

Review-Url: https://codereview.chromium.org/2742013002
Cr-Commit-Position: refs/heads/master@{#456302}

[modify] https://crrev.com/12fb4ebfdafb2660d75e85b8b4d233fd3cfe1507/chrome/browser/chromeos/arc/arc_session_manager.cc
[modify] https://crrev.com/12fb4ebfdafb2660d75e85b8b4d233fd3cfe1507/chrome/browser/chromeos/arc/arc_session_manager_unittest.cc

Project Member

Comment 59 by bugdroid1@chromium.org, Jun 30 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c06f801f1d1d68122d17e300c5565fc9e8eda94c

commit c06f801f1d1d68122d17e300c5565fc9e8eda94c
Author: Hidehiko Abe <hidehiko@chromium.org>
Date: Fri Jun 30 18:14:18 2017

Fix race issue in ARC start up.

If we quickly stop and start ARC, it ARC support reports an error,
until the container stops. Then, even during the data removal,
it will start to show the ToS negotiation page and followings.

This CL fixes the case, by introducing STOPPING state.

BUG=657687,  633258 
TEST=Ran manually. Added some delay on stopping container, and made sure
     this works. Ran bots. Ran unit_tests and browser_tests locally.

Change-Id: Iafcd7b4bbc70a4148c08054b8e48b81c9ab226ce
Reviewed-on: https://chromium-review.googlesource.com/556619
Reviewed-by: Luis Hector Chavez <lhchavez@chromium.org>
Commit-Queue: Hidehiko Abe <hidehiko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#483758}
[modify] https://crrev.com/c06f801f1d1d68122d17e300c5565fc9e8eda94c/chrome/browser/chromeos/arc/arc_session_manager.cc
[modify] https://crrev.com/c06f801f1d1d68122d17e300c5565fc9e8eda94c/chrome/browser/chromeos/arc/arc_session_manager.h
[modify] https://crrev.com/c06f801f1d1d68122d17e300c5565fc9e8eda94c/chrome/browser/chromeos/arc/arc_session_manager_unittest.cc
[modify] https://crrev.com/c06f801f1d1d68122d17e300c5565fc9e8eda94c/chrome/browser/chromeos/arc/notification/arc_provision_notification_service_unittest.cc

Components: Platform>Apps>ARC
Cc: -lhchavez@chromium.org

Sign in to add a comment