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

Side by Side Diff: chrome/renderer/searchbox/searchbox_extension.cc

Issue 18344010: Completing high dpi support for Instant Extended. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync and rebase Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/renderer/searchbox/searchbox_extension.h" 5 #include "chrome/renderer/searchbox/searchbox_extension.h"
6 6
7 #include "base/i18n/rtl.h" 7 #include "base/i18n/rtl.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 if (base::i18n::StringContainsStrongRTLChars(mv_item.title)) 111 if (base::i18n::StringContainsStrongRTLChars(mv_item.title))
112 direction = kRTLHtmlTextDirection; 112 direction = kRTLHtmlTextDirection;
113 else 113 else
114 direction = kLTRHtmlTextDirection; 114 direction = kLTRHtmlTextDirection;
115 115
116 string16 title = mv_item.title; 116 string16 title = mv_item.title;
117 if (title.empty()) 117 if (title.empty())
118 title = UTF8ToUTF16(mv_item.url.spec()); 118 title = UTF8ToUTF16(mv_item.url.spec());
119 119
120 v8::Handle<v8::Object> obj = v8::Object::New(); 120 v8::Handle<v8::Object> obj = v8::Object::New();
121 obj->Set(v8::String::New("renderViewId"), v8::Int32::New(render_view_id));
121 obj->Set(v8::String::New("rid"), v8::Int32::New(restricted_id)); 122 obj->Set(v8::String::New("rid"), v8::Int32::New(restricted_id));
122 obj->Set(v8::String::New("thumbnailUrl"), 123 obj->Set(v8::String::New("thumbnailUrl"),
123 GenerateThumbnailURL(render_view_id, restricted_id)); 124 GenerateThumbnailURL(render_view_id, restricted_id));
124 obj->Set(v8::String::New("faviconUrl"), 125 obj->Set(v8::String::New("faviconUrl"),
samarth 2013/07/24 00:11:05 No reason to fill this out here, right?
pedro (no code reviews) 2013/07/24 01:10:55 Right, no reason to fill this out here, since we'r
125 GenerateFaviconURL(render_view_id, restricted_id)); 126 GenerateFaviconURL(render_view_id, restricted_id));
samarth 2013/07/24 00:11:05 You can kill this function too.
pedro (no code reviews) 2013/07/24 01:10:55 Done.
126 obj->Set(v8::String::New("title"), UTF16ToV8String(title)); 127 obj->Set(v8::String::New("title"), UTF16ToV8String(title));
127 obj->Set(v8::String::New("domain"), UTF8ToV8String(mv_item.url.host())); 128 obj->Set(v8::String::New("domain"), UTF8ToV8String(mv_item.url.host()));
128 obj->Set(v8::String::New("direction"), UTF8ToV8String(direction)); 129 obj->Set(v8::String::New("direction"), UTF8ToV8String(direction));
129 obj->Set(v8::String::New("url"), UTF8ToV8String(mv_item.url.spec())); 130 obj->Set(v8::String::New("url"), UTF8ToV8String(mv_item.url.spec()));
130 return obj; 131 return obj;
131 } 132 }
132 133
133 // Returns the render view for the current JS context if it matches |origin|, 134 // Returns the render view for the current JS context if it matches |origin|,
134 // otherwise returns NULL. Used to restrict methods that access suggestions and 135 // otherwise returns NULL. Used to restrict methods that access suggestions and
135 // most visited data to pages with origin chrome-search://most-visited and 136 // most visited data to pages with origin chrome-search://most-visited and
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after
900 void SearchBoxExtensionWrapper::UndoMostVisitedDeletion( 901 void SearchBoxExtensionWrapper::UndoMostVisitedDeletion(
901 const v8::FunctionCallbackInfo<v8::Value>& args) { 902 const v8::FunctionCallbackInfo<v8::Value>& args) {
902 content::RenderView* render_view = GetRenderView(); 903 content::RenderView* render_view = GetRenderView();
903 if (!render_view || !args.Length()) return; 904 if (!render_view || !args.Length()) return;
904 905
905 DVLOG(1) << render_view << " UndoMostVisitedDeletion"; 906 DVLOG(1) << render_view << " UndoMostVisitedDeletion";
906 SearchBox::Get(render_view)->UndoMostVisitedDeletion(args[0]->IntegerValue()); 907 SearchBox::Get(render_view)->UndoMostVisitedDeletion(args[0]->IntegerValue());
907 } 908 }
908 909
909 } // namespace extensions_v8 910 } // namespace extensions_v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698