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 "chrome/browser/prefs/pref_service.h" | 7 #include "chrome/browser/prefs/pref_service.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/shell_integration.h" | 9 #include "chrome/browser/shell_integration.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 Profile* profile_; | 47 Profile* profile_; |
48 | 48 |
49 DISALLOW_COPY_AND_ASSIGN(SetMetroBrowserFlowLauncher); | 49 DISALLOW_COPY_AND_ASSIGN(SetMetroBrowserFlowLauncher); |
50 }; | 50 }; |
51 | 51 |
52 void SetMetroBrowserFlowLauncher::Observe( | 52 void SetMetroBrowserFlowLauncher::Observe( |
53 int type, | 53 int type, |
54 const content::NotificationSource& source, | 54 const content::NotificationSource& source, |
55 const content::NotificationDetails& details) { | 55 const content::NotificationDetails& details) { |
56 DCHECK_EQ(type, content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME); | 56 DCHECK_EQ(type, content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME); |
57 Browser* browser = browser::FindBrowserWithWebContents( | 57 Browser* browser = chrome::FindBrowserWithWebContents( |
58 content::Source<content::WebContents>(source).ptr()); | 58 content::Source<content::WebContents>(source).ptr()); |
59 | 59 |
60 if (!browser || !browser->is_type_tabbed()) | 60 if (!browser || !browser->is_type_tabbed()) |
61 return; | 61 return; |
62 | 62 |
63 // Unregister and delete. | 63 // Unregister and delete. |
64 registrar_.RemoveAll(); | 64 registrar_.RemoveAll(); |
65 SetAsDefaultBrowserUI::Show(profile_, browser); | 65 SetAsDefaultBrowserUI::Show(profile_, browser); |
66 delete this; | 66 delete this; |
67 } | 67 } |
(...skipping 14 matching lines...) Expand all Loading... |
82 | 82 |
83 if (show_status) { | 83 if (show_status) { |
84 startup_metric_utils::SetNonBrowserUIDisplayed(); | 84 startup_metric_utils::SetNonBrowserUIDisplayed(); |
85 SetMetroBrowserFlowLauncher::LaunchSoon(profile); | 85 SetMetroBrowserFlowLauncher::LaunchSoon(profile); |
86 } | 86 } |
87 | 87 |
88 return show_status; | 88 return show_status; |
89 } | 89 } |
90 | 90 |
91 } // namespace chrome | 91 } // namespace chrome |
OLD | NEW |