Chromium Code Reviews| 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 <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 567 SkColor color = location_bar_view_->GetColor( | 567 SkColor color = location_bar_view_->GetColor( |
| 568 emphasize ? LocationBarView::TEXT : LocationBarView::DEEMPHASIZED_TEXT); | 568 emphasize ? LocationBarView::TEXT : LocationBarView::DEEMPHASIZED_TEXT); |
| 569 if (range.IsValid()) | 569 if (range.IsValid()) |
| 570 ApplyColor(color, range); | 570 ApplyColor(color, range); |
| 571 else | 571 else |
| 572 SetColor(color); | 572 SetColor(color); |
| 573 } | 573 } |
| 574 | 574 |
| 575 void OmniboxViewViews::UpdateSchemeStyle(const gfx::Range& range) { | 575 void OmniboxViewViews::UpdateSchemeStyle(const gfx::Range& range) { |
| 576 DCHECK(range.IsValid()); | 576 DCHECK(range.IsValid()); |
| 577 // Scheme color is only overridden for non-default security levels. | |
|
Peter Kasting
2017/03/08 03:05:44
Mac also does this check. Maybe we should pass th
elawrence
2017/03/08 17:23:03
I've updated the comment.
Passing the security l
| |
| 578 if (security_level_ == security_state::NONE) | |
| 579 return; | |
| 577 const SkColor security_color = | 580 const SkColor security_color = |
| 578 location_bar_view_->GetSecureTextColor(security_level_); | 581 location_bar_view_->GetSecureTextColor(security_level_); |
| 579 const bool strike = security_level_ == security_state::DANGEROUS; | 582 const bool strike = security_level_ == security_state::DANGEROUS; |
| 580 ApplyColor(security_color, range); | 583 ApplyColor(security_color, range); |
| 581 ApplyStyle(gfx::DIAGONAL_STRIKE, strike, range); | 584 ApplyStyle(gfx::DIAGONAL_STRIKE, strike, range); |
| 582 } | 585 } |
| 583 | 586 |
| 584 void OmniboxViewViews::EmphasizeURLComponents() { | 587 void OmniboxViewViews::EmphasizeURLComponents() { |
| 585 if (!location_bar_view_) | 588 if (!location_bar_view_) |
| 586 return; | 589 return; |
| (...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1049 paste_position + 1, IDS_PASTE_AND_GO, IDS_PASTE_AND_GO); | 1052 paste_position + 1, IDS_PASTE_AND_GO, IDS_PASTE_AND_GO); |
| 1050 | 1053 |
| 1051 menu_contents->AddSeparator(ui::NORMAL_SEPARATOR); | 1054 menu_contents->AddSeparator(ui::NORMAL_SEPARATOR); |
| 1052 | 1055 |
| 1053 // Minor note: We use IDC_ for command id here while the underlying textfield | 1056 // Minor note: We use IDC_ for command id here while the underlying textfield |
| 1054 // is using IDS_ for all its command ids. This is because views cannot depend | 1057 // is using IDS_ for all its command ids. This is because views cannot depend |
| 1055 // on IDC_ for now. | 1058 // on IDC_ for now. |
| 1056 menu_contents->AddItemWithStringId(IDC_EDIT_SEARCH_ENGINES, | 1059 menu_contents->AddItemWithStringId(IDC_EDIT_SEARCH_ENGINES, |
| 1057 IDS_EDIT_SEARCH_ENGINES); | 1060 IDS_EDIT_SEARCH_ENGINES); |
| 1058 } | 1061 } |
| OLD | NEW |