| 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; |
| 11 class PrefServiceSyncable; | 11 class PrefRegistrySyncable; |
| 12 class Profile; | 12 class Profile; |
| 13 | 13 |
| 14 namespace base { | 14 namespace base { |
| 15 class FilePath; | 15 class FilePath; |
| 16 } | 16 } |
| 17 | 17 |
| 18 // This class will try to detect if the profile is on a network share and if | 18 // This class will try to detect if the profile is on a network share and if |
| 19 // this is the case notify the user with an info bubble. | 19 // this is the case notify the user with an info bubble. |
| 20 class NetworkProfileBubble { | 20 class NetworkProfileBubble { |
| 21 public: | 21 public: |
| (...skipping 29 matching lines...) Expand all Loading... |
| 51 // Verifies that the profile folder is not located on a network share, and if | 51 // Verifies that the profile folder is not located on a network share, and if |
| 52 // it is shows the warning bubble to the user. | 52 // it is shows the warning bubble to the user. |
| 53 static void CheckNetworkProfile(const base::FilePath& profile_folder); | 53 static void CheckNetworkProfile(const base::FilePath& profile_folder); |
| 54 | 54 |
| 55 // Shows the notification bubble using the provided |browser|. | 55 // Shows the notification bubble using the provided |browser|. |
| 56 static void ShowNotification(Browser* browser); | 56 static void ShowNotification(Browser* browser); |
| 57 | 57 |
| 58 static void SetNotificationShown(bool shown); | 58 static void SetNotificationShown(bool shown); |
| 59 | 59 |
| 60 // Register the pref that controls whether the bubble should be shown anymore. | 60 // Register the pref that controls whether the bubble should be shown anymore. |
| 61 static void RegisterUserPrefs(PrefServiceSyncable* prefs); | 61 static void RegisterUserPrefs(PrefRegistrySyncable* registry); |
| 62 | 62 |
| 63 // Helper function wrapping the UMA_HISTOGRAM_ENUMERATION macro. | 63 // Helper function wrapping the UMA_HISTOGRAM_ENUMERATION macro. |
| 64 static void RecordUmaEvent(MetricNetworkedProfileCheck event); | 64 static void RecordUmaEvent(MetricNetworkedProfileCheck event); |
| 65 | 65 |
| 66 private: | 66 private: |
| 67 // This function creates the notification bubble, attaches it to the | 67 // This function creates the notification bubble, attaches it to the |
| 68 // |anchor| View and then shows it to the user. | 68 // |anchor| View and then shows it to the user. |
| 69 static void NotifyNetworkProfileDetected(); | 69 static void NotifyNetworkProfileDetected(); |
| 70 | 70 |
| 71 // Set to true once the notification check has been performed to avoid showing | 71 // Set to true once the notification check has been performed to avoid showing |
| 72 // the notification more than once per browser run. | 72 // the notification more than once per browser run. |
| 73 // This flag is not thread-safe and should only be accessed on the UI thread! | 73 // This flag is not thread-safe and should only be accessed on the UI thread! |
| 74 static bool notification_shown_; | 74 static bool notification_shown_; |
| 75 | 75 |
| 76 DISALLOW_IMPLICIT_CONSTRUCTORS(NetworkProfileBubble); | 76 DISALLOW_IMPLICIT_CONSTRUCTORS(NetworkProfileBubble); |
| 77 }; | 77 }; |
| 78 | 78 |
| 79 #endif // CHROME_BROWSER_UI_NETWORK_PROFILE_BUBBLE_H_ | 79 #endif // CHROME_BROWSER_UI_NETWORK_PROFILE_BUBBLE_H_ |
| OLD | NEW |