Handling App Control Data 43/173243/1
authordeepti <d.saraswat@samsung.com>
Tue, 20 Mar 2018 06:38:50 +0000 (12:08 +0530)
committerdeepti <d.saraswat@samsung.com>
Tue, 20 Mar 2018 06:41:04 +0000 (12:11 +0530)
Change-Id: I42374c5f69b6ed749889dfc14f04240924309639
Signed-off-by: deepti <d.saraswat@samsung.com>
atom/app/ui_runtime.cc
atom/browser/browser.cc
atom/browser/browser.h

index c85a63f..44cacf7 100644 (file)
@@ -67,6 +67,12 @@ void UiRuntime::OnAppControl(app_control_h app_control) {
   common::AppDB* appdb = common::AppDB::GetInstance();
   appdb->Set(kAppDBRuntimeSection, kAppDBRuntimeBundle,
              appcontrol->encoded_bundle());
+  atom::Browser *browser_model = atom::Browser::Get();
+  if (browser_model->is_ready()) {
+   browser_model->AppControl(std::move(appcontrol));
+ } else {
+   browser_model->Launch(std::move(appcontrol));
+ }
 }
 
 void UiRuntime::OnLanguageChanged(const std::string& language) {
index 42cc787..6de6ca1 100644 (file)
@@ -15,7 +15,7 @@
 #include "base/run_loop.h"
 #include "base/threading/thread_task_runner_handle.h"
 #include "brightray/browser/brightray_paths.h"
-
+#include "tizen/common/resource_manager.h"
 namespace atom {
 
 Browser::Browser()
@@ -222,5 +222,19 @@ void Browser::Show() {
   for (BrowserObserver& observer : observers_)
     observer.OnResume();
 }
+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
+}
+void Browser::Launch(std::unique_ptr<common::AppControl> appcontrol) {
+//To do
+}
+
+
+
 
 }  // namespace atom
index fc674dd..08de521 100644 (file)
@@ -16,7 +16,9 @@
 #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"
 #if defined(OS_WIN)
 #include "base/files/file_path.h"
 #endif
@@ -41,7 +43,7 @@ class Browser : public WindowListObserver {
   ~Browser();
 
   static Browser* Get();
-
+  std::unique_ptr<common::ResourceManager> resource_manager_;
   // Try to close all windows and quit the application.
   void Quit();
 
@@ -106,6 +108,8 @@ class Browser : public WindowListObserver {
 
   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();