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

Unified Diff: chrome/browser/browser.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.h ('k') | chrome/browser/browser_init.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser.cc
===================================================================
--- chrome/browser/browser.cc (revision 5533)
+++ chrome/browser/browser.cc (working copy)
@@ -150,7 +150,8 @@
is_attempting_to_close_browser_(false),
override_maximized_(false),
method_factory_(this),
- idle_task_(new BrowserIdleTimer) {
+ idle_task_(new BrowserIdleTimer),
+ parent_hwnd_(NULL) {
tabstrip_model_.AddObserver(this);
NotificationService::current()->AddObserver(
@@ -231,6 +232,17 @@
return browser;
}
+// static
+Browser* Browser::CreateForEmbedded(HWND parent_hwnd,
+ gfx::Rect& rect,
+ Profile* profile) {
+ Browser* browser = new Browser(BrowserType::EMBEDDED, profile);
+ browser->set_parent_hwnd(parent_hwnd);
+ browser->set_override_bounds(rect);
+ browser->CreateBrowserWindow();
+ return browser;
+}
+
void Browser::CreateBrowserWindow() {
DCHECK(!window_);
window_ = BrowserWindow::CreateBrowserWindow(this);
@@ -314,8 +326,8 @@
}
bool Browser::ShouldSaveWindowPlacement() const {
- // We don't save window position for popups.
- return type() != BrowserType::BROWSER;
+ // We don't save window position for popups for embedded windows.
+ return type() != BrowserType::BROWSER && type() != BrowserType::EMBEDDED;
}
void Browser::SaveWindowPlacement(const gfx::Rect& bounds, bool maximized) {
@@ -697,7 +709,7 @@
void Browser::ConvertPopupToTabbedBrowser() {
UserMetrics::RecordAction(L"ShowAsTab", profile_);
- if (type() != BrowserType::BROWSER) {
+ if (type() != BrowserType::BROWSER && type() != BrowserType::EMBEDDED) {
NOTREACHED();
return;
}
@@ -1276,7 +1288,7 @@
Browser* browser = NULL;
if (type_ == BrowserType::APPLICATION) {
browser = Browser::CreateForApp(app_name_, profile_);
- } else if (type_ == BrowserType::BROWSER) {
+ } else if (type_ == BrowserType::BROWSER || type_ == BrowserType::EMBEDDED) {
browser = Browser::CreateForPopup(profile_);
}
@@ -1668,7 +1680,7 @@
}
void Browser::MoveContents(TabContents* source, const gfx::Rect& pos) {
- if (type() != BrowserType::BROWSER) {
+ if (type() != BrowserType::BROWSER && type() != BrowserType::EMBEDDED) {
NOTREACHED() << "moving invalid browser type";
return;
}
@@ -1680,6 +1692,10 @@
return (type() == BrowserType::BROWSER);
}
+bool Browser::IsEmbedded(TabContents* source) {
+ return (type() == BrowserType::EMBEDDED);
+}
+
void Browser::ToolbarSizeChanged(TabContents* source, bool is_animating) {
if (source == GetSelectedTabContents() || source == NULL) {
// This will refresh the shelf if needed.
« no previous file with comments | « chrome/browser/browser.h ('k') | chrome/browser/browser_init.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698