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

Side by Side Diff: chrome/browser/ui/browser_init.h

Issue 8937001: Fixes for the kWasRestarted pref. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Test build fix. Created 9 years 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_BROWSER_INIT_H_ 5 #ifndef CHROME_BROWSER_UI_BROWSER_INIT_H_
6 #define CHROME_BROWSER_UI_BROWSER_INIT_H_ 6 #define CHROME_BROWSER_UI_BROWSER_INIT_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 // implies that the directory of the executable should be used. 67 // implies that the directory of the executable should be used.
68 // |process_startup| indicates whether this is the first browser. 68 // |process_startup| indicates whether this is the first browser.
69 // |is_first_run| indicates that this is a new profile. 69 // |is_first_run| indicates that this is a new profile.
70 bool LaunchBrowser(const CommandLine& command_line, 70 bool LaunchBrowser(const CommandLine& command_line,
71 Profile* profile, 71 Profile* profile,
72 const FilePath& cur_dir, 72 const FilePath& cur_dir,
73 IsProcessStartup is_process_startup, 73 IsProcessStartup is_process_startup,
74 IsFirstRun is_first_run, 74 IsFirstRun is_first_run,
75 int* return_code); 75 int* return_code);
76 76
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
79 // the first time.
80 static bool WasRestarted();
81
77 // LaunchWithProfile --------------------------------------------------------- 82 // LaunchWithProfile ---------------------------------------------------------
78 // 83 //
79 // Assists launching the application and appending the initial tabs for a 84 // Assists launching the application and appending the initial tabs for a
80 // browser window. 85 // browser window.
81 86
82 class LaunchWithProfile { 87 class LaunchWithProfile {
83 public: 88 public:
84 // Used by OpenTabsInBrowser. 89 // Used by OpenTabsInBrowser.
85 struct Tab { 90 struct Tab {
86 Tab(); 91 Tab();
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 // Callback after a profile has been created. 248 // Callback after a profile has been created.
244 static void ProcessCommandLineOnProfileCreated( 249 static void ProcessCommandLineOnProfileCreated(
245 const CommandLine& cmd_line, 250 const CommandLine& cmd_line,
246 const FilePath& cur_dir, 251 const FilePath& cur_dir,
247 Profile* profile, 252 Profile* profile,
248 Profile::CreateStatus status); 253 Profile::CreateStatus status);
249 254
250 // Additional tabs to open during first run. 255 // Additional tabs to open during first run.
251 std::vector<GURL> first_run_tabs_; 256 std::vector<GURL> first_run_tabs_;
252 257
258 // Stores the value of the preference kWasRestarted had when it was read.
259 static bool was_restarted_;
260 // True if we have already read and reset the preference kWasRestarted.
sky 2011/12/13 16:54:42 nit: newline between 259 and 260.
261 static bool was_restarted_read_;
262
253 DISALLOW_COPY_AND_ASSIGN(BrowserInit); 263 DISALLOW_COPY_AND_ASSIGN(BrowserInit);
254 }; 264 };
255 265
256 #endif // CHROME_BROWSER_UI_BROWSER_INIT_H_ 266 #endif // CHROME_BROWSER_UI_BROWSER_INIT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698