is_enter_key_released(false),
is_popup_exists_(false),
is_restore_popup_exists_(false),
- is_bookamrk_popup_open_(false) {
+ is_bookamrk_popup_open_(false),
+ is_exit_popup_open_(false) {
LOG(INFO) << "";
}
HybridNavigationController::~HybridNavigationController() {
}
break;
}
+ case samsung_browser_main::NativePopupType::EXIT: {
+ if (!keynameBack.compare(key)) {
+ browser_view_->toolbar()->CloseExitBrowserBubble();
+ LOG(INFO) << "exit popup close executed";
+ return true;
+ }
+ break;
+ }
}
}
} else {
LOG(INFO) << "Tab Index not found";
}
+
} else {
// show browser exit popup
browser_view_->toolbar()->ShowExitBrowserBubble();
return samsung_browser_main::NativePopupType::BOOKMARK;
} else if (popup && popup->isMVOpen()) {
return samsung_browser_main::NativePopupType::MOST_VISITED;
+ } else if (is_exit_popup_open_) {
+ return samsung_browser_main::NativePopupType::EXIT;
}
return samsung_browser_main::NativePopupType::NONE;
}
void SetPopupExists(bool val) { is_popup_exists_ = val; }
void SetRestorePopupExists(bool val) { is_restore_popup_exists_ = val; }
void SetBookmarkPopupOpen(bool val) { is_bookamrk_popup_open_ = val; }
+ void SetExitPopupExists(bool val) { is_exit_popup_open_ = val; }
bool IsPopupExists() {
return (is_popup_exists_ || is_restore_popup_exists_);
}
bool is_popup_exists_;
bool is_restore_popup_exists_;
bool is_bookamrk_popup_open_;
+ bool is_exit_popup_open_;
// std::map<Tab*, HybridNavigationDriver*> tabIdToWebHandler;
};
} // namespace samsung_browser_controller
#include "exit_browser_bubble_view.h"
+// static
+views::Widget* SamsungExitBrowserBubbleDialogView::current_instance_ = nullptr;
+
// static
void SamsungExitBrowserBubbleDialogView::Show(
views::View* anchor_view,
views::BubbleBorder::Arrow anchor_position) {
- views::Widget* widget = BubbleDialogDelegateView::CreateBubble(
- new SamsungExitBrowserBubbleDialogView(anchor_view, anchor_position));
- widget->Show();
+ SamsungExitBrowserBubbleDialogView::current_instance_ =
+ BubbleDialogDelegateView::CreateBubble(
+ new SamsungExitBrowserBubbleDialogView(anchor_view, anchor_position));
+ current_instance_->Show();
}
-SamsungExitBrowserBubbleDialogView::~SamsungExitBrowserBubbleDialogView() =
- default;
+// static
+void SamsungExitBrowserBubbleDialogView::Close() {
+ LOG(INFO) << "";
+ if (current_instance_) {
+ current_instance_->Close();
+ }
+
+ current_instance_ = nullptr;
+}
+
+SamsungExitBrowserBubbleDialogView::~SamsungExitBrowserBubbleDialogView() {
+ LOG(INFO) << "";
+ auto hnc = samsung_browser_main::SamsungBrowserCore::instance()
+ ->HybridNavigationController();
+ if (hnc) {
+ LOG(INFO) << "Setting exit popup state false";
+ hnc->SetExitPopupExists(false);
+ }
+}
SamsungExitBrowserBubbleDialogView::SamsungExitBrowserBubbleDialogView(
views::View* anchor_view,
SetShowCloseButton(false);
- hybrid_navigation_controller->SetPopupExists(true);
+ hybrid_navigation_controller->SetExitPopupExists(true);
std::u16string exit = multi_language_controller->GetUTF16String("SID_EXIT");
std::u16string cancel =
LOG(INFO) << "hybrid_navigation_controller is null";
return;
}
- hybrid_navigation_controller->SetPopupExists(false);
LOG(INFO) << "browser terminating";
chrome::AttemptUserExit();
}
LOG(INFO) << "hybrid_navigation_controller is null";
return;
}
- hybrid_navigation_controller->SetPopupExists(false);
}
\ No newline at end of file
public:
static void Show(views::View* anchor_view,
views::BubbleBorder::Arrow anchor_position);
+ static void Close();
~SamsungExitBrowserBubbleDialogView() override;
views::BubbleBorder::Arrow anchor_position);
void ExitButtonPressed();
void CancelExitBrowserPopup();
+
+ static views::Widget* current_instance_;
};
#endif // CHROME_BROWSER_UI_VIEWS_SAMSUNG_EXIT_BROWSER_BUBBLE_VIEW_H_
\ No newline at end of file
views::BubbleBorder::Arrow::FLOAT);
}
+void ToolbarView::CloseExitBrowserBubble() {
+ SamsungExitBrowserBubbleDialogView::Close();
+}
+
#endif //SAMSUNG_TOOLBAR_UI
ExtensionsToolbarButton* ToolbarView::GetExtensionsButton() const {
bool already_bookmarked,
samsung_browser_fw_core::WatchlaterIconState watch_later_icon_state);
void ShowExitBrowserBubble();
+ void CloseExitBrowserBubble();
#endif //SAMSUNG_TOOLBAR_UI
// Accessors.
Browser* browser() const { return browser_; }
MENU_TREE = 3,
CONTEXT_MENU = 4,
MOST_VISITED = 5,
- BOOKMARK = 6
+ BOOKMARK = 6,
+ EXIT = 7,
};
enum SynchronizationItem {
Bookmarks = 0,