#include "base/files/file_util.h"
#include "base/path_service.h"
#include "base/run_loop.h"
-#include "base/strings/string16.h"
#include "base/strings/utf_string_conversions.h"
-#include "base/values.h"
#include "base/threading/thread_task_runner_handle.h"
#include "brightray/browser/brightray_paths.h"
#include "content/public/browser/render_frame_host.h"
std::unique_ptr<common::ResourceManager::Resource> res =
resource_manager_->GetStartResource(appcontrol.get());
bool do_reset = res->should_reset();
- NativeWindow *last_window= WindowList::GetLastWindow();
+ NativeWindow *last_window = WindowList::GetLastWindow();
std::string localized_page = res->uri();
- if(!do_reset)
- {
- std::string current_page=last_window->web_contents()->GetURL().spec();
- if (current_page != localized_page) {
- do_reset = true;
- } else {
- SendAppControlEvent();
- }
- }
+ if (!do_reset) {
+ std::string current_page = last_window->web_contents()->GetURL().spec();
+ if (current_page != localized_page)
+ do_reset = true;
+ else
+ SendAppControlEvent();
+ }
if (do_reset && (appcontrol->operation() == kAppControlMain)) {
do_reset = false;
SendAppControlEvent();
}
- if (do_reset) {
- //To do :Implementation of ClearViewStack(), SetupWebWindow(),SetupWebWindowCompatibilitySettings() function
- }
+ if (do_reset)
+ //To do :Implementation of ClearViewStack(), SetupWebWindow(),SetupWebWindowCompatibilitySettings() function
}
void Browser::SendAppControlEvent() {
- std::vector<NativeWindow*> WindowVector;
- WindowVector=WindowList::GetWindows();
- NativeWindow *last_window= WindowList::GetLastWindow();
- if (WindowVector.size() > 0 && last_window != NULL) {
- content::RenderFrameHost* rfh = last_window->web_contents()->GetMainFrame();
- if (rfh) {
+ NativeWindow *last_window = WindowList::GetLastWindow();
+
+ if (last_window != NULL) {
+ content::RenderFrameHost* rfh = last_window->web_contents()->GetMainFrame();
+ if (rfh) {
rfh->ExecuteJavaScriptWithUserGestureForTests(
- base::UTF8ToUTF16(kAppControlEventScript));
+ base::UTF8ToUTF16(kAppControlEventScript));
}
- }
+ }
}
void Browser::Launch(std::unique_ptr<common::AppControl> appcontrol) {