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

Unified Diff: chrome/browser/browser_init.cc

Issue 10973: Test the feasibility of turning Chrome into a multi-process ActiveX control Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 12 years, 1 month 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
« no previous file with comments | « chrome/browser/browser.cc ('k') | chrome/browser/browser_type.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser_init.cc
===================================================================
--- chrome/browser/browser_init.cc (revision 5533)
+++ chrome/browser/browser_init.cc (working copy)
@@ -667,6 +667,44 @@
return true;
}
+ // Check if we're running as an embedded client
+ if (parsed_command_line.HasSwitch(switches::kEmbeddedProcess)) {
+ std::wstring settings = parsed_command_line.GetSwitchValue(switches::kEmbeddedSettings);
+
+ HWND hwnd = NULL;
+ gfx::Rect rect;
+ std::wstring url = L"http://www.google.com";
+
+ // Parse the embedded settings argument
+ wchar_t* tok = wcstok(const_cast<wchar_t*>(settings.c_str()), L",");
+ for(int i = 0; tok; i++)
+ {
+ if(i == 0)
+ hwnd = (HWND)_wtol(tok);
+ else if(i == 1)
+ rect.set_x(_wtoi(tok));
+ else if(i == 2)
+ rect.set_y(_wtoi(tok));
+ else if(i == 3)
+ rect.set_width(_wtoi(tok));
+ else if(i == 4)
+ rect.set_height(_wtoi(tok));
+ else if(i == 5)
+ url = tok;
+ else
+ break;
+
+ tok = wcstok(NULL, L",");
+ }
+
+ // Create the embedded browser window
+ Browser* browser = Browser::CreateForEmbedded(hwnd, rect, profile);
+ browser->ShowNativeUITab(GURL(url));
+ browser->window()->Show();
+
+ return true;
+ }
+
LaunchWithProfile lwp(cur_dir, parsed_command_line.command_line_string());
bool launched = lwp.Launch(profile, process_startup);
if (!launched) {
« no previous file with comments | « chrome/browser/browser.cc ('k') | chrome/browser/browser_type.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698