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/location_bar/location_bar_view.h" | 5 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
(...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
862 return; | 862 return; |
863 | 863 |
864 if (ui::MaterialDesignController::IsModeMaterial()) { | 864 if (ui::MaterialDesignController::IsModeMaterial()) { |
865 gfx::VectorIconId icon_id = gfx::VectorIconId::VECTOR_ICON_NONE; | 865 gfx::VectorIconId icon_id = gfx::VectorIconId::VECTOR_ICON_NONE; |
866 const int kIconSize = 16; | 866 const int kIconSize = 16; |
867 SkColor icon_color = gfx::kPlaceholderColor; | 867 SkColor icon_color = gfx::kPlaceholderColor; |
868 if (ShouldShowEVBubble()) { | 868 if (ShouldShowEVBubble()) { |
869 icon_id = gfx::VectorIconId::LOCATION_BAR_HTTPS_VALID_IN_CHIP; | 869 icon_id = gfx::VectorIconId::LOCATION_BAR_HTTPS_VALID_IN_CHIP; |
870 icon_color = location_icon_view_->GetTextColor(); | 870 icon_color = location_icon_view_->GetTextColor(); |
871 } else { | 871 } else { |
872 icon_id = omnibox_view_->GetVectorIcon( | 872 icon_id = omnibox_view_->GetVectorIcon(); |
873 color_utils::IsDark(GetColor(BACKGROUND))); | 873 security_state::SecurityStateModel::SecurityLevel security_level = |
874 icon_color = color_utils::DeriveDefaultIconColor(GetColor(TEXT)); | 874 GetToolbarModel()->GetSecurityLevel(false); |
875 icon_color = security_level == security_state::SecurityStateModel::NONE | |
Peter Kasting
2016/05/17 03:12:34
Nit: I would put the comparison in parens (reads m
palmer
2016/05/19 17:49:23
Done.
| |
876 ? color_utils::DeriveDefaultIconColor(GetColor(TEXT)) | |
877 : GetSecureTextColor(security_level); | |
875 } | 878 } |
876 location_icon_view_->SetImage( | 879 location_icon_view_->SetImage( |
877 gfx::CreateVectorIcon(icon_id, kIconSize, icon_color)); | 880 gfx::CreateVectorIcon(icon_id, kIconSize, icon_color)); |
878 } else { | 881 } else { |
879 location_icon_view_->SetImage( | 882 location_icon_view_->SetImage( |
880 *GetThemeProvider()->GetImageSkiaNamed(omnibox_view_->GetIcon())); | 883 *GetThemeProvider()->GetImageSkiaNamed(omnibox_view_->GetIcon())); |
881 } | 884 } |
882 } | 885 } |
883 | 886 |
884 bool LocationBarView::RefreshContentSettingViews() { | 887 bool LocationBarView::RefreshContentSettingViews() { |
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1384 // LocationBarView, private TemplateURLServiceObserver implementation: | 1387 // LocationBarView, private TemplateURLServiceObserver implementation: |
1385 | 1388 |
1386 void LocationBarView::OnTemplateURLServiceChanged() { | 1389 void LocationBarView::OnTemplateURLServiceChanged() { |
1387 template_url_service_->RemoveObserver(this); | 1390 template_url_service_->RemoveObserver(this); |
1388 template_url_service_ = nullptr; | 1391 template_url_service_ = nullptr; |
1389 // If the browser is no longer active, let's not show the info bubble, as this | 1392 // If the browser is no longer active, let's not show the info bubble, as this |
1390 // would make the browser the active window again. | 1393 // would make the browser the active window again. |
1391 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive()) | 1394 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive()) |
1392 ShowFirstRunBubble(); | 1395 ShowFirstRunBubble(); |
1393 } | 1396 } |
OLD | NEW |