Index: chrome/browser/first_run/first_run.cc |
diff --git a/chrome/browser/first_run/first_run.cc b/chrome/browser/first_run/first_run.cc |
index 255a6da4c41e3ff96fac76976fc0431d87c43e9b..5703dd9575663ea234eb9be960487575c48fbcfb 100644 |
--- a/chrome/browser/first_run/first_run.cc |
+++ b/chrome/browser/first_run/first_run.cc |
@@ -6,14 +6,17 @@ |
#include <algorithm> |
+#include "base/bind_helpers.h" |
#include "base/command_line.h" |
#include "base/compiler_specific.h" |
#include "base/file_util.h" |
#include "base/lazy_instance.h" |
+#include "base/message_loop.h" |
#include "base/metrics/histogram.h" |
#include "base/path_service.h" |
#include "base/prefs/pref_service.h" |
#include "base/stringprintf.h" |
+#include "base/time.h" |
#include "base/utf_string_conversions.h" |
#include "build/build_config.h" |
#include "chrome/browser/browser_process.h" |
@@ -61,6 +64,9 @@ using content::UserMetricsAction; |
namespace { |
+// How long to delay showing the first run bubble (in milliseconds). |
+const int kFirstRunBubbleDelayMs = 200; |
+ |
// Flags for functions of similar name. |
bool should_show_welcome_page_ = false; |
bool should_do_autofill_personal_data_manager_first_run_ = false; |
@@ -574,8 +580,15 @@ void FirstRunBubbleLauncher::Observe( |
prefs->SetInteger(prefs::kShowFirstRunBubbleOption, |
FIRST_RUN_BUBBLE_DONT_SHOW); |
- // Show the bubble now and destroy this bubble launcher. |
- browser->ShowFirstRunBubble(); |
+ // Show the bubble soon. |
+ base::MessageLoop::current()->PostDelayedTask( |
+ FROM_HERE, |
+ base::Bind( |
+ &Browser::ShowFirstRunBubble, |
+ base::Unretained(browser)), |
grt (UTC plus 2)
2013/04/10 15:14:06
this will be crashy since the browser window could
macourteau
2013/04/10 20:54:26
Thanks for the suggestion - helped a lot. I've mer
|
+ base::TimeDelta::FromMilliseconds(kFirstRunBubbleDelayMs)); |
+ |
+ // Destroy this bubble launcher. |
delete this; |
} |