Commit e6ee2ef2 authored by mlerman's avatar mlerman Committed by Commit bot

Let guests on ChromeOS still search.

BUG=411178

Review URL: https://codereview.chromium.org/545953002

Cr-Commit-Position: refs/heads/master@{#293965}
parent 418e04ca
...@@ -17,6 +17,13 @@ cr.define('options', function() { ...@@ -17,6 +17,13 @@ cr.define('options', function() {
return el; return el;
} }
/**
* Prohibit search for guests on desktop.
*/
function ShouldEnableSearch() {
return !loadTimeData.getBoolean('profileIsGuest') || cr.isChromeOS;
}
SearchBubble.decorate = function(el) { SearchBubble.decorate = function(el) {
el.__proto__ = SearchBubble.prototype; el.__proto__ = SearchBubble.prototype;
el.decorate(); el.decorate();
...@@ -187,8 +194,7 @@ cr.define('options', function() { ...@@ -187,8 +194,7 @@ cr.define('options', function() {
if (!this.searchActive_ && !active) if (!this.searchActive_ && !active)
return; return;
// Guest users should never have active search. if (!ShouldEnableSearch())
if (loadTimeData.getBoolean('profileIsGuest'))
return; return;
this.searchActive_ = active; this.searchActive_ = active;
...@@ -264,8 +270,7 @@ cr.define('options', function() { ...@@ -264,8 +270,7 @@ cr.define('options', function() {
* @private * @private
*/ */
setSearchText_: function(text) { setSearchText_: function(text) {
// Guest users should never have search text. if (!ShouldEnableSearch())
if (loadTimeData.getBoolean('profileIsGuest'))
return; return;
// Prevent recursive execution of this method. // Prevent recursive execution of this method.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment