summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/ui/views/first_run_bubble.cc9
-rw-r--r--chrome/browser/ui/views/location_bar/location_bar_view.cc10
2 files changed, 13 insertions, 6 deletions
diff --git a/chrome/browser/ui/views/first_run_bubble.cc b/chrome/browser/ui/views/first_run_bubble.cc
index 820d27c..b101079 100644
--- a/chrome/browser/ui/views/first_run_bubble.cc
+++ b/chrome/browser/ui/views/first_run_bubble.cc
@@ -511,6 +511,15 @@ FirstRunBubble::~FirstRunBubble() {
void FirstRunBubble::EnableParent() {
::EnableWindow(GetParent(), true);
+ // The EnableWindow() call above causes the parent to become active, which
+ // resets the flag set by Bubble's call to DisableInactiveRendering(), so we
+ // have to call it again before activating the bubble to prevent the parent
+ // window from rendering inactive.
+ // TODO(beng): this only works in custom-frame mode, not glass-frame mode.
+ views::NativeWidget* parent =
+ views::NativeWidget::GetNativeWidgetForNativeView(GetParent());
+ if (parent)
+ parent->GetWidget()->GetWindow()->DisableInactiveRendering();
// Reactivate the FirstRunBubble so it responds to OnActivate messages.
SetWindowPos(GetParent(), 0, 0, 0, 0,
SWP_NOSIZE | SWP_NOMOVE | SWP_NOREDRAW | SWP_SHOWWINDOW);
diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc
index cb193b8..08f4b0e 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -964,11 +964,6 @@ void LocationBarView::OnMouseEvent(const views::MouseEvent& event, UINT msg) {
void LocationBarView::ShowFirstRunBubbleInternal(
FirstRun::BubbleType bubble_type) {
#if defined(OS_WIN) // First run bubble doesn't make sense for Chrome OS.
- // If the browser is no longer active, let's not show the info bubble, as this
- // would make the browser the active window again.
- if (!location_entry_view_ || !location_entry_view_->GetWidget()->IsActive())
- return;
-
// Point at the start of the edit control; adjust to look as good as possible.
const int kXOffset = kNormalHorizontalEdgeThickness + kEdgeItemPadding +
ResourceBundle::GetSharedInstance().GetBitmapNamed(
@@ -1187,7 +1182,10 @@ void LocationBarView::TestPageActionPressed(size_t index) {
void LocationBarView::OnTemplateURLModelChanged() {
template_url_model_->RemoveObserver(this);
template_url_model_ = NULL;
- ShowFirstRunBubble(bubble_type_);
+ // If the browser is no longer active, let's not show the info bubble, as this
+ // would make the browser the active window again.
+ if (location_entry_view_ && location_entry_view_->GetWidget()->IsActive())
+ ShowFirstRunBubble(bubble_type_);
}
void LocationBarView::Observe(NotificationType type,