| 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_UI_NETWORK_PROFILE_BUBBLE_H_ | 5 #ifndef CHROME_BROWSER_UI_NETWORK_PROFILE_BUBBLE_H_ |
| 6 #define CHROME_BROWSER_UI_NETWORK_PROFILE_BUBBLE_H_ | 6 #define CHROME_BROWSER_UI_NETWORK_PROFILE_BUBBLE_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 | 9 |
| 10 class Browser; | 10 class Browser; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 // Verifies that the profile folder is not located on a network share, and if | 54 // Verifies that the profile folder is not located on a network share, and if |
| 55 // it is shows the warning bubble to the user. | 55 // it is shows the warning bubble to the user. |
| 56 static void CheckNetworkProfile(const base::FilePath& profile_folder); | 56 static void CheckNetworkProfile(const base::FilePath& profile_folder); |
| 57 | 57 |
| 58 // Shows the notification bubble using the provided |browser|. | 58 // Shows the notification bubble using the provided |browser|. |
| 59 static void ShowNotification(Browser* browser); | 59 static void ShowNotification(Browser* browser); |
| 60 | 60 |
| 61 static void SetNotificationShown(bool shown); | 61 static void SetNotificationShown(bool shown); |
| 62 | 62 |
| 63 // Register the pref that controls whether the bubble should be shown anymore. | 63 // Register the pref that controls whether the bubble should be shown anymore. |
| 64 static void RegisterUserPrefs(user_prefs::PrefRegistrySyncable* registry); | 64 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
| 65 | 65 |
| 66 // Helper function wrapping the UMA_HISTOGRAM_ENUMERATION macro. | 66 // Helper function wrapping the UMA_HISTOGRAM_ENUMERATION macro. |
| 67 static void RecordUmaEvent(MetricNetworkedProfileCheck event); | 67 static void RecordUmaEvent(MetricNetworkedProfileCheck event); |
| 68 | 68 |
| 69 private: | 69 private: |
| 70 // This function creates the notification bubble, attaches it to the | 70 // This function creates the notification bubble, attaches it to the |
| 71 // |anchor| View and then shows it to the user. | 71 // |anchor| View and then shows it to the user. |
| 72 static void NotifyNetworkProfileDetected(); | 72 static void NotifyNetworkProfileDetected(); |
| 73 | 73 |
| 74 // Set to true once the notification check has been performed to avoid showing | 74 // Set to true once the notification check has been performed to avoid showing |
| 75 // the notification more than once per browser run. | 75 // the notification more than once per browser run. |
| 76 // This flag is not thread-safe and should only be accessed on the UI thread! | 76 // This flag is not thread-safe and should only be accessed on the UI thread! |
| 77 static bool notification_shown_; | 77 static bool notification_shown_; |
| 78 | 78 |
| 79 DISALLOW_IMPLICIT_CONSTRUCTORS(NetworkProfileBubble); | 79 DISALLOW_IMPLICIT_CONSTRUCTORS(NetworkProfileBubble); |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 #endif // CHROME_BROWSER_UI_NETWORK_PROFILE_BUBBLE_H_ | 82 #endif // CHROME_BROWSER_UI_NETWORK_PROFILE_BUBBLE_H_ |
| OLD | NEW |