Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Side by Side Diff: chrome/browser/ui/browser.cc

Issue 9016036: Implement the new first run bubble, clean up old bubbles. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync and merge, fix SetShowFirstRunBubblePref and test, update copyright years. Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 5362 matching lines...) Expand 10 before | Expand all | Expand 10 after
5373 5373
5374 // Nothing to do for non-tabbed windows. 5374 // Nothing to do for non-tabbed windows.
5375 if (!is_type_tabbed()) 5375 if (!is_type_tabbed())
5376 return; 5376 return;
5377 5377
5378 // Suppress the first run bubble if we're showing the sync promo. 5378 // Suppress the first run bubble if we're showing the sync promo.
5379 WebContents* contents = GetSelectedWebContents(); 5379 WebContents* contents = GetSelectedWebContents();
5380 bool is_showing_promo = contents && 5380 bool is_showing_promo = contents &&
5381 contents->GetURL().SchemeIs(chrome::kChromeUIScheme) && 5381 contents->GetURL().SchemeIs(chrome::kChromeUIScheme) &&
5382 contents->GetURL().host() == chrome::kChromeUISyncPromoHost; 5382 contents->GetURL().host() == chrome::kChromeUISyncPromoHost;
5383
5384 // Show the First Run information bubble if we've been told to.
5385 PrefService* local_state = g_browser_process->local_state(); 5383 PrefService* local_state = g_browser_process->local_state();
5386 if (!is_showing_promo && local_state && 5384 if (!is_showing_promo && local_state &&
5387 local_state->GetBoolean(prefs::kShouldShowFirstRunBubble)) { 5385 local_state->GetBoolean(prefs::kShouldShowFirstRunBubble)) {
5388 FirstRun::BubbleType bubble_type = FirstRun::MINIMAL_BUBBLE; 5386 // Reset the preference to avoid showing the bubble for subsequent windows.
5389 if (local_state->
5390 FindPreference(prefs::kShouldUseOEMFirstRunBubble) &&
5391 local_state->GetBoolean(prefs::kShouldUseOEMFirstRunBubble)) {
5392 bubble_type = FirstRun::OEM_BUBBLE;
5393 } else if (local_state->
5394 FindPreference(prefs::kShouldUseMinimalFirstRunBubble) &&
5395 local_state->GetBoolean(prefs::kShouldUseMinimalFirstRunBubble)) {
5396 bubble_type = FirstRun::MINIMAL_BUBBLE;
5397 }
5398 // Reset the preference so we don't show the bubble for subsequent
5399 // windows.
5400 local_state->SetBoolean(prefs::kShouldShowFirstRunBubble, false); 5387 local_state->SetBoolean(prefs::kShouldShowFirstRunBubble, false);
5401 window_->GetLocationBar()->ShowFirstRunBubble(bubble_type); 5388 window_->GetLocationBar()->ShowFirstRunBubble();
5402 } else { 5389 } else {
5403 GlobalErrorService* service = 5390 GlobalErrorService* service =
5404 GlobalErrorServiceFactory::GetForProfile(profile()); 5391 GlobalErrorServiceFactory::GetForProfile(profile());
5405 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); 5392 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView();
5406 if (error) { 5393 if (error)
5407 error->ShowBubbleView(this); 5394 error->ShowBubbleView(this);
5408 }
5409 } 5395 }
5410 } 5396 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698