OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this |
2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
3 // LICENSE file. | 3 // LICENSE file. |
4 | 4 |
5 #include "chrome/browser/gtk/blocked_popup_container_view_gtk.h" | 5 #include "chrome/browser/gtk/blocked_popup_container_view_gtk.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "base/gfx/gtk_util.h" | 8 #include "base/gfx/gtk_util.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "chrome/browser/gtk/custom_button.h" | 10 #include "chrome/browser/gtk/custom_button.h" |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 size_t id_size_t = static_cast<size_t>(id); | 146 size_t id_size_t = static_cast<size_t>(id); |
147 | 147 |
148 // Is this a click on a popup? | 148 // Is this a click on a popup? |
149 if (id_size_t < BlockedPopupContainer::kImpossibleNumberOfPopups) { | 149 if (id_size_t < BlockedPopupContainer::kImpossibleNumberOfPopups) { |
150 model_->LaunchPopupAtIndex(id_size_t - 1); | 150 model_->LaunchPopupAtIndex(id_size_t - 1); |
151 return; | 151 return; |
152 } | 152 } |
153 | 153 |
154 // |id| shouldn't be == kImpossibleNumberOfPopups since the popups end before | 154 // |id| shouldn't be == kImpossibleNumberOfPopups since the popups end before |
155 // this and the hosts start after it. (If it is used, it is as a separator.) | 155 // this and the hosts start after it. (If it is used, it is as a separator.) |
156 //DCHECK_NE(id_size_t, BlockedPopupContainer::kImpossibleNumberOfPopups); | 156 DCHECK_NE(id_size_t, BlockedPopupContainer::kImpossibleNumberOfPopups); |
157 id_size_t -= BlockedPopupContainer::kImpossibleNumberOfPopups + 1; | 157 id_size_t -= BlockedPopupContainer::kImpossibleNumberOfPopups + 1; |
158 | 158 |
159 // Is this a click on a host? | 159 // Is this a click on a host? |
160 size_t host_count = model_->GetPopupHostCount(); | 160 size_t host_count = model_->GetPopupHostCount(); |
161 if (id_size_t < host_count) { | 161 if (id_size_t < host_count) { |
162 model_->ToggleWhitelistingForHost(id_size_t); | 162 model_->ToggleWhitelistingForHost(id_size_t); |
163 return; | 163 return; |
164 } | 164 } |
165 | 165 |
166 // |id shouldn't be == host_count since this is the separator between hosts | 166 // |id shouldn't be == host_count since this is the separator between hosts |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 kBackgroundColorBottom[2]); | 290 kBackgroundColorBottom[2]); |
291 cairo_set_source(cr, pattern); | 291 cairo_set_source(cr, pattern); |
292 cairo_paint(cr); | 292 cairo_paint(cr); |
293 cairo_pattern_destroy(pattern); | 293 cairo_pattern_destroy(pattern); |
294 | 294 |
295 cairo_destroy(cr); | 295 cairo_destroy(cr); |
296 } | 296 } |
297 | 297 |
298 return FALSE; | 298 return FALSE; |
299 } | 299 } |
OLD | NEW |