1)Take decision whether to launch or send app control data.
2)Parsing of config file to check whether to reload or not.
Change-Id: I51f0d48aba58ca62d185b994beca12abb9344578
Signed-off-by: deepti <d.saraswat@samsung.com>
common::AppDB* appdb = common::AppDB::GetInstance();
appdb->Set(kAppDBRuntimeSection, kAppDBRuntimeBundle,
appcontrol->encoded_bundle());
+ atom::Browser *browser_model = atom::Browser::Get();
+ if (browser_model->launched()) {
+ browser_model->AppControl(std::move(appcontrol));
+ } else {
+ browser_model->Initialize();
+ browser_model->Launch(std::move(appcontrol));
+ }
}
void UiRuntime::OnLanguageChanged(const std::string& language) {
#include "base/run_loop.h"
#include "base/threading/thread_task_runner_handle.h"
#include "brightray/browser/brightray_paths.h"
-
+#include "tizen/common/command_line.h"
namespace atom {
Browser::Browser()
: is_quiting_(false),
is_exiting_(false),
is_ready_(false),
- is_shutdown_(false) {
+ is_shutdown_(false),
+ launched_(false),
+ locale_manager_(new common::LocaleManager()) {
WindowList::AddObserver(this);
}
observer.OnResume();
}
+void Browser::Initialize() {
+ common::CommandLine* runtime_cmd = common::CommandLine::ForCurrentProcess();
+ std::string appid = runtime_cmd->GetAppIdFromCommandLine("/usr/bin/electron");
+ //TODO: update the appid from binary name to electron
+ if (appid != "electron") {
+ auto appdata_manager = common::ApplicationDataManager::GetInstance();
+ common::ApplicationData* appdata = appdata_manager->GetApplicationData(appid);
+
+ resource_manager_.reset(
+ new common::ResourceManager(appdata, locale_manager_.get()));
+ }
+}
+
+void Browser::AppControl(std::unique_ptr<common::AppControl> appcontrol) {
+ std::unique_ptr<common::ResourceManager::Resource> res =
+ resource_manager_->GetStartResource(appcontrol.get());
+ bool do_reset = res->should_reset();
+//To do: Implementation of reset case according to parsed config file parameter.
+}
+
+void Browser::Launch(std::unique_ptr<common::AppControl> appcontrol) {
+ launched_ = true;
+//To do:Implementation of relaunching of app
+}
+
} // namespace atom
#include "base/strings/string16.h"
#include "base/values.h"
#include "native_mate/arguments.h"
+#include "tizen/common/app_control.h"
+#include "tizen/common/application_data.h"
+#include "tizen/common/resource_manager.h"
+#include "tizen/common/locale_manager.h"
#if defined(OS_WIN)
#include "base/files/file_path.h"
static Browser* Get();
+ std::unique_ptr<common::ResourceManager> resource_manager_;
+ std::unique_ptr<common::LocaleManager> locale_manager_;
+
+ void Initialize();
// Try to close all windows and quit the application.
void Quit();
// Set/Get the badge count.
bool SetBadgeCount(int count);
+ bool launched() const { return launched_; }
int GetBadgeCount();
// Set/Get the login item settings of the app
void Hide();
void Show();
+ void AppControl(std::unique_ptr<common::AppControl> appcontrol);
+ void Launch(std::unique_ptr<common::AppControl> appcontrol);
+
#if defined(OS_MACOSX)
// Hide the application.
void Hide();
bool is_quiting_;
+ bool launched_;
+
private:
// WindowListObserver implementations:
void OnWindowCloseCancelled(NativeWindow* window) override;