| 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/ui/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #include <shellapi.h> | 9 #include <shellapi.h> |
| 10 #endif // OS_WIN | 10 #endif // OS_WIN |
| (...skipping 5451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5462 | 5462 |
| 5463 // Nothing to do for non-tabbed windows. | 5463 // Nothing to do for non-tabbed windows. |
| 5464 if (!is_type_tabbed()) | 5464 if (!is_type_tabbed()) |
| 5465 return; | 5465 return; |
| 5466 | 5466 |
| 5467 // Suppress the first run bubble if we're showing the sync promo. | 5467 // Suppress the first run bubble if we're showing the sync promo. |
| 5468 WebContents* contents = GetSelectedWebContents(); | 5468 WebContents* contents = GetSelectedWebContents(); |
| 5469 bool is_showing_promo = contents && | 5469 bool is_showing_promo = contents && |
| 5470 contents->GetURL().SchemeIs(chrome::kChromeUIScheme) && | 5470 contents->GetURL().SchemeIs(chrome::kChromeUIScheme) && |
| 5471 contents->GetURL().host() == chrome::kChromeUISyncPromoHost; | 5471 contents->GetURL().host() == chrome::kChromeUISyncPromoHost; |
| 5472 | |
| 5473 // Show the First Run information bubble if we've been told to. | |
| 5474 PrefService* local_state = g_browser_process->local_state(); | 5472 PrefService* local_state = g_browser_process->local_state(); |
| 5475 if (!is_showing_promo && local_state && | 5473 if (!is_showing_promo && local_state && |
| 5476 local_state->GetBoolean(prefs::kShouldShowFirstRunBubble)) { | 5474 local_state->GetBoolean(prefs::kShouldShowFirstRunBubble)) { |
| 5477 FirstRun::BubbleType bubble_type = FirstRun::MINIMAL_BUBBLE; | 5475 // Reset the preference to avoid showing the bubble for subsequent windows. |
| 5478 if (local_state-> | |
| 5479 FindPreference(prefs::kShouldUseOEMFirstRunBubble) && | |
| 5480 local_state->GetBoolean(prefs::kShouldUseOEMFirstRunBubble)) { | |
| 5481 bubble_type = FirstRun::OEM_BUBBLE; | |
| 5482 } else if (local_state-> | |
| 5483 FindPreference(prefs::kShouldUseMinimalFirstRunBubble) && | |
| 5484 local_state->GetBoolean(prefs::kShouldUseMinimalFirstRunBubble)) { | |
| 5485 bubble_type = FirstRun::MINIMAL_BUBBLE; | |
| 5486 } | |
| 5487 // Reset the preference so we don't show the bubble for subsequent | |
| 5488 // windows. | |
| 5489 local_state->SetBoolean(prefs::kShouldShowFirstRunBubble, false); | 5476 local_state->SetBoolean(prefs::kShouldShowFirstRunBubble, false); |
| 5490 window_->GetLocationBar()->ShowFirstRunBubble(bubble_type); | 5477 window_->GetLocationBar()->ShowFirstRunBubble(); |
| 5491 } else { | 5478 } else { |
| 5492 GlobalErrorService* service = | 5479 GlobalErrorService* service = |
| 5493 GlobalErrorServiceFactory::GetForProfile(profile()); | 5480 GlobalErrorServiceFactory::GetForProfile(profile()); |
| 5494 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); | 5481 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); |
| 5495 if (error) { | 5482 if (error) |
| 5496 error->ShowBubbleView(this); | 5483 error->ShowBubbleView(this); |
| 5497 } | |
| 5498 } | 5484 } |
| 5499 } | 5485 } |
| OLD | NEW |