| 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 #ifndef CHROME_BROWSER_FIRST_RUN_FIRST_RUN_H_ | 5 #ifndef CHROME_BROWSER_FIRST_RUN_FIRST_RUN_H_ |
| 6 #define CHROME_BROWSER_FIRST_RUN_FIRST_RUN_H_ | 6 #define CHROME_BROWSER_FIRST_RUN_FIRST_RUN_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "base/memory/weak_ptr.h" |
| 16 #include "chrome/browser/ui/browser_list_observer.h" |
| 15 #include "content/public/browser/notification_observer.h" | 17 #include "content/public/browser/notification_observer.h" |
| 16 #include "content/public/browser/notification_registrar.h" | 18 #include "content/public/browser/notification_registrar.h" |
| 17 #include "ui/gfx/native_widget_types.h" | 19 #include "ui/gfx/native_widget_types.h" |
| 18 | 20 |
| 21 class Browser; |
| 19 class CommandLine; | 22 class CommandLine; |
| 20 class GURL; | 23 class GURL; |
| 21 class PrefRegistrySyncable; | 24 class PrefRegistrySyncable; |
| 22 class Profile; | 25 class Profile; |
| 23 class ProcessSingleton; | 26 class ProcessSingleton; |
| 24 | 27 |
| 25 namespace base { | 28 namespace base { |
| 26 class FilePath; | 29 class FilePath; |
| 27 } | 30 } |
| 28 | 31 |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 // invoked only on first run. | 180 // invoked only on first run. |
| 178 // | 181 // |
| 179 // See chrome/installer/util/master_preferences.h for a description of | 182 // See chrome/installer/util/master_preferences.h for a description of |
| 180 // 'master_preferences' file. | 183 // 'master_preferences' file. |
| 181 ProcessMasterPreferencesResult ProcessMasterPreferences( | 184 ProcessMasterPreferencesResult ProcessMasterPreferences( |
| 182 const base::FilePath& user_data_dir, | 185 const base::FilePath& user_data_dir, |
| 183 MasterPrefs* out_prefs); | 186 MasterPrefs* out_prefs); |
| 184 | 187 |
| 185 // Show the first run search engine bubble at the first appropriate opportunity. | 188 // Show the first run search engine bubble at the first appropriate opportunity. |
| 186 // This bubble may be delayed by other UI, like global errors and sync promos. | 189 // This bubble may be delayed by other UI, like global errors and sync promos. |
| 187 class FirstRunBubbleLauncher : public content::NotificationObserver { | 190 class FirstRunBubbleLauncher |
| 191 : public content::NotificationObserver, |
| 192 public chrome::BrowserListObserver, |
| 193 public base::SupportsWeakPtr<FirstRunBubbleLauncher> { |
| 188 public: | 194 public: |
| 189 // Show the bubble at the first appropriate opportunity. This function | 195 // Show the bubble at the first appropriate opportunity. This function |
| 190 // instantiates a FirstRunBubbleLauncher, which manages its own lifetime. | 196 // instantiates a FirstRunBubbleLauncher, which manages its own lifetime. |
| 191 static void ShowFirstRunBubbleSoon(); | 197 static void ShowFirstRunBubbleSoon(); |
| 192 | 198 |
| 193 private: | 199 private: |
| 194 FirstRunBubbleLauncher(); | 200 FirstRunBubbleLauncher(); |
| 195 virtual ~FirstRunBubbleLauncher(); | 201 virtual ~FirstRunBubbleLauncher(); |
| 196 | 202 |
| 197 // content::NotificationObserver override: | 203 // content::NotificationObserver override: |
| 198 virtual void Observe(int type, | 204 virtual void Observe(int type, |
| 199 const content::NotificationSource& source, | 205 const content::NotificationSource& source, |
| 200 const content::NotificationDetails& details) OVERRIDE; | 206 const content::NotificationDetails& details) OVERRIDE; |
| 201 | 207 |
| 208 // chrome::BrowserListObserver override: |
| 209 virtual void OnBrowserRemoved(Browser* browser) OVERRIDE; |
| 210 |
| 211 void DoShowFirstRunBubble(); |
| 212 |
| 202 content::NotificationRegistrar registrar_; | 213 content::NotificationRegistrar registrar_; |
| 214 Browser* browser_; |
| 203 | 215 |
| 204 DISALLOW_COPY_AND_ASSIGN(FirstRunBubbleLauncher); | 216 DISALLOW_COPY_AND_ASSIGN(FirstRunBubbleLauncher); |
| 205 }; | 217 }; |
| 206 | 218 |
| 207 } // namespace first_run | 219 } // namespace first_run |
| 208 | 220 |
| 209 #endif // CHROME_BROWSER_FIRST_RUN_FIRST_RUN_H_ | 221 #endif // CHROME_BROWSER_FIRST_RUN_FIRST_RUN_H_ |
| OLD | NEW |