| 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 "chrome/browser/ui/views/omnibox/omnibox_view_views.h" | 5 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/app/chrome_command_ids.h" | 10 #include "chrome/app/chrome_command_ids.h" |
| (...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 807 ApplyColor( | 807 ApplyColor( |
| 808 location_bar_view_->GetColor(security_level_, LocationBarView::TEXT), | 808 location_bar_view_->GetColor(security_level_, LocationBarView::TEXT), |
| 809 ui::Range(host.begin, host.end())); | 809 ui::Range(host.begin, host.end())); |
| 810 } | 810 } |
| 811 | 811 |
| 812 // Emphasize the scheme for security UI display purposes (if necessary). | 812 // Emphasize the scheme for security UI display purposes (if necessary). |
| 813 // Note that we check CurrentTextIsURL() because if we're replacing search | 813 // Note that we check CurrentTextIsURL() because if we're replacing search |
| 814 // URLs with search terms, we may have a non-URL even when the user is not | 814 // URLs with search terms, we may have a non-URL even when the user is not |
| 815 // editing; and in some cases, e.g. for "site:foo.com" searches, the parser | 815 // editing; and in some cases, e.g. for "site:foo.com" searches, the parser |
| 816 // may have incorrectly identified a qualifier as a scheme. | 816 // may have incorrectly identified a qualifier as a scheme. |
| 817 SetStyle(gfx::DIAGONAL_STRIKE, false); |
| 817 if (!model()->user_input_in_progress() && model()->CurrentTextIsURL() && | 818 if (!model()->user_input_in_progress() && model()->CurrentTextIsURL() && |
| 818 scheme.is_nonempty() && (security_level_ != ToolbarModel::NONE)) { | 819 scheme.is_nonempty() && (security_level_ != ToolbarModel::NONE)) { |
| 819 SkColor security_color = location_bar_view_->GetColor( | 820 SkColor security_color = location_bar_view_->GetColor( |
| 820 security_level_, LocationBarView::SECURITY_TEXT); | 821 security_level_, LocationBarView::SECURITY_TEXT); |
| 821 const bool strike = (security_level_ == ToolbarModel::SECURITY_ERROR); | 822 const bool strike = (security_level_ == ToolbarModel::SECURITY_ERROR); |
| 822 const ui::Range scheme_range(scheme.begin, scheme.end()); | 823 const ui::Range scheme_range(scheme.begin, scheme.end()); |
| 823 ApplyColor(security_color, scheme_range); | 824 ApplyColor(security_color, scheme_range); |
| 824 ApplyStyle(gfx::DIAGONAL_STRIKE, strike, scheme_range); | 825 ApplyStyle(gfx::DIAGONAL_STRIKE, strike, scheme_range); |
| 825 } | 826 } |
| 826 } | 827 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 845 const string16 text(GetClipboardText()); | 846 const string16 text(GetClipboardText()); |
| 846 if (!text.empty()) { | 847 if (!text.empty()) { |
| 847 // Record this paste, so we can do different behavior. | 848 // Record this paste, so we can do different behavior. |
| 848 model()->on_paste(); | 849 model()->on_paste(); |
| 849 // Force a Paste operation to trigger the text_changed code in | 850 // Force a Paste operation to trigger the text_changed code in |
| 850 // OnAfterPossibleChange(), even if identical contents are pasted. | 851 // OnAfterPossibleChange(), even if identical contents are pasted. |
| 851 text_before_change_.clear(); | 852 text_before_change_.clear(); |
| 852 ReplaceSelection(text); | 853 ReplaceSelection(text); |
| 853 } | 854 } |
| 854 } | 855 } |
| OLD | NEW |