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/startup/default_browser_prompt.h" | 5 #include "chrome/browser/ui/startup/default_browser_prompt.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 } | 253 } |
254 | 254 |
255 void CheckDefaultBrowserObserver::ResetCheckDefaultBrowserPref() { | 255 void CheckDefaultBrowserObserver::ResetCheckDefaultBrowserPref() { |
256 Profile* profile = | 256 Profile* profile = |
257 g_browser_process->profile_manager()->GetProfileByPath(profile_path_); | 257 g_browser_process->profile_manager()->GetProfileByPath(profile_path_); |
258 if (profile) | 258 if (profile) |
259 profile->GetPrefs()->SetBoolean(prefs::kCheckDefaultBrowser, true); | 259 profile->GetPrefs()->SetBoolean(prefs::kCheckDefaultBrowser, true); |
260 } | 260 } |
261 | 261 |
262 void CheckDefaultBrowserObserver::ShowPrompt() { | 262 void CheckDefaultBrowserObserver::ShowPrompt() { |
263 Browser* browser = chrome::FindLastActiveWithHostDesktopType(desktop_type_); | 263 Browser* browser = chrome::FindLastActive(); |
264 if (!browser) | 264 if (!browser) |
265 return; // Reached during ui tests. | 265 return; // Reached during ui tests. |
266 | 266 |
267 // In ChromeBot tests, there might be a race. This line appears to get | 267 // In ChromeBot tests, there might be a race. This line appears to get |
268 // called during shutdown and |tab| can be NULL. | 268 // called during shutdown and |tab| can be NULL. |
269 content::WebContents* web_contents = | 269 content::WebContents* web_contents = |
270 browser->tab_strip_model()->GetActiveWebContents(); | 270 browser->tab_strip_model()->GetActiveWebContents(); |
271 if (!web_contents) | 271 if (!web_contents) |
272 return; | 272 return; |
273 | 273 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 ->StartCheckIsDefault(); | 327 ->StartCheckIsDefault(); |
328 } | 328 } |
329 | 329 |
330 #if !defined(OS_WIN) | 330 #if !defined(OS_WIN) |
331 bool ShowFirstRunDefaultBrowserPrompt(Profile* profile) { | 331 bool ShowFirstRunDefaultBrowserPrompt(Profile* profile) { |
332 return false; | 332 return false; |
333 } | 333 } |
334 #endif | 334 #endif |
335 | 335 |
336 } // namespace chrome | 336 } // namespace chrome |
OLD | NEW |