diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-27 15:31:13 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-27 15:31:13 +0000 |
commit | d05cd10167055b92abefae9dbb700b49da657491 (patch) | |
tree | 1efbf0699b42d1d22158e418d68f2c135261d0ea /chrome/browser/automation | |
parent | ef321762d036191157a3d31a6eff2884f3ff0356 (diff) | |
download | chromium_src-d05cd10167055b92abefae9dbb700b49da657491.zip chromium_src-d05cd10167055b92abefae9dbb700b49da657491.tar.gz chromium_src-d05cd10167055b92abefae9dbb700b49da657491.tar.bz2 |
Makes session restore on Chrome OS restore popups.
BUG=18862
TEST=none
Review URL: http://codereview.chromium.org/337030
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30194 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/automation')
-rw-r--r-- | chrome/browser/automation/automation_provider.cc | 16 | ||||
-rw-r--r-- | chrome/browser/automation/automation_provider.h | 5 |
2 files changed, 18 insertions, 3 deletions
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc index d791afb..c47a326 100644 --- a/chrome/browser/automation/automation_provider.cc +++ b/chrome/browser/automation/automation_provider.cc @@ -309,6 +309,7 @@ void AutomationProvider::OnMessageReceived(const IPC::Message& message) { 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) @@ -881,6 +882,15 @@ void AutomationProvider::GetTabCount(int handle, int* tab_count) { } } +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; @@ -1277,12 +1287,14 @@ void AutomationProvider::GetDownloadDirectory( } } -void AutomationProvider::OpenNewBrowserWindow(bool show, +void AutomationProvider::OpenNewBrowserWindow(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(); diff --git a/chrome/browser/automation/automation_provider.h b/chrome/browser/automation/automation_provider.h index 44ee790..471f00f 100644 --- a/chrome/browser/automation/automation_provider.h +++ b/chrome/browser/automation/automation_provider.h @@ -185,6 +185,7 @@ class AutomationProvider : public base::RefCounted<AutomationProvider>, void IsWindowMaximized(int handle, bool* is_maximized, bool* success); void GetTabCount(int handle, int* tab_count); + void GetType(int handle, int* type_as_int); void GetTab(int win_handle, int tab_index, int* tab_handle); #if defined(OS_WIN) // TODO(port): Replace HWND. @@ -283,7 +284,9 @@ class AutomationProvider : public base::RefCounted<AutomationProvider>, int* autocomplete_edit_handle); // If |show| is true, call Show() on the new window after creating it. - void OpenNewBrowserWindow(bool show, IPC::Message* reply_message); + void OpenNewBrowserWindow(int type, + bool show, + IPC::Message* reply_message); void ShowInterstitialPage(int tab_handle, const std::string& html_text, |