Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Side by Side Diff: chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc

Issue 273016: Don't draw the red line when the security level is SECURE.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 1181 matching lines...) Expand 10 before | Expand all | Expand 10 after
1192 1192
1193 gtk_text_buffer_apply_tag(text_buffer_, normal_text_tag_, &start, &end); 1193 gtk_text_buffer_apply_tag(text_buffer_, normal_text_tag_, &start, &end);
1194 } else { 1194 } else {
1195 gtk_text_buffer_apply_tag(text_buffer_, normal_text_tag_, &start, &end); 1195 gtk_text_buffer_apply_tag(text_buffer_, normal_text_tag_, &start, &end);
1196 } 1196 }
1197 1197
1198 strikethrough_ = CharRange(); 1198 strikethrough_ = CharRange();
1199 // Emphasize the scheme for security UI display purposes (if necessary). 1199 // Emphasize the scheme for security UI display purposes (if necessary).
1200 if (!model_->user_input_in_progress() && parts.scheme.is_nonempty() && 1200 if (!model_->user_input_in_progress() && parts.scheme.is_nonempty() &&
1201 (scheme_security_level_ != ToolbarModel::NORMAL)) { 1201 (scheme_security_level_ != ToolbarModel::NORMAL)) {
1202 strikethrough_ = CharRange(GetUTF8Offset(text, parts.scheme.begin),
1203 GetUTF8Offset(text, parts.scheme.end()));
1204 ItersFromCharRange(strikethrough_, &start, &end);
1205 // When we draw the strikethrough, we don't want to include the ':' at the
1206 // end of the scheme.
1207 strikethrough_.cp_max--;
1208
1209 if (scheme_security_level_ == ToolbarModel::SECURE) { 1202 if (scheme_security_level_ == ToolbarModel::SECURE) {
1210 gtk_text_buffer_apply_tag(text_buffer_, secure_scheme_tag_, 1203 gtk_text_buffer_apply_tag(text_buffer_, secure_scheme_tag_,
1211 &start, &end); 1204 &start, &end);
1212 } else { 1205 } else {
1206 strikethrough_ = CharRange(GetUTF8Offset(text, parts.scheme.begin),
1207 GetUTF8Offset(text, parts.scheme.end()));
1208 ItersFromCharRange(strikethrough_, &start, &end);
1209 // When we draw the strikethrough, we don't want to include the ':' at the
1210 // end of the scheme.
1211 strikethrough_.cp_max--;
1212
1213 gtk_text_buffer_apply_tag(text_buffer_, insecure_scheme_tag_, 1213 gtk_text_buffer_apply_tag(text_buffer_, insecure_scheme_tag_,
1214 &start, &end); 1214 &start, &end);
1215 } 1215 }
1216 } 1216 }
1217 } 1217 }
1218 1218
1219 void AutocompleteEditViewGtk::TextChanged() { 1219 void AutocompleteEditViewGtk::TextChanged() {
1220 EmphasizeURLComponents(); 1220 EmphasizeURLComponents();
1221 controller_->OnChanged(); 1221 controller_->OnChanged();
1222 } 1222 }
(...skipping 15 matching lines...) Expand all
1238 std::string utf8 = WideToUTF8(text); 1238 std::string utf8 = WideToUTF8(text);
1239 gtk_text_buffer_set_text(text_buffer_, utf8.data(), utf8.length()); 1239 gtk_text_buffer_set_text(text_buffer_, utf8.data(), utf8.length());
1240 SetSelectedRange(range); 1240 SetSelectedRange(range);
1241 } 1241 }
1242 1242
1243 void AutocompleteEditViewGtk::SetSelectedRange(const CharRange& range) { 1243 void AutocompleteEditViewGtk::SetSelectedRange(const CharRange& range) {
1244 GtkTextIter insert, bound; 1244 GtkTextIter insert, bound;
1245 ItersFromCharRange(range, &bound, &insert); 1245 ItersFromCharRange(range, &bound, &insert);
1246 gtk_text_buffer_select_range(text_buffer_, &insert, &bound); 1246 gtk_text_buffer_select_range(text_buffer_, &insert, &bound);
1247 } 1247 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698