Commit 1c6e122c authored by achuith@chromium.org's avatar achuith@chromium.org

Once we initiate shutdown sequence, don't show crash bar on subsequent startup.

BUG=chromium-os:10923
TEST=Open 20 gmail windows in Chrome on ChromeOS, hit the power button twice to shutdown, then restart and login. With this chagne, you should see the 20 gmail windows instead of a crash bar.

Review URL: http://codereview.chromium.org/6257014

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72697 0039d316-1c4b-4281-b951-d872f2087c98
parent 75125812
...@@ -187,6 +187,12 @@ void BrowserList::AddBrowser(Browser* browser) { ...@@ -187,6 +187,12 @@ void BrowserList::AddBrowser(Browser* browser) {
<< "observer list modified during notification"; << "observer list modified during notification";
} }
// static
void BrowserList::MarkAsCleanShutdown() {
for (const_iterator i = begin(); i != end(); ++i) {
(*i)->profile()->MarkAsCleanShutdown();
}
}
// static // static
void BrowserList::NotifyAndTerminate() { void BrowserList::NotifyAndTerminate() {
...@@ -281,8 +287,7 @@ void BrowserList::RemoveObserver(BrowserList::Observer* observer) { ...@@ -281,8 +287,7 @@ void BrowserList::RemoveObserver(BrowserList::Observer* observer) {
// static // static
bool BrowserList::NeedBeforeUnloadFired() { bool BrowserList::NeedBeforeUnloadFired() {
bool need_before_unload_fired = false; bool need_before_unload_fired = false;
for (BrowserList::const_iterator i = BrowserList::begin(); for (const_iterator i = begin(); i != end(); ++i) {
i != BrowserList::end(); ++i) {
need_before_unload_fired = need_before_unload_fired || need_before_unload_fired = need_before_unload_fired ||
(*i)->TabsNeedBeforeUnloadFired(); (*i)->TabsNeedBeforeUnloadFired();
} }
...@@ -291,8 +296,7 @@ bool BrowserList::NeedBeforeUnloadFired() { ...@@ -291,8 +296,7 @@ bool BrowserList::NeedBeforeUnloadFired() {
// static // static
bool BrowserList::PendingDownloads() { bool BrowserList::PendingDownloads() {
for (BrowserList::const_iterator i = BrowserList::begin(); for (const_iterator i = begin(); i != end(); ++i) {
i != BrowserList::end(); ++i) {
bool normal_downloads_are_present = false; bool normal_downloads_are_present = false;
bool incognito_downloads_are_present = false; bool incognito_downloads_are_present = false;
(*i)->CheckDownloadsInProgress(&normal_downloads_are_present, (*i)->CheckDownloadsInProgress(&normal_downloads_are_present,
...@@ -373,6 +377,7 @@ void BrowserList::Exit() { ...@@ -373,6 +377,7 @@ void BrowserList::Exit() {
// static // static
void BrowserList::CloseAllBrowsersAndExit() { void BrowserList::CloseAllBrowsersAndExit() {
MarkAsCleanShutdown(); // Don't notify users of crashes beyond this point.
NotificationService::current()->Notify( NotificationService::current()->Notify(
NotificationType::APP_EXITING, NotificationType::APP_EXITING,
NotificationService::AllSources(), NotificationService::AllSources(),
......
...@@ -167,6 +167,7 @@ class BrowserList { ...@@ -167,6 +167,7 @@ class BrowserList {
private: private:
// Helper method to remove a browser instance from a list of browsers // Helper method to remove a browser instance from a list of browsers
static void RemoveBrowserFrom(Browser* browser, BrowserVector* browser_list); static void RemoveBrowserFrom(Browser* browser, BrowserVector* browser_list);
static void MarkAsCleanShutdown();
static void NotifyAndTerminate(); static void NotifyAndTerminate();
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
static bool NeedBeforeUnloadFired(); static bool NeedBeforeUnloadFired();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment