| 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 "content/public/browser/notification_observer.h" | 15 #include "content/public/browser/notification_observer.h" |
| 16 #include "content/public/browser/notification_registrar.h" | 16 #include "content/public/browser/notification_registrar.h" |
| 17 #include "ui/gfx/native_widget_types.h" | 17 #include "ui/gfx/native_widget_types.h" |
| 18 | 18 |
| 19 class CommandLine; | 19 class CommandLine; |
| 20 class GURL; | 20 class GURL; |
| 21 class PrefRegistrySyncable; | |
| 22 class Profile; | 21 class Profile; |
| 23 | 22 |
| 24 namespace base { | 23 namespace base { |
| 25 class FilePath; | 24 class FilePath; |
| 26 } | 25 } |
| 27 | 26 |
| 27 namespace user_prefs { |
| 28 class PrefRegistrySyncable; |
| 29 } |
| 30 |
| 28 // This namespace contains the chrome first-run installation actions needed to | 31 // This namespace contains the chrome first-run installation actions needed to |
| 29 // fully test the custom installer. It also contains the opposite actions to | 32 // fully test the custom installer. It also contains the opposite actions to |
| 30 // execute during uninstall. When the first run UI is ready we won't | 33 // execute during uninstall. When the first run UI is ready we won't |
| 31 // do the actions unconditionally. Currently the only action is to create a | 34 // do the actions unconditionally. Currently the only action is to create a |
| 32 // desktop shortcut. | 35 // desktop shortcut. |
| 33 // | 36 // |
| 34 // The way we detect first-run is by looking at a 'sentinel' file. | 37 // The way we detect first-run is by looking at a 'sentinel' file. |
| 35 // If it does not exist we understand that we need to do the first time | 38 // If it does not exist we understand that we need to do the first time |
| 36 // install work for this user. After that the sentinel file is created. | 39 // install work for this user. After that the sentinel file is created. |
| 37 namespace first_run { | 40 namespace first_run { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 // Returns true if this is the first time chrome is run for this user. | 84 // Returns true if this is the first time chrome is run for this user. |
| 82 bool IsChromeFirstRun(); | 85 bool IsChromeFirstRun(); |
| 83 | 86 |
| 84 // Creates the sentinel file that signals that chrome has been configured. | 87 // Creates the sentinel file that signals that chrome has been configured. |
| 85 bool CreateSentinel(); | 88 bool CreateSentinel(); |
| 86 | 89 |
| 87 // Get RLZ ping delay pref name. | 90 // Get RLZ ping delay pref name. |
| 88 std::string GetPingDelayPrefName(); | 91 std::string GetPingDelayPrefName(); |
| 89 | 92 |
| 90 // Register user preferences used by the MasterPrefs structure. | 93 // Register user preferences used by the MasterPrefs structure. |
| 91 void RegisterUserPrefs(PrefRegistrySyncable* registry); | 94 void RegisterUserPrefs(user_prefs::PrefRegistrySyncable* registry); |
| 92 | 95 |
| 93 // Removes the sentinel file created in ConfigDone(). Returns false if the | 96 // Removes the sentinel file created in ConfigDone(). Returns false if the |
| 94 // sentinel file could not be removed. | 97 // sentinel file could not be removed. |
| 95 bool RemoveSentinel(); | 98 bool RemoveSentinel(); |
| 96 | 99 |
| 97 // Sets the kShowFirstRunBubbleOption local state pref so that the browser | 100 // Sets the kShowFirstRunBubbleOption local state pref so that the browser |
| 98 // shows the bubble once the main message loop gets going (or refrains from | 101 // shows the bubble once the main message loop gets going (or refrains from |
| 99 // showing the bubble, if |show_bubble| is not FIRST_RUN_BUBBLE_SHOW). | 102 // showing the bubble, if |show_bubble| is not FIRST_RUN_BUBBLE_SHOW). |
| 100 // Once FIRST_RUN_BUBBLE_SUPPRESS is set, no other value can be set. | 103 // Once FIRST_RUN_BUBBLE_SUPPRESS is set, no other value can be set. |
| 101 // Returns false if the pref service could not be retrieved. | 104 // Returns false if the pref service could not be retrieved. |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 const content::NotificationDetails& details) OVERRIDE; | 198 const content::NotificationDetails& details) OVERRIDE; |
| 196 | 199 |
| 197 content::NotificationRegistrar registrar_; | 200 content::NotificationRegistrar registrar_; |
| 198 | 201 |
| 199 DISALLOW_COPY_AND_ASSIGN(FirstRunBubbleLauncher); | 202 DISALLOW_COPY_AND_ASSIGN(FirstRunBubbleLauncher); |
| 200 }; | 203 }; |
| 201 | 204 |
| 202 } // namespace first_run | 205 } // namespace first_run |
| 203 | 206 |
| 204 #endif // CHROME_BROWSER_FIRST_RUN_FIRST_RUN_H_ | 207 #endif // CHROME_BROWSER_FIRST_RUN_FIRST_RUN_H_ |
| OLD | NEW |