Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(635)

Side by Side Diff: chrome/browser/prefs/session_startup_pref.h

Issue 10049005: Fix homepage migration for users who never changed their settings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_PREFS_SESSION_STARTUP_PREF_H__ 5 #ifndef CHROME_BROWSER_PREFS_SESSION_STARTUP_PREF_H__
6 #define CHROME_BROWSER_PREFS_SESSION_STARTUP_PREF_H__ 6 #define CHROME_BROWSER_PREFS_SESSION_STARTUP_PREF_H__
7 #pragma once 7 #pragma once
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 28 matching lines...) Expand all
39 // Returns the default value for |type|. 39 // Returns the default value for |type|.
40 static Type GetDefaultStartupType(); 40 static Type GetDefaultStartupType();
41 41
42 // What should happen on startup for the specified profile. 42 // What should happen on startup for the specified profile.
43 static void SetStartupPref(Profile* profile, const SessionStartupPref& pref); 43 static void SetStartupPref(Profile* profile, const SessionStartupPref& pref);
44 static void SetStartupPref(PrefService* prefs, 44 static void SetStartupPref(PrefService* prefs,
45 const SessionStartupPref& pref); 45 const SessionStartupPref& pref);
46 static SessionStartupPref GetStartupPref(Profile* profile); 46 static SessionStartupPref GetStartupPref(Profile* profile);
47 static SessionStartupPref GetStartupPref(PrefService* prefs); 47 static SessionStartupPref GetStartupPref(PrefService* prefs);
48 48
49 // Migrates from "Open the home page" to "Open the following URLs", and sets
50 // the list of URLs to a one-item list containing the user's homepage.
51 static void MigrateIfNecessary(PrefService* prefs);
52
49 // Whether the startup type and URLs are managed via policy. 53 // Whether the startup type and URLs are managed via policy.
50 static bool TypeIsManaged(PrefService* prefs); 54 static bool TypeIsManaged(PrefService* prefs);
51 static bool URLsAreManaged(PrefService* prefs); 55 static bool URLsAreManaged(PrefService* prefs);
52 56
53 // Converts an integer pref value to a SessionStartupPref::Type. 57 // Converts an integer pref value to a SessionStartupPref::Type.
54 static SessionStartupPref::Type PrefValueToType(int pref_value); 58 static SessionStartupPref::Type PrefValueToType(int pref_value);
55 59
56 // Returns |true| if a change to startup type or URLS was detected by 60 // Returns |true| if a change to startup type or URLS was detected by
57 // ProtectorService. 61 // ProtectorService.
58 static bool DidStartupPrefChange(Profile* profile); 62 static bool DidStartupPrefChange(Profile* profile);
59 63
60 // Returns the protected backup of startup type and URLS. 64 // Returns the protected backup of startup type and URLS.
61 static SessionStartupPref GetStartupPrefBackup(Profile* profile); 65 static SessionStartupPref GetStartupPrefBackup(Profile* profile);
62 66
63 explicit SessionStartupPref(Type type); 67 explicit SessionStartupPref(Type type);
64 68
65 ~SessionStartupPref(); 69 ~SessionStartupPref();
66 70
67 // What to do on startup. 71 // What to do on startup.
68 Type type; 72 Type type;
69 73
70 // The URLs to restore. Only used if type == URLS. 74 // The URLs to restore. Only used if type == URLS.
71 std::vector<GURL> urls; 75 std::vector<GURL> urls;
72 }; 76 };
73 77
74 #endif // CHROME_BROWSER_PREFS_SESSION_STARTUP_PREF_H__ 78 #endif // CHROME_BROWSER_PREFS_SESSION_STARTUP_PREF_H__
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/prefs/session_startup_pref.cc » ('j') | chrome/browser/prefs/session_startup_pref.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698