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 |