This commit adds a Griffin feature that restarts the browser when there is a pending update on macOS, no windows are open, clear data on exit isn't set and the system has been idle for 3 minutes. The motivation is to roll out updates on macOS more quickly. The feature is default-disabled and meant to be enabled on the server on Nightly only for now.
34 lines
1.1 KiB
C++
34 lines
1.1 KiB
C++
/* Copyright (c) 2019 The Brave Authors. All rights reserved.
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
#ifndef BRAVE_BROWSER_BRAVE_BROWSER_MAIN_PARTS_MAC_H_
|
|
#define BRAVE_BROWSER_BRAVE_BROWSER_MAIN_PARTS_MAC_H_
|
|
|
|
#include <memory>
|
|
|
|
#include "base/feature_list.h"
|
|
#include "brave/browser/upgrade_when_idle/upgrade_when_idle.h"
|
|
#include "chrome/browser/chrome_browser_main_mac.h"
|
|
|
|
namespace brave {
|
|
BASE_DECLARE_FEATURE(kUpgradeWhenIdle);
|
|
}
|
|
|
|
class BraveBrowserMainPartsMac : public ChromeBrowserMainPartsMac {
|
|
public:
|
|
BraveBrowserMainPartsMac(bool is_integration_test, StartupData* startup_data);
|
|
~BraveBrowserMainPartsMac() override;
|
|
|
|
private:
|
|
// ChromeBrowserMainPartsMac overrides:
|
|
void PreCreateMainMessageLoop() override;
|
|
void PostProfileInit(Profile* profile, bool is_initial_profile) override;
|
|
void PostMainMessageLoopRun() override;
|
|
|
|
std::unique_ptr<brave::UpgradeWhenIdle> upgrade_when_idle_;
|
|
};
|
|
|
|
#endif // BRAVE_BROWSER_BRAVE_BROWSER_MAIN_PARTS_MAC_H_
|