Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(477)

Unified Diff: remoting/host/continue_window_chromeos.cc

Issue 690183002: Remote assistance on Chrome OS Part V - It2MeHost Continue Window (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address Dan's feedbacks Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: remoting/host/continue_window_chromeos.cc
diff --git a/remoting/host/continue_window_chromeos.cc b/remoting/host/continue_window_chromeos.cc
index 0fe427b792c9981ffc533407eb75e21813d71391..792e44766ac843d3d5a4465bd1f5a47f1fb9f890 100644
--- a/remoting/host/continue_window_chromeos.cc
+++ b/remoting/host/continue_window_chromeos.cc
@@ -4,41 +4,60 @@
#include "remoting/host/continue_window.h"
+#include "remoting/base/string_resources.h"
+#include "remoting/host/chromeos/message_box.h"
+#include "ui/base/l10n/l10n_util.h"
+
namespace remoting {
namespace {
-// A place holder implementation for the ContinueWindow on
-// ChromeOS. Remote assistance on Chrome OS is currently under a flag so it is
-// secure to leave it unimplemented for now.
class ContinueWindowAura : public ContinueWindow {
public:
ContinueWindowAura();
~ContinueWindowAura() override;
+ void OnMessageBoxResult(MessageBox::Result result);
+
protected:
// ContinueWindow interface.
void ShowUi() override;
void HideUi() override;
private:
+ scoped_refptr<MessageBox> message_box_;
+ base::WeakPtrFactory<ContinueWindowAura> weak_factory_;
Wez 2014/10/31 21:22:24 When you fix the ownership model of |message_box_|
kelvinp 2014/11/01 00:42:00 Done.
+
DISALLOW_COPY_AND_ASSIGN(ContinueWindowAura);
};
-ContinueWindowAura::ContinueWindowAura() {
+ContinueWindowAura::ContinueWindowAura() : weak_factory_(this) {
+ message_box_ = new MessageBox(
+ l10n_util::GetStringUTF16(IDS_CONTINUE_PROMPT), // dialog label
+ l10n_util::GetStringUTF16(IDS_CONTINUE_BUTTON), // ok label
+ l10n_util::GetStringUTF16(IDS_STOP_SHARING_BUTTON), // cancel label
+ base::Bind(&ContinueWindowAura::OnMessageBoxResult,
+ weak_factory_.GetWeakPtr()));
}
ContinueWindowAura::~ContinueWindowAura() {
+ message_box_->Hide();
+}
+
+void ContinueWindowAura::OnMessageBoxResult(MessageBox::Result result) {
+ if (result == MessageBox::OK) {
+ ContinueSession();
+ } else {
+ DisconnectSession();
+ }
}
void ContinueWindowAura::ShowUi() {
- // TODO(kelvinp): Implement this on Chrome OS (See crbug.com/424908).
- NOTIMPLEMENTED();
+ message_box_->Show();
}
void ContinueWindowAura::HideUi() {
- // TODO(kelvinp): Implement this on Chrome OS (See crbug.com/424908).
- NOTIMPLEMENTED();
+ message_box_->Hide();
}
} // namespace

Powered by Google App Engine
This is Rietveld 408576698