| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/first_run/first_run.h" | 5 #include "chrome/browser/first_run/first_run.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 delete this; | 512 delete this; |
| 513 return; | 513 return; |
| 514 } | 514 } |
| 515 | 515 |
| 516 content::WebContents* contents = browser->GetActiveWebContents(); | 516 content::WebContents* contents = browser->GetActiveWebContents(); |
| 517 if (contents && contents->GetURL().SchemeIs(chrome::kChromeUIScheme)) { | 517 if (contents && contents->GetURL().SchemeIs(chrome::kChromeUIScheme)) { |
| 518 // Suppress the first run bubble if the sync promo is showing. | 518 // Suppress the first run bubble if the sync promo is showing. |
| 519 if (contents->GetURL().host() == chrome::kChromeUISyncPromoHost) | 519 if (contents->GetURL().host() == chrome::kChromeUISyncPromoHost) |
| 520 return; | 520 return; |
| 521 | 521 |
| 522 // Suppress the first run bubble if 'make chrome metro' flow is showing. |
| 523 if (contents->GetURL().host() == chrome::kChromeUIMetroFlowHost) |
| 524 return; |
| 525 |
| 522 // Suppress the first run bubble if the NTP sync promo bubble is showing. | 526 // Suppress the first run bubble if the NTP sync promo bubble is showing. |
| 523 if (contents->GetURL().host() == chrome::kChromeUINewTabHost) { | 527 if (contents->GetURL().host() == chrome::kChromeUINewTabHost) { |
| 524 NewTabUI* new_tab_ui = | 528 NewTabUI* new_tab_ui = |
| 525 NewTabUI::FromWebUIController(contents->GetWebUI()->GetController()); | 529 NewTabUI::FromWebUIController(contents->GetWebUI()->GetController()); |
| 526 if (new_tab_ui && new_tab_ui->showing_sync_bubble()) | 530 if (new_tab_ui && new_tab_ui->showing_sync_bubble()) |
| 527 return; | 531 return; |
| 528 } | 532 } |
| 529 } | 533 } |
| 530 | 534 |
| 531 // Suppress the first run bubble if a global error bubble is pending. | 535 // Suppress the first run bubble if a global error bubble is pending. |
| 532 GlobalErrorService* global_error_service = | 536 GlobalErrorService* global_error_service = |
| 533 GlobalErrorServiceFactory::GetForProfile(browser->profile()); | 537 GlobalErrorServiceFactory::GetForProfile(browser->profile()); |
| 534 if (global_error_service->GetFirstGlobalErrorWithBubbleView() != NULL) | 538 if (global_error_service->GetFirstGlobalErrorWithBubbleView() != NULL) |
| 535 return; | 539 return; |
| 536 | 540 |
| 537 // Reset the preference and notifications to avoid showing the bubble again. | 541 // Reset the preference and notifications to avoid showing the bubble again. |
| 538 prefs->SetBoolean(prefs::kShouldShowFirstRunBubble, false); | 542 prefs->SetBoolean(prefs::kShouldShowFirstRunBubble, false); |
| 539 | 543 |
| 540 // Show the bubble now and destroy this bubble launcher. | 544 // Show the bubble now and destroy this bubble launcher. |
| 541 browser->ShowFirstRunBubble(); | 545 browser->ShowFirstRunBubble(); |
| 542 delete this; | 546 delete this; |
| 543 } | 547 } |
| 544 | 548 |
| 545 } // namespace first_run | 549 } // namespace first_run |
| OLD | NEW |