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/autocomplete/autocomplete_edit_view_gtk.h" | 5 #include "chrome/browser/autocomplete/autocomplete_edit_view_gtk.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 #include <gdk/gdkkeysyms.h> | 8 #include <gdk/gdkkeysyms.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 1421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1432 ItersFromCharRange(scheme_range, &start, &end); | 1432 ItersFromCharRange(scheme_range, &start, &end); |
1433 | 1433 |
1434 if (security_level_ == ToolbarModel::SECURITY_ERROR) { | 1434 if (security_level_ == ToolbarModel::SECURITY_ERROR) { |
1435 strikethrough_ = scheme_range; | 1435 strikethrough_ = scheme_range; |
1436 // When we draw the strikethrough, we don't want to include the ':' at the | 1436 // When we draw the strikethrough, we don't want to include the ':' at the |
1437 // end of the scheme. | 1437 // end of the scheme. |
1438 strikethrough_.cp_max--; | 1438 strikethrough_.cp_max--; |
1439 | 1439 |
1440 gtk_text_buffer_apply_tag(text_buffer_, security_error_scheme_tag_, | 1440 gtk_text_buffer_apply_tag(text_buffer_, security_error_scheme_tag_, |
1441 &start, &end); | 1441 &start, &end); |
| 1442 } else if (security_level_ == ToolbarModel::SECURITY_WARNING) { |
| 1443 gtk_text_buffer_apply_tag(text_buffer_, faded_text_tag_, &start, &end); |
1442 } else { | 1444 } else { |
1443 gtk_text_buffer_apply_tag(text_buffer_, secure_scheme_tag_, &start, &end); | 1445 gtk_text_buffer_apply_tag(text_buffer_, secure_scheme_tag_, &start, &end); |
1444 } | 1446 } |
1445 } | 1447 } |
1446 } | 1448 } |
1447 | 1449 |
1448 void AutocompleteEditViewGtk::TextChanged() { | 1450 void AutocompleteEditViewGtk::TextChanged() { |
1449 EmphasizeURLComponents(); | 1451 EmphasizeURLComponents(); |
1450 controller_->OnChanged(); | 1452 controller_->OnChanged(); |
1451 } | 1453 } |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1564 CharRange selection = GetSelection(); | 1566 CharRange selection = GetSelection(); |
1565 GURL url; | 1567 GURL url; |
1566 bool write_url; | 1568 bool write_url; |
1567 model_->AdjustTextForCopy(selection.selection_min(), IsSelectAll(), &text, | 1569 model_->AdjustTextForCopy(selection.selection_min(), IsSelectAll(), &text, |
1568 &url, &write_url); | 1570 &url, &write_url); |
1569 if (write_url) { | 1571 if (write_url) { |
1570 selected_text_ = WideToUTF8(text); | 1572 selected_text_ = WideToUTF8(text); |
1571 OwnPrimarySelection(selected_text_); | 1573 OwnPrimarySelection(selected_text_); |
1572 } | 1574 } |
1573 } | 1575 } |
OLD | NEW |