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

Issue 8438020: Cloud print connector policy. (Closed)

Created:
9 years, 1 month ago by Scott Byer
Modified:
9 years, 1 month ago
CC:
chromium-reviews
Visibility:
Public.

Description

Cloud print connector policy. This implements the policy inside the browser process, shutting down the cloud print connector if the policy is set to disabled. This isn't a complete solution, as the browser needs to be running or be launched for the policy to take effect. (It will take a lot more refactoring for the service process to use the policy code). The hole without the refactoring is that if you enable the connector, quit Chromium, and set the policy, the connector will stay alive until the next launch of Chromium. The browser process checks the policy on startup, and listens for it changing as long as it is up. You can sit on the Under the Hood page and watch the button change state on Windows as you fiddle with the policy. BUG=59769 TEST=Set Cloud Print Proxy policy to disabled, bring up browser, Options/Under the Hood - Sign in to Google Cloud print will be disabled. Unset policy, wait, button becomes active. Log in to cloud print. Quit Chromium, note service process hangs around for more than a minute. Set policy, launch and quit Chromium. Note that the service process quits within a minute. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=110332

Patch Set 1 #

Total comments: 5

Patch Set 2 : Move the code to the browser process #

Total comments: 5

Patch Set 3 : Fix nits. #

Total comments: 1

Patch Set 4 : Move policy watching, add unit tests. #

Patch Set 5 : Fix mac compile #

Total comments: 20

Patch Set 6 : Address comments, initialization fix for Windows. #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+478 lines, -25 lines) Patch
M chrome/app/policy/policy_templates.json View 1 2 3 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/printing/cloud_print/cloud_print_proxy_service.h View 1 2 3 4 chunks +17 lines, -1 line 0 comments Download
M chrome/browser/printing/cloud_print/cloud_print_proxy_service.cc View 1 2 3 4 5 8 chunks +53 lines, -17 lines 2 comments Download
A chrome/browser/printing/cloud_print/cloud_print_proxy_service_unittest.cc View 1 2 3 4 5 1 chunk +391 lines, -0 lines 0 comments Download
M chrome/browser/service/service_process_control.h View 1 2 3 4 4 chunks +11 lines, -5 lines 1 comment Download
M chrome/browser/service/service_process_control.cc View 1 2 3 4 1 chunk +4 lines, -0 lines 1 comment Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 15 (0 generated)
Scott Byer
9 years, 1 month ago (2011-11-01 22:46:14 UTC) #1
Peter Kasting
http://codereview.chromium.org/8438020/diff/1/chrome/browser/ui/browser.cc File chrome/browser/ui/browser.cc (right): http://codereview.chromium.org/8438020/diff/1/chrome/browser/ui/browser.cc#newcode4634 chrome/browser/ui/browser.cc:4634: UpdateCloudPrintConnectorState(); This seems like the wrong place for this. ...
9 years, 1 month ago (2011-11-01 22:54:09 UTC) #2
Mattias Nissler (ping if slow)
http://codereview.chromium.org/8438020/diff/1/chrome/browser/ui/browser.cc File chrome/browser/ui/browser.cc (right): http://codereview.chromium.org/8438020/diff/1/chrome/browser/ui/browser.cc#newcode4634 chrome/browser/ui/browser.cc:4634: UpdateCloudPrintConnectorState(); On 2011/11/01 22:54:10, Peter Kasting wrote: > This ...
9 years, 1 month ago (2011-11-02 10:55:56 UTC) #3
Scott Byer
Ok, moved over to browser_process_impl. It does make more sense there. http://codereview.chromium.org/8438020/diff/1/chrome/browser/ui/browser.cc File chrome/browser/ui/browser.cc (right): ...
9 years, 1 month ago (2011-11-02 21:33:25 UTC) #4
Peter Kasting
LGTM http://codereview.chromium.org/8438020/diff/5001/chrome/browser/browser_process_impl.cc File chrome/browser/browser_process_impl.cc (right): http://codereview.chromium.org/8438020/diff/5001/chrome/browser/browser_process_impl.cc#newcode699 chrome/browser/browser_process_impl.cc:699: } else if (type == chrome::NOTIFICATION_PROFILE_CREATED) { Nit: ...
9 years, 1 month ago (2011-11-02 22:09:59 UTC) #5
Scott Byer
Mattias, PTAL? I need an LGTM for the policy_templates.json part. Thanks!
9 years, 1 month ago (2011-11-03 20:22:28 UTC) #6
Mattias Nissler (ping if slow)
The code you have works, but I think a different solution is better after all. ...
9 years, 1 month ago (2011-11-04 00:19:15 UTC) #7
Scott Byer
Mattias, I agree with you; I've moved the watching of the preference over to the ...
9 years, 1 month ago (2011-11-11 23:56:34 UTC) #8
Mattias Nissler (ping if slow)
Nice unit tests! Not much to complain about, but I put a couple of suggestions ...
9 years, 1 month ago (2011-11-14 08:33:06 UTC) #9
Scott Byer
http://codereview.chromium.org/8438020/diff/13002/chrome/browser/printing/cloud_print/cloud_print_proxy_service.cc File chrome/browser/printing/cloud_print/cloud_print_proxy_service.cc (right): http://codereview.chromium.org/8438020/diff/13002/chrome/browser/printing/cloud_print/cloud_print_proxy_service.cc#newcode91 chrome/browser/printing/cloud_print/cloud_print_proxy_service.cc:91: DCHECK(profile_->GetPrefs()->GetBoolean(prefs::kCloudPrintProxyEnabled)); On 2011/11/14 08:33:06, Mattias Nissler wrote: > nit: ...
9 years, 1 month ago (2011-11-15 01:42:23 UTC) #10
Mattias Nissler (ping if slow)
LGTM. Thanks for bearing with me :)
9 years, 1 month ago (2011-11-15 09:06:05 UTC) #11
Scott Byer
Peter, do you want to take another look since things have changed a bit (read: ...
9 years, 1 month ago (2011-11-15 16:49:37 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/scottbyer@chromium.org/8438020/16002
9 years, 1 month ago (2011-11-16 17:36:32 UTC) #13
commit-bot: I haz the power
Change committed as 110332
9 years, 1 month ago (2011-11-16 18:40:59 UTC) #14
Peter Kasting
9 years, 1 month ago (2011-11-21 20:51:32 UTC) #15
Much-belated LGTM, just a few tiny nits that you can write a followup for if you
want.

http://codereview.chromium.org/8438020/diff/16002/chrome/browser/printing/clo...
File chrome/browser/printing/cloud_print/cloud_print_proxy_service.cc (right):

http://codereview.chromium.org/8438020/diff/16002/chrome/browser/printing/clo...
chrome/browser/printing/cloud_print/cloud_print_proxy_service.cc:168:
std::string email;
Nit: Combine this line with the next

http://codereview.chromium.org/8438020/diff/16002/chrome/browser/printing/clo...
chrome/browser/printing/cloud_print/cloud_print_proxy_service.cc:186: if (type
== chrome::NOTIFICATION_PREF_CHANGED) {
Nit: Convert this conditional to a simple:

  DCHECK_EQ(chrome::NOTIFICATION_PREF_CHANGED, type);

http://codereview.chromium.org/8438020/diff/16002/chrome/browser/service/serv...
File chrome/browser/service/service_process_control.cc (right):

http://codereview.chromium.org/8438020/diff/16002/chrome/browser/service/serv...
chrome/browser/service/service_process_control.cc:82: return channel_.get() !=
NULL;
Nit: I think this still works without ".get()"

http://codereview.chromium.org/8438020/diff/16002/chrome/browser/service/serv...
File chrome/browser/service/service_process_control.h (right):

http://codereview.chromium.org/8438020/diff/16002/chrome/browser/service/serv...
chrome/browser/service/service_process_control.h:54: virtual bool is_connected()
const;
Nit: virtual functions must not be named in unix_hacker() style.

Powered by Google App Engine
This is Rietveld 408576698