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/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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 358 if (md && inverted) | 358 if (md && inverted) |
| 359 return GetColor(TEXT); | 359 return GetColor(TEXT); |
| 360 color = md ? gfx::kGoogleRed700 : SkColorSetRGB(162, 0, 0); | 360 color = md ? gfx::kGoogleRed700 : SkColorSetRGB(162, 0, 0); |
| 361 break; | 361 break; |
| 362 } | 362 } |
| 363 | 363 |
| 364 case security_state::SecurityStateModel::SECURITY_WARNING: | 364 case security_state::SecurityStateModel::SECURITY_WARNING: |
| 365 return GetColor(TEXT); | 365 return GetColor(TEXT); |
| 366 break; | 366 break; |
| 367 | 367 |
| 368 case security_state::SecurityStateModel::NONE: | |
|
Peter Kasting
2016/05/11 18:53:21
Nit: Combine with the SECURITY_WARNING case
palmer
2016/05/12 21:23:14
Done.
| |
| 369 return GetColor(TEXT); | |
| 370 break; | |
| 371 | |
| 368 default: | 372 default: |
| 369 NOTREACHED(); | 373 NOTREACHED(); |
| 370 return gfx::kPlaceholderColor; | 374 return gfx::kPlaceholderColor; |
| 371 } | 375 } |
| 372 return color_utils::GetReadableColor(color, GetColor(BACKGROUND)); | 376 return color_utils::GetReadableColor(color, GetColor(BACKGROUND)); |
| 373 } | 377 } |
| 374 | 378 |
| 375 void LocationBarView::ZoomChangedForActiveTab(bool can_show_bubble) { | 379 void LocationBarView::ZoomChangedForActiveTab(bool can_show_bubble) { |
| 376 DCHECK(zoom_view_); | 380 DCHECK(zoom_view_); |
| 377 if (RefreshZoomView()) { | 381 if (RefreshZoomView()) { |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 862 return; | 866 return; |
| 863 | 867 |
| 864 if (ui::MaterialDesignController::IsModeMaterial()) { | 868 if (ui::MaterialDesignController::IsModeMaterial()) { |
| 865 gfx::VectorIconId icon_id = gfx::VectorIconId::VECTOR_ICON_NONE; | 869 gfx::VectorIconId icon_id = gfx::VectorIconId::VECTOR_ICON_NONE; |
| 866 const int kIconSize = 16; | 870 const int kIconSize = 16; |
| 867 SkColor icon_color = gfx::kPlaceholderColor; | 871 SkColor icon_color = gfx::kPlaceholderColor; |
| 868 if (ShouldShowEVBubble()) { | 872 if (ShouldShowEVBubble()) { |
| 869 icon_id = gfx::VectorIconId::LOCATION_BAR_HTTPS_VALID_IN_CHIP; | 873 icon_id = gfx::VectorIconId::LOCATION_BAR_HTTPS_VALID_IN_CHIP; |
| 870 icon_color = location_icon_view_->GetTextColor(); | 874 icon_color = location_icon_view_->GetTextColor(); |
| 871 } else { | 875 } else { |
| 872 icon_id = omnibox_view_->GetVectorIcon( | 876 icon_id = omnibox_view_->GetVectorIcon(); |
| 873 color_utils::IsDark(GetColor(BACKGROUND))); | 877 icon_color = color_utils::DeriveDefaultIconColor( |
| 874 icon_color = color_utils::DeriveDefaultIconColor(GetColor(TEXT)); | 878 GetSecureTextColor(GetToolbarModel()->GetSecurityLevel(false))); |
| 875 } | 879 } |
| 876 location_icon_view_->SetImage( | 880 location_icon_view_->SetImage( |
| 877 gfx::CreateVectorIcon(icon_id, kIconSize, icon_color)); | 881 gfx::CreateVectorIcon(icon_id, kIconSize, icon_color)); |
| 878 } else { | 882 } else { |
| 879 location_icon_view_->SetImage( | 883 location_icon_view_->SetImage( |
| 880 *GetThemeProvider()->GetImageSkiaNamed(omnibox_view_->GetIcon())); | 884 *GetThemeProvider()->GetImageSkiaNamed(omnibox_view_->GetIcon())); |
| 881 } | 885 } |
| 882 } | 886 } |
| 883 | 887 |
| 884 bool LocationBarView::RefreshContentSettingViews() { | 888 bool LocationBarView::RefreshContentSettingViews() { |
| (...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1384 // LocationBarView, private TemplateURLServiceObserver implementation: | 1388 // LocationBarView, private TemplateURLServiceObserver implementation: |
| 1385 | 1389 |
| 1386 void LocationBarView::OnTemplateURLServiceChanged() { | 1390 void LocationBarView::OnTemplateURLServiceChanged() { |
| 1387 template_url_service_->RemoveObserver(this); | 1391 template_url_service_->RemoveObserver(this); |
| 1388 template_url_service_ = nullptr; | 1392 template_url_service_ = nullptr; |
| 1389 // If the browser is no longer active, let's not show the info bubble, as this | 1393 // 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. | 1394 // would make the browser the active window again. |
| 1391 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive()) | 1395 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive()) |
| 1392 ShowFirstRunBubble(); | 1396 ShowFirstRunBubble(); |
| 1393 } | 1397 } |
| OLD | NEW |