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_STARTUP_STARTUP_BROWSER_CREATOR_H_ | 5 #ifndef CHROME_BROWSER_UI_STARTUP_STARTUP_BROWSER_CREATOR_H_ |
6 #define CHROME_BROWSER_UI_STARTUP_STARTUP_BROWSER_CREATOR_H_ | 6 #define CHROME_BROWSER_UI_STARTUP_STARTUP_BROWSER_CREATOR_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 | 76 |
77 // When called the first time, reads the value of the preference kWasRestarted | 77 // When called the first time, reads the value of the preference kWasRestarted |
78 // and resets it to false. Subsequent calls return the value which was read | 78 // and resets it to false. Subsequent calls return the value which was read |
79 // the first time. | 79 // the first time. |
80 static bool WasRestarted(); | 80 static bool WasRestarted(); |
81 | 81 |
82 static SessionStartupPref GetSessionStartupPref( | 82 static SessionStartupPref GetSessionStartupPref( |
83 const CommandLine& command_line, | 83 const CommandLine& command_line, |
84 Profile* profile); | 84 Profile* profile); |
85 | 85 |
| 86 void set_suppressed_set_as_default_dialog(bool new_value) { |
| 87 suppressed_set_as_default_dialog_ = new_value; |
| 88 } |
| 89 |
| 90 bool get_suppressed_set_as_default_dialog() { |
| 91 return suppressed_set_as_default_dialog_; |
| 92 } |
86 private: | 93 private: |
87 friend class CloudPrintProxyPolicyTest; | 94 friend class CloudPrintProxyPolicyTest; |
88 friend class CloudPrintProxyPolicyStartupTest; | 95 friend class CloudPrintProxyPolicyStartupTest; |
89 friend class StartupBrowserCreatorImpl; | 96 friend class StartupBrowserCreatorImpl; |
90 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, | 97 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, |
91 ReadingWasRestartedAfterNormalStart); | 98 ReadingWasRestartedAfterNormalStart); |
92 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, | 99 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, |
93 ReadingWasRestartedAfterRestart); | 100 ReadingWasRestartedAfterRestart); |
94 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, UpdateWithTwoProfiles); | 101 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, UpdateWithTwoProfiles); |
95 | 102 |
(...skipping 15 matching lines...) Expand all Loading... |
111 // Callback after a profile has been created. | 118 // Callback after a profile has been created. |
112 static void ProcessCommandLineOnProfileCreated( | 119 static void ProcessCommandLineOnProfileCreated( |
113 const CommandLine& cmd_line, | 120 const CommandLine& cmd_line, |
114 const FilePath& cur_dir, | 121 const FilePath& cur_dir, |
115 Profile* profile, | 122 Profile* profile, |
116 Profile::CreateStatus status); | 123 Profile::CreateStatus status); |
117 | 124 |
118 // Additional tabs to open during first run. | 125 // Additional tabs to open during first run. |
119 std::vector<GURL> first_run_tabs_; | 126 std::vector<GURL> first_run_tabs_; |
120 | 127 |
| 128 // True if the set-as-default dialog has been explicitly supressed. |
| 129 // This information needs to be passed down to code setting chrome as the |
| 130 // default browser. |
| 131 bool suppressed_set_as_default_dialog_; |
| 132 |
121 // True if we have already read and reset the preference kWasRestarted. (A | 133 // True if we have already read and reset the preference kWasRestarted. (A |
122 // member variable instead of a static variable inside WasRestarted because | 134 // member variable instead of a static variable inside WasRestarted because |
123 // of testing.) | 135 // of testing.) |
124 static bool was_restarted_read_; | 136 static bool was_restarted_read_; |
125 | 137 |
126 DISALLOW_COPY_AND_ASSIGN(StartupBrowserCreator); | 138 DISALLOW_COPY_AND_ASSIGN(StartupBrowserCreator); |
127 }; | 139 }; |
128 | 140 |
129 #endif // CHROME_BROWSER_UI_STARTUP_STARTUP_BROWSER_CREATOR_H_ | 141 #endif // CHROME_BROWSER_UI_STARTUP_STARTUP_BROWSER_CREATOR_H_ |
OLD | NEW |