| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/gtk/options/simple_content_exceptions_window.h" | 5 #include "chrome/browser/gtk/options/simple_content_exceptions_window.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/gtk/gtk_util.h" | 10 #include "chrome/browser/gtk/gtk_util.h" |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 true); | 150 true); |
| 151 | 151 |
| 152 g_signal_connect(dialog_, "response", G_CALLBACK(gtk_widget_destroy), NULL); | 152 g_signal_connect(dialog_, "response", G_CALLBACK(gtk_widget_destroy), NULL); |
| 153 g_signal_connect(dialog_, "destroy", G_CALLBACK(OnWindowDestroyThunk), this); | 153 g_signal_connect(dialog_, "destroy", G_CALLBACK(OnWindowDestroyThunk), this); |
| 154 } | 154 } |
| 155 | 155 |
| 156 SimpleContentExceptionsWindow::~SimpleContentExceptionsWindow() {} | 156 SimpleContentExceptionsWindow::~SimpleContentExceptionsWindow() {} |
| 157 | 157 |
| 158 void SimpleContentExceptionsWindow::SetColumnValues(int row, | 158 void SimpleContentExceptionsWindow::SetColumnValues(int row, |
| 159 GtkTreeIter* iter) { | 159 GtkTreeIter* iter) { |
| 160 std::wstring hostname = model_->GetText(row, IDS_EXCEPTIONS_HOSTNAME_HEADER); | 160 string16 hostname = model_->GetText(row, IDS_EXCEPTIONS_HOSTNAME_HEADER); |
| 161 gtk_list_store_set(list_store_, iter, gtk_tree::TableAdapter::COL_TITLE, | 161 gtk_list_store_set(list_store_, iter, gtk_tree::TableAdapter::COL_TITLE, |
| 162 WideToUTF8(hostname).c_str(), -1); | 162 UTF16ToUTF8(hostname).c_str(), -1); |
| 163 | 163 |
| 164 std::wstring action = model_->GetText(row, IDS_EXCEPTIONS_ACTION_HEADER); | 164 string16 action = model_->GetText(row, IDS_EXCEPTIONS_ACTION_HEADER); |
| 165 gtk_list_store_set(list_store_, iter, COL_ACTION, | 165 gtk_list_store_set(list_store_, iter, COL_ACTION, |
| 166 WideToUTF8(action).c_str(), -1); | 166 UTF16ToUTF8(action).c_str(), -1); |
| 167 } | 167 } |
| 168 | 168 |
| 169 void SimpleContentExceptionsWindow::OnAnyModelUpdateStart() { | 169 void SimpleContentExceptionsWindow::OnAnyModelUpdateStart() { |
| 170 ignore_selection_changes_ = true; | 170 ignore_selection_changes_ = true; |
| 171 } | 171 } |
| 172 | 172 |
| 173 void SimpleContentExceptionsWindow::OnAnyModelUpdate() { | 173 void SimpleContentExceptionsWindow::OnAnyModelUpdate() { |
| 174 ignore_selection_changes_ = false; | 174 ignore_selection_changes_ = false; |
| 175 } | 175 } |
| 176 | 176 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 203 void SimpleContentExceptionsWindow::OnWindowDestroy(GtkWidget* widget) { | 203 void SimpleContentExceptionsWindow::OnWindowDestroy(GtkWidget* widget) { |
| 204 instance = NULL; | 204 instance = NULL; |
| 205 MessageLoop::current()->DeleteSoon(FROM_HERE, this); | 205 MessageLoop::current()->DeleteSoon(FROM_HERE, this); |
| 206 } | 206 } |
| 207 | 207 |
| 208 void SimpleContentExceptionsWindow::OnTreeSelectionChanged( | 208 void SimpleContentExceptionsWindow::OnTreeSelectionChanged( |
| 209 GtkWidget* selection) { | 209 GtkWidget* selection) { |
| 210 if (!ignore_selection_changes_) | 210 if (!ignore_selection_changes_) |
| 211 UpdateButtonState(); | 211 UpdateButtonState(); |
| 212 } | 212 } |
| OLD | NEW |