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/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 | 351 |
352 case SECURITY_TEXT: { | 352 case SECURITY_TEXT: { |
353 SkColor color; | 353 SkColor color; |
354 switch (security_level) { | 354 switch (security_level) { |
355 case ToolbarModel::EV_SECURE: | 355 case ToolbarModel::EV_SECURE: |
356 case ToolbarModel::SECURE: | 356 case ToolbarModel::SECURE: |
357 color = SkColorSetRGB(7, 149, 0); | 357 color = SkColorSetRGB(7, 149, 0); |
358 break; | 358 break; |
359 | 359 |
360 case ToolbarModel::SECURITY_WARNING: | 360 case ToolbarModel::SECURITY_WARNING: |
| 361 case ToolbarModel::SECURITY_POLICY_WARNING: |
361 return GetColor(security_level, DEEMPHASIZED_TEXT); | 362 return GetColor(security_level, DEEMPHASIZED_TEXT); |
362 break; | 363 break; |
363 | 364 |
364 case ToolbarModel::SECURITY_ERROR: | 365 case ToolbarModel::SECURITY_ERROR: |
365 color = SkColorSetRGB(162, 0, 0); | 366 color = SkColorSetRGB(162, 0, 0); |
366 break; | 367 break; |
367 | 368 |
368 default: | 369 default: |
369 NOTREACHED(); | 370 NOTREACHED(); |
370 return GetColor(security_level, TEXT); | 371 return GetColor(security_level, TEXT); |
(...skipping 1093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1464 int LocationBarView::GetInternalHeight(bool use_preferred_size) { | 1465 int LocationBarView::GetInternalHeight(bool use_preferred_size) { |
1465 int total_height = | 1466 int total_height = |
1466 use_preferred_size ? GetPreferredSize().height() : height(); | 1467 use_preferred_size ? GetPreferredSize().height() : height(); |
1467 return std::max(total_height - (kVerticalEdgeThickness * 2), 0); | 1468 return std::max(total_height - (kVerticalEdgeThickness * 2), 0); |
1468 } | 1469 } |
1469 | 1470 |
1470 bool LocationBarView::HasValidSuggestText() const { | 1471 bool LocationBarView::HasValidSuggestText() const { |
1471 return suggested_text_view_ && !suggested_text_view_->size().IsEmpty() && | 1472 return suggested_text_view_ && !suggested_text_view_->size().IsEmpty() && |
1472 !suggested_text_view_->text().empty(); | 1473 !suggested_text_view_->text().empty(); |
1473 } | 1474 } |
OLD | NEW |