Revert 129779 - Limit Chrome To Mobile cloud print access; refinements etc.
Check the user's account info before contacting cloud print.
Only ping cloud print for users of that service.

Make ChromeToMobileService a RefcountedProfileKeyedService.
Add and check |temp_dir_valid_| on GenerateSnapshot.
Fix a JSON DictionaryValue leak from ParseResponseJSON use.
Make |mobiles_| a ScopedVector of DeepCopy DictionaryValues.

Call new ChromeToMobileService::HasDevices for encapsulation.
Call RequestMobileListUpdate from bubbles, not their callers.
Mock RequestMobileListUpdate so tests do not send requests.
Store the service, not the profile, as a bubble class member.
Skip IsSyncAccessible on updates (the first check suffices).

Auto-close on Mac via performSelector, not PostDelayedTask.
cancelPreviousPerformRequestsWithTarget on windowWillClose.
Call OnChanged after UpdateChromeToMobileEnabled for Mac.
(the icon wasn't showing up immediately on Release builds)

BUG=102709,118691
TEST=Less cloud print traffic. No apparent behavior changes.

Review URL: https://chromiumcodereview.appspot.com/9863054

TBR=msw@chromium.org
Review URL: https://chromiumcodereview.appspot.com/9950011

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@129785 0039d316-1c4b-4281-b951-d872f2087c98
14 files changed