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

Unified Diff: chrome/browser/automation/automation_provider.cc

Issue 329040: Take 2 at this. The only change between this and the first is to add the GetT... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 2 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
« no previous file with comments | « chrome/browser/automation/automation_provider.h ('k') | chrome/browser/browser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/automation/automation_provider.cc
===================================================================
--- chrome/browser/automation/automation_provider.cc (revision 30237)
+++ chrome/browser/automation/automation_provider.cc (working copy)
@@ -309,6 +309,7 @@
WindowSimulateDrag)
#endif // defined(OS_WIN) || defined(OS_LINUX)
IPC_MESSAGE_HANDLER(AutomationMsg_TabCount, GetTabCount)
+ IPC_MESSAGE_HANDLER(AutomationMsg_Type, GetType)
IPC_MESSAGE_HANDLER(AutomationMsg_Tab, GetTab)
#if defined(OS_WIN)
IPC_MESSAGE_HANDLER(AutomationMsg_TabHWND, GetTabHWND)
@@ -332,6 +333,8 @@
IPC_MESSAGE_HANDLER(AutomationMsg_SetProxyConfig, SetProxyConfig);
IPC_MESSAGE_HANDLER_DELAY_REPLY(AutomationMsg_OpenNewBrowserWindow,
OpenNewBrowserWindow)
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(AutomationMsg_OpenNewBrowserWindowOfType,
+ OpenNewBrowserWindowOfType)
IPC_MESSAGE_HANDLER(AutomationMsg_WindowForBrowser, GetWindowForBrowser)
IPC_MESSAGE_HANDLER(AutomationMsg_AutocompleteEditForBrowser,
GetAutocompleteEditForBrowser)
@@ -881,6 +884,15 @@
}
}
+void AutomationProvider::GetType(int handle, int* type_as_int) {
+ *type_as_int = -1; // -1 is the error code
+
+ if (browser_tracker_->ContainsHandle(handle)) {
+ Browser* browser = browser_tracker_->GetResource(handle);
+ *type_as_int = static_cast<int>(browser->type());
+ }
+}
+
void AutomationProvider::GetTab(int win_handle, int tab_index,
int* tab_handle) {
*tab_handle = 0;
@@ -1279,10 +1291,17 @@
void AutomationProvider::OpenNewBrowserWindow(bool show,
IPC::Message* reply_message) {
+ OpenNewBrowserWindowOfType(static_cast<int>(Browser::TYPE_NORMAL), show,
+ reply_message);
+}
+
+void AutomationProvider::OpenNewBrowserWindowOfType(
+ int type, bool show, IPC::Message* reply_message) {
new BrowserOpenedNotificationObserver(this, reply_message);
// We may have no current browser windows open so don't rely on
// asking an existing browser to execute the IDC_NEWWINDOW command
- Browser* browser = Browser::Create(profile_);
+ Browser* browser = new Browser(static_cast<Browser::Type>(type), profile_);
+ browser->CreateBrowserWindow();
browser->AddBlankTab(true);
if (show)
browser->window()->Show();
« no previous file with comments | « chrome/browser/automation/automation_provider.h ('k') | chrome/browser/browser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698