Index: chrome/browser/resources/options/search_page.js |
diff --git a/chrome/browser/resources/options/search_page.js b/chrome/browser/resources/options/search_page.js |
index d5b982671c212a580244a490bcc13992470809a6..3fc5e2dfcb8b5a2d7b3b9a8d92b3c103ec89fae5 100644 |
--- a/chrome/browser/resources/options/search_page.js |
+++ b/chrome/browser/resources/options/search_page.js |
@@ -17,6 +17,13 @@ cr.define('options', function() { |
return el; |
} |
+ /** |
+ * Prohibit search for guests on desktop. |
+ */ |
+ function ShouldEnableSearch() { |
+ return (!loadTimeData.getBoolean('profileIsGuest') || cr.isChromeOS); |
Evan Stade
2014/09/08 18:42:17
sorry I put parentheses in my previous comment. I
|
+ } |
+ |
SearchBubble.decorate = function(el) { |
el.__proto__ = SearchBubble.prototype; |
el.decorate(); |
@@ -187,8 +194,7 @@ cr.define('options', function() { |
if (!this.searchActive_ && !active) |
return; |
- // Guest users should never have active search. |
- if (loadTimeData.getBoolean('profileIsGuest')) |
+ if (!ShouldEnableSearch()) |
return; |
this.searchActive_ = active; |
@@ -264,8 +270,7 @@ cr.define('options', function() { |
* @private |
*/ |
setSearchText_: function(text) { |
- // Guest users should never have search text. |
- if (loadTimeData.getBoolean('profileIsGuest')) |
+ if (!ShouldEnableSearch()) |
return; |
// Prevent recursive execution of this method. |