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

Unified Diff: chrome/browser/views/frame/browser_view.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/views/frame/browser_view.h ('k') | chrome/browser/views/frame/browser_window_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/frame/browser_view.cc
===================================================================
--- chrome/browser/views/frame/browser_view.cc (revision 5533)
+++ chrome/browser/views/frame/browser_view.cc (working copy)
@@ -152,7 +152,8 @@
// Comment out for one cycle to see if this fixes dist tests.
//tabstrip_->DestroyDragController();
- status_bubble_->Reposition();
+ if(status_bubble_.get())
+ status_bubble_->Reposition();
// Close the omnibox popup, if any.
if (GetLocationBarView())
@@ -160,7 +161,9 @@
}
gfx::Rect BrowserView::GetToolbarBounds() const {
- return toolbar_->bounds();
+ if(toolbar_)
+ return toolbar_->bounds();
+ return gfx::Rect();
}
gfx::Rect BrowserView::GetClientAreaBounds() const {
@@ -285,9 +288,9 @@
unsigned int features = FEATURE_INFOBAR | FEATURE_DOWNLOADSHELF;
if (type == BrowserType::TABBED_BROWSER)
features |= FEATURE_TABSTRIP | FEATURE_TOOLBAR | FEATURE_BOOKMARKBAR;
- if (type != BrowserType::APPLICATION)
+ if (type != BrowserType::APPLICATION && type != BrowserType::EMBEDDED)
features |= FEATURE_LOCATIONBAR;
- if (type != BrowserType::TABBED_BROWSER)
+ if (type != BrowserType::TABBED_BROWSER && type != BrowserType::EMBEDDED)
features |= FEATURE_TITLEBAR;
return features;
}
@@ -451,15 +454,21 @@
}
ToolbarStarToggle* BrowserView::GetStarButton() const {
- return toolbar_->star_button();
+ if(toolbar_)
+ return toolbar_->star_button();
+ return NULL;
}
LocationBarView* BrowserView::GetLocationBarView() const {
- return toolbar_->GetLocationBarView();
+ if(toolbar_)
+ return toolbar_->GetLocationBarView();
+ return NULL;
}
GoButton* BrowserView::GetGoButton() const {
- return toolbar_->GetGoButton();
+ if(toolbar_)
+ return toolbar_->GetGoButton();
+ return NULL;
}
BookmarkBarView* BrowserView::GetBookmarkBarView() {
@@ -481,11 +490,13 @@
void BrowserView::UpdateToolbar(TabContents* contents,
bool should_restore_state) {
- toolbar_->Update(contents, should_restore_state);
+ if(toolbar_)
+ toolbar_->Update(contents, should_restore_state);
}
void BrowserView::FocusToolbar() {
- toolbar_->RequestFocus();
+ if(toolbar_)
+ toolbar_->RequestFocus();
}
void BrowserView::DestroyBrowser() {
@@ -645,7 +656,8 @@
// Update all the UI bits.
UpdateTitleBar();
- toolbar_->SetProfile(new_contents->profile());
+ if(toolbar_)
+ toolbar_->SetProfile(new_contents->profile());
UpdateToolbar(new_contents, true);
UpdateUIForContents(new_contents);
}
@@ -724,8 +736,8 @@
bool BrowserView::GetSavedWindowBounds(gfx::Rect* bounds) const {
*bounds = browser_->GetSavedWindowBounds();
- if (browser_->type() == BrowserType::BROWSER) {
- // We are a popup window. The value passed in |bounds| represents two
+ if (browser_->type() == BrowserType::BROWSER || browser_->type() == BrowserType::EMBEDDED) {
+ // We are a popup or embedded window. The value passed in |bounds| represents two
// pieces of information:
// - the position of the window, in screen coordinates (outer position).
// - the size of the content area (inner size).
@@ -961,6 +973,8 @@
void BrowserView::InitSystemMenu() {
HMENU system_menu = GetSystemMenu(frame_->GetWindow()->GetHWND(), FALSE);
+ if(!system_menu)
+ return;
system_menu_.reset(new Menu(system_menu));
int insertion_index = std::max(0, system_menu_->ItemCount() - 1);
// We add the menu items in reverse order so that insertion_index never needs
« no previous file with comments | « chrome/browser/views/frame/browser_view.h ('k') | chrome/browser/views/frame/browser_window_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698