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..c4c93e37776c2d2680ac704a3fbdfe6a0993d96f 100644 |
--- a/remoting/host/continue_window_chromeos.cc |
+++ b/remoting/host/continue_window_chromeos.cc |
@@ -4,41 +4,59 @@ |
#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_; |
+ |
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() { |
dcaiafa
2014/10/31 18:05:49
Why not call message_box_->Hide() here?
kelvinp
2014/10/31 21:12:53
HideUi() is called by ContinueSession which is cal
|
- // TODO(kelvinp): Implement this on Chrome OS (See crbug.com/424908). |
- NOTIMPLEMENTED(); |
} |
} // namespace |