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

Unified Diff: chrome/renderer/searchbox/searchbox_extension.cc

Issue 16413002: Moved theme related state from BrowserInstantController to InstantService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 7 years, 6 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
Index: chrome/renderer/searchbox/searchbox_extension.cc
diff --git a/chrome/renderer/searchbox/searchbox_extension.cc b/chrome/renderer/searchbox/searchbox_extension.cc
index 7c19aed40d61cd83545933382e28cbaab0d42c11..4b14ebb2a3e0f4d35fff88601e13af40cd5f93e2 100644
--- a/chrome/renderer/searchbox/searchbox_extension.cc
+++ b/chrome/renderer/searchbox/searchbox_extension.cc
@@ -906,11 +906,15 @@ void SearchBoxExtensionWrapper::GetDisplayInstantResults(
void SearchBoxExtensionWrapper::GetThemeBackgroundInfo(
const v8::FunctionCallbackInfo<v8::Value>& args) {
content::RenderView* render_view = GetRenderView();
- if (!render_view) return;
+ if (!render_view)
+ return;
DVLOG(1) << render_view << " GetThemeBackgroundInfo";
const ThemeBackgroundInfo& theme_info =
SearchBox::Get(render_view)->GetThemeBackgroundInfo();
+ if (!theme_info.IsValid())
+ return;
+
v8::Handle<v8::Object> info = v8::Object::New();
// The theme background color is in RGBA format "rgba(R,G,B,A)" where R, G and
@@ -986,6 +990,8 @@ void SearchBoxExtensionWrapper::GetThemeBackgroundInfo(
case THEME_BKGRND_IMAGE_REPEAT:
tiling = kCSSBackgroundRepeat;
break;
+ default:
+ NOTREACHED();
}
info->Set(v8::String::New("imageTiling"), UTF8ToV8String(tiling));

Powered by Google App Engine
This is Rietveld 408576698