+chromium-dev
On Fri, May 22, 2009 at 6:35 PM, Mohamed Mansour
<[email protected]>wrote:
> Hi,
>
> I don't know if this is the correct answer but, can't you do something like
> this:
>
> // Lets create a gurl with the html inside.
> std::string url_str = "data:text/html;charset=utf-8,";
> url_str.append("Hello World!");
> GURL url(url_str);
>
> // Load it to a WebFrame
> scoped_ptr<WebRequest> request(WebRequest::Create(url));
> GetMainFrame()->LoadRequest(request.get());
>
> // Load happens asynchronously, need to pump the messages.
> ProcessPendingMessages();
>
>
> This approach is used in tests.
>
> -- Mohamed Mansour
>
>
>
> On Fri, May 22, 2009 at 6:17 PM, John Gregg <[email protected]> wrote:
>
>> I'm trying to load a static HTML string into a small render view (for the
>> purpose of desktop notifications), and I came across the method
>> RenderViewHost::LoadAlternateHTMLString, which, based on the name, sounds
>> like what I want.
>>
>> I have things working the way I want if I call rvh->NavigateToURL(url): it
>> loads the remote URL into my view. But if I replace that call with
>> rvh->LoadAlternateHTMLString(L"Hello World", false, GURL(), "") [the
>> comments say the last two arguments are ignored if the second argument is
>> false], I get strange behavior: my notification view is empty, and a new tab
>> opens to "chrome://chromewebdata/" and displays an INVALID_URL error.
>> Btw, the same thing happens if I replace "Hello World" with valid HTML.
>>
>> I've tried debugging this but nothing obvious is jumping out as a
>> problem. Any advice on what I might be doing wrong? Is there a better way
>> to load static HTML into a RenderView?
>>
>> Thanks,
>> -John
>>
>>
>>
>> >>
>>
>
--~--~---------~--~----~------------~-------~--~----~
Chromium Developers mailing list: [email protected]
View archives, change email options, or unsubscribe:
http://groups.google.com/group/chromium-dev
-~----------~----~----~----~------~----~------~--~---