| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 5198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5209 | 5209 |
| 5210 void Browser::ToggleSpeechInput() { | 5210 void Browser::ToggleSpeechInput() { |
| 5211 GetSelectedTabContentsWrapper()->render_view_host()->ToggleSpeechInput(); | 5211 GetSelectedTabContentsWrapper()->render_view_host()->ToggleSpeechInput(); |
| 5212 } | 5212 } |
| 5213 | 5213 |
| 5214 void Browser::OnWindowDidShow() { | 5214 void Browser::OnWindowDidShow() { |
| 5215 if (window_has_shown_) | 5215 if (window_has_shown_) |
| 5216 return; | 5216 return; |
| 5217 window_has_shown_ = true; | 5217 window_has_shown_ = true; |
| 5218 | 5218 |
| 5219 bool did_show_bubble = false; | |
| 5220 | |
| 5221 // Show the First Run information bubble if we've been told to. | 5219 // Show the First Run information bubble if we've been told to. |
| 5222 PrefService* local_state = g_browser_process->local_state(); | 5220 PrefService* local_state = g_browser_process->local_state(); |
| 5223 if (local_state && | 5221 if (local_state && |
| 5224 local_state->FindPreference(prefs::kShouldShowFirstRunBubble) && | 5222 local_state->FindPreference(prefs::kShouldShowFirstRunBubble) && |
| 5225 local_state->GetBoolean(prefs::kShouldShowFirstRunBubble)) { | 5223 local_state->GetBoolean(prefs::kShouldShowFirstRunBubble)) { |
| 5226 FirstRun::BubbleType bubble_type = FirstRun::LARGE_BUBBLE; | 5224 FirstRun::BubbleType bubble_type = FirstRun::LARGE_BUBBLE; |
| 5227 if (local_state-> | 5225 if (local_state-> |
| 5228 FindPreference(prefs::kShouldUseOEMFirstRunBubble) && | 5226 FindPreference(prefs::kShouldUseOEMFirstRunBubble) && |
| 5229 local_state->GetBoolean(prefs::kShouldUseOEMFirstRunBubble)) { | 5227 local_state->GetBoolean(prefs::kShouldUseOEMFirstRunBubble)) { |
| 5230 bubble_type = FirstRun::OEM_BUBBLE; | 5228 bubble_type = FirstRun::OEM_BUBBLE; |
| 5231 } else if (local_state-> | 5229 } else if (local_state-> |
| 5232 FindPreference(prefs::kShouldUseMinimalFirstRunBubble) && | 5230 FindPreference(prefs::kShouldUseMinimalFirstRunBubble) && |
| 5233 local_state->GetBoolean(prefs::kShouldUseMinimalFirstRunBubble)) { | 5231 local_state->GetBoolean(prefs::kShouldUseMinimalFirstRunBubble)) { |
| 5234 bubble_type = FirstRun::MINIMAL_BUBBLE; | 5232 bubble_type = FirstRun::MINIMAL_BUBBLE; |
| 5235 } | 5233 } |
| 5236 // Reset the preference so we don't show the bubble for subsequent windows. | 5234 // Reset the preference so we don't show the bubble for subsequent windows. |
| 5237 local_state->ClearPref(prefs::kShouldShowFirstRunBubble); | 5235 local_state->ClearPref(prefs::kShouldShowFirstRunBubble); |
| 5238 window_->GetLocationBar()->ShowFirstRunBubble(bubble_type); | 5236 window_->GetLocationBar()->ShowFirstRunBubble(bubble_type); |
| 5239 did_show_bubble = true; | |
| 5240 } else if (is_type_tabbed()) { | 5237 } else if (is_type_tabbed()) { |
| 5241 GlobalErrorService* service = | 5238 GlobalErrorService* service = |
| 5242 GlobalErrorServiceFactory::GetForProfile(profile()); | 5239 GlobalErrorServiceFactory::GetForProfile(profile()); |
| 5243 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); | 5240 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); |
| 5244 if (error) { | 5241 if (error) { |
| 5245 error->ShowBubbleView(this); | 5242 error->ShowBubbleView(this); |
| 5246 did_show_bubble = true; | |
| 5247 } | 5243 } |
| 5248 } | 5244 } |
| 5249 } | 5245 } |
| OLD | NEW |