summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-11 22:25:27 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-11 22:25:27 +0000
commitc682e88298d4b52873348bd5b62befdb4c0d4992 (patch)
tree17182b1ff97114a8fcb92555fe59aa117fdbea9f
parentaa9a98a2a81bef4f88da964a7160031b8ff67a0e (diff)
downloadchromium_src-c682e88298d4b52873348bd5b62befdb4c0d4992.zip
chromium_src-c682e88298d4b52873348bd5b62befdb4c0d4992.tar.gz
chromium_src-c682e88298d4b52873348bd5b62befdb4c0d4992.tar.bz2
Merge 85061 - Allow the first-run bubble to be shown on organic first runs.
The code had some mysterious chokepoint that prevented the bubble from being shown if the attached parent window wasn't active. However the first run bubble is shown from the browser window's construction/init pass, before it's ever shown, so it can't be active. It turns out the chokepoint was to prevent the bubble from being shown later as the TemplateURLModel is loaded, so I moved the active check to that part of the code so that the initial display could work. http://crbug.com/78878 TEST=run chrome with --user-data-dir=c:\temp\test --first-run --organic (the user-data-dir MUST be empty!) - first run bubble should appear. also, browser window should render as active for at least 5-10 seconds after displaying. this code fixes a bug where running with just --first-run would have the browser appear inactive after about 3 seconds. Review URL: http://codereview.chromium.org/6973012 TBR=ben@chromium.org Review URL: http://codereview.chromium.org/7015011 git-svn-id: svn://svn.chromium.org/chrome/branches/742/src@85063 0039d316-1c4b-4281-b951-d872f2087c98
-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,