| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_SYNC_GLUE_THEME_UTIL_H_ | 5 #ifndef CHROME_BROWSER_SYNC_GLUE_THEME_UTIL_H_ |
| 6 #define CHROME_BROWSER_SYNC_GLUE_THEME_UTIL_H_ | 6 #define CHROME_BROWSER_SYNC_GLUE_THEME_UTIL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 class Profile; |
| 10 |
| 11 namespace extensions { |
| 9 class Extension; | 12 class Extension; |
| 10 class Profile; | 13 } |
| 11 | 14 |
| 12 namespace sync_pb { | 15 namespace sync_pb { |
| 13 class ThemeSpecifics; | 16 class ThemeSpecifics; |
| 14 } // sync_pb | 17 } // sync_pb |
| 15 | 18 |
| 16 namespace browser_sync { | 19 namespace browser_sync { |
| 17 | 20 |
| 18 extern const char kCurrentThemeClientTag[]; | 21 extern const char kCurrentThemeClientTag[]; |
| 19 | 22 |
| 20 // Returns true iff two ThemeSpecifics indicate the same theme. | 23 // Returns true iff two ThemeSpecifics indicate the same theme. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 34 Profile* profile); | 37 Profile* profile); |
| 35 | 38 |
| 36 // Sets all fields of the given ThemeSpecifics according to the | 39 // Sets all fields of the given ThemeSpecifics according to the |
| 37 // current theme. | 40 // current theme. |
| 38 void GetThemeSpecificsFromCurrentTheme( | 41 void GetThemeSpecificsFromCurrentTheme( |
| 39 Profile* profile, | 42 Profile* profile, |
| 40 sync_pb::ThemeSpecifics* theme_specifics); | 43 sync_pb::ThemeSpecifics* theme_specifics); |
| 41 | 44 |
| 42 // Exposed only for testing. | 45 // Exposed only for testing. |
| 43 void GetThemeSpecificsFromCurrentThemeHelper( | 46 void GetThemeSpecificsFromCurrentThemeHelper( |
| 44 const Extension* current_theme, | 47 const extensions::Extension* current_theme, |
| 45 bool is_system_theme_distinct_from_default_theme, | 48 bool is_system_theme_distinct_from_default_theme, |
| 46 bool use_system_theme_by_default, | 49 bool use_system_theme_by_default, |
| 47 sync_pb::ThemeSpecifics* theme_specifics); | 50 sync_pb::ThemeSpecifics* theme_specifics); |
| 48 | 51 |
| 49 // Like SetChrrentThemeFromThemeSpecifics() except does nothing if the | 52 // Like SetChrrentThemeFromThemeSpecifics() except does nothing if the |
| 50 // current theme is equivalent to that described by theme_specifics. | 53 // current theme is equivalent to that described by theme_specifics. |
| 51 void SetCurrentThemeFromThemeSpecificsIfNecessary( | 54 void SetCurrentThemeFromThemeSpecificsIfNecessary( |
| 52 const sync_pb::ThemeSpecifics& theme_specifics, Profile* profile); | 55 const sync_pb::ThemeSpecifics& theme_specifics, Profile* profile); |
| 53 | 56 |
| 54 // Like SetCurrentThemeFromThemeSpecifics() except that in the case where | 57 // Like SetCurrentThemeFromThemeSpecifics() except that in the case where |
| 55 // |theme_specifics| uses the default theme and |profile| does not, the local | 58 // |theme_specifics| uses the default theme and |profile| does not, the local |
| 56 // data "wins" against the server's and |theme_specifics| is updated with the | 59 // data "wins" against the server's and |theme_specifics| is updated with the |
| 57 // custom theme. Returns true iff |theme_specifics| is updated. | 60 // custom theme. Returns true iff |theme_specifics| is updated. |
| 58 bool UpdateThemeSpecificsOrSetCurrentThemeIfNecessary( | 61 bool UpdateThemeSpecificsOrSetCurrentThemeIfNecessary( |
| 59 Profile* profile, sync_pb::ThemeSpecifics* theme_specifics); | 62 Profile* profile, sync_pb::ThemeSpecifics* theme_specifics); |
| 60 | 63 |
| 61 } // namespace browser_sync | 64 } // namespace browser_sync |
| 62 | 65 |
| 63 #endif // CHROME_BROWSER_SYNC_GLUE_THEME_UTIL_H_ | 66 #endif // CHROME_BROWSER_SYNC_GLUE_THEME_UTIL_H_ |
| OLD | NEW |