| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "remoting/host/continue_window.h" | 5 #include "remoting/host/continue_window.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 if (continue_window_) { | 63 if (continue_window_) { |
| 64 gtk_widget_destroy(continue_window_); | 64 gtk_widget_destroy(continue_window_); |
| 65 continue_window_ = nullptr; | 65 continue_window_ = nullptr; |
| 66 } | 66 } |
| 67 } | 67 } |
| 68 | 68 |
| 69 void ContinueWindowGtk::CreateWindow() { | 69 void ContinueWindowGtk::CreateWindow() { |
| 70 DCHECK(CalledOnValidThread()); | 70 DCHECK(CalledOnValidThread()); |
| 71 DCHECK(!continue_window_); | 71 DCHECK(!continue_window_); |
| 72 | 72 |
| 73 GtkDialogFlags flags = GTK_DIALOG_MODAL; |
| 74 #if GTK_MAJOR_VERSION == 2 |
| 75 flags = static_cast<GtkDialogFlags>(flags | GTK_DIALOG_NO_SEPARATOR); |
| 76 #endif |
| 73 continue_window_ = gtk_dialog_new_with_buttons( | 77 continue_window_ = gtk_dialog_new_with_buttons( |
| 74 l10n_util::GetStringUTF8(IDS_PRODUCT_NAME).c_str(), | 78 l10n_util::GetStringUTF8(IDS_PRODUCT_NAME).c_str(), |
| 75 nullptr, | 79 nullptr, |
| 76 static_cast<GtkDialogFlags>(GTK_DIALOG_MODAL | GTK_DIALOG_NO_SEPARATOR), | 80 flags, |
| 77 l10n_util::GetStringUTF8(IDS_STOP_SHARING_BUTTON).c_str(), | 81 l10n_util::GetStringUTF8(IDS_STOP_SHARING_BUTTON).c_str(), |
| 78 GTK_RESPONSE_CANCEL, | 82 GTK_RESPONSE_CANCEL, |
| 79 l10n_util::GetStringUTF8(IDS_CONTINUE_BUTTON).c_str(), | 83 l10n_util::GetStringUTF8(IDS_CONTINUE_BUTTON).c_str(), |
| 80 GTK_RESPONSE_OK, | 84 GTK_RESPONSE_OK, |
| 81 nullptr); | 85 nullptr); |
| 82 | 86 |
| 83 gtk_dialog_set_default_response(GTK_DIALOG(continue_window_), | 87 gtk_dialog_set_default_response(GTK_DIALOG(continue_window_), |
| 84 GTK_RESPONSE_OK); | 88 GTK_RESPONSE_OK); |
| 85 gtk_window_set_resizable(GTK_WINDOW(continue_window_), FALSE); | 89 gtk_window_set_resizable(GTK_WINDOW(continue_window_), FALSE); |
| 86 | 90 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 115 | 119 |
| 116 HideUi(); | 120 HideUi(); |
| 117 } | 121 } |
| 118 | 122 |
| 119 // static | 123 // static |
| 120 std::unique_ptr<HostWindow> HostWindow::CreateContinueWindow() { | 124 std::unique_ptr<HostWindow> HostWindow::CreateContinueWindow() { |
| 121 return base::MakeUnique<ContinueWindowGtk>(); | 125 return base::MakeUnique<ContinueWindowGtk>(); |
| 122 } | 126 } |
| 123 | 127 |
| 124 } // namespace remoting | 128 } // namespace remoting |
| OLD | NEW |