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

Unified Diff: chrome/browser/chromeos/dbus/printer_service_provider.cc

Issue 12262027: Fixed privacy issues in USB printer detection on Chrome OS. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/dbus/printer_service_provider.cc
diff --git a/chrome/browser/chromeos/dbus/printer_service_provider.cc b/chrome/browser/chromeos/dbus/printer_service_provider.cc
index 85413cc254b1939e8a60df103dc8e585d1537d7c..3db81cd96ef4c92955d215682f89814c800f8e54 100644
--- a/chrome/browser/chromeos/dbus/printer_service_provider.cc
+++ b/chrome/browser/chromeos/dbus/printer_service_provider.cc
@@ -4,12 +4,13 @@
#include "chrome/browser/chromeos/dbus/printer_service_provider.h"
+#include "ash/shell.h"
+#include "ash/shell_delegate.h"
#include "ash/wm/window_util.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/metrics/histogram.h"
#include "base/stringprintf.h"
-#include "chrome/browser/chromeos/login/user_manager.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
@@ -38,7 +39,7 @@ enum PrinterServiceEvent {
// TODO(vitalybuka): update URL with more relevant information.
const char kCloudPrintLearnUrl[] =
- "http://www.google.com/landing/cloudprint/index.html?vendor=%s&product=%s";
+ "https://www.google.com/landing/cloudprint/index.html";
void ActivateContents(Browser* browser, content::WebContents* contents) {
browser->tab_strip_model()->ActivateTabAt(
@@ -55,22 +56,20 @@ Browser* ActivateAndGetBrowserForUrl(GURL url) {
return NULL;
}
-void FindOrOpenCloudPrintPage(const std::string& vendor,
- const std::string& product) {
+void FindOrOpenCloudPrintPage(const std::string& /* vendor */,
+ const std::string& /* product */) {
UMA_HISTOGRAM_ENUMERATION("PrinterService.PrinterServiceEvent", PRINTER_ADDED,
PRINTER_SERVICE_EVENT_MAX);
- if (!chromeos::UserManager::Get()->IsUserLoggedIn())
+ if (!ash::Shell::GetInstance()->delegate()->IsSessionStarted() ||
+ ash::Shell::GetInstance()->delegate()->IsScreenLocked()) {
return;
+ }
Profile* profile = ProfileManager::GetLastUsedProfile();
if (!profile)
return;
- // Escape param just in case. Usually vendor and model should be just integer.
- GURL url(
- base::StringPrintf(kCloudPrintLearnUrl,
- net::EscapeQueryParamValue(vendor, true).c_str(),
- net::EscapeQueryParamValue(product, true).c_str()));
+ GURL url(kCloudPrintLearnUrl);
Browser* browser = ActivateAndGetBrowserForUrl(url);
if (!browser) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698