Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(553)

Side by Side Diff: chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm

Issue 1539043002: Pull SecurityStateModel out into a component (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: unit test debugging Created 4 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 #import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h" 5 #import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 const bool is_keyword_hint = omnibox_view_->model()->is_keyword_hint(); 446 const bool is_keyword_hint = omnibox_view_->model()->is_keyword_hint();
447 ChromeToolbarModel* chrome_toolbar_model = 447 ChromeToolbarModel* chrome_toolbar_model =
448 static_cast<ChromeToolbarModel*>(GetToolbarModel()); 448 static_cast<ChromeToolbarModel*>(GetToolbarModel());
449 if (!keyword.empty() && !is_keyword_hint) { 449 if (!keyword.empty() && !is_keyword_hint) {
450 // Switch from location icon to keyword mode. 450 // Switch from location icon to keyword mode.
451 location_icon_decoration_->SetVisible(false); 451 location_icon_decoration_->SetVisible(false);
452 selected_keyword_decoration_->SetVisible(true); 452 selected_keyword_decoration_->SetVisible(true);
453 selected_keyword_decoration_->SetKeyword(short_name, is_extension_keyword); 453 selected_keyword_decoration_->SetKeyword(short_name, is_extension_keyword);
454 selected_keyword_decoration_->SetImage(GetKeywordImage(keyword)); 454 selected_keyword_decoration_->SetImage(GetKeywordImage(keyword));
455 } else if (chrome_toolbar_model->GetSecurityLevel(false) == 455 } else if (chrome_toolbar_model->GetSecurityLevel(false) ==
456 SecurityStateModel::EV_SECURE) { 456 security_state::SecurityStateModel::EV_SECURE) {
457 // Switch from location icon to show the EV bubble instead. 457 // Switch from location icon to show the EV bubble instead.
458 location_icon_decoration_->SetVisible(false); 458 location_icon_decoration_->SetVisible(false);
459 ev_bubble_decoration_->SetVisible(true); 459 ev_bubble_decoration_->SetVisible(true);
460 460
461 base::string16 label(GetToolbarModel()->GetEVCertName()); 461 base::string16 label(GetToolbarModel()->GetEVCertName());
462 ev_bubble_decoration_->SetFullLabel(base::SysUTF16ToNSString(label)); 462 ev_bubble_decoration_->SetFullLabel(base::SysUTF16ToNSString(label));
463 } else if (!keyword.empty() && is_keyword_hint) { 463 } else if (!keyword.empty() && is_keyword_hint) {
464 keyword_hint_decoration_->SetKeyword(short_name, 464 keyword_hint_decoration_->SetKeyword(short_name,
465 is_extension_keyword); 465 is_extension_keyword);
466 keyword_hint_decoration_->SetVisible(true); 466 keyword_hint_decoration_->SetVisible(true);
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
730 730
731 return zoom_decoration_->UpdateIfNecessary( 731 return zoom_decoration_->UpdateIfNecessary(
732 ui_zoom::ZoomController::FromWebContents(web_contents), 732 ui_zoom::ZoomController::FromWebContents(web_contents),
733 default_zoom_changed); 733 default_zoom_changed);
734 } 734 }
735 735
736 void LocationBarViewMac::OnDefaultZoomLevelChanged() { 736 void LocationBarViewMac::OnDefaultZoomLevelChanged() {
737 if (UpdateZoomDecoration(/*default_zoom_changed=*/true)) 737 if (UpdateZoomDecoration(/*default_zoom_changed=*/true))
738 OnDecorationsChanged(); 738 OnDecorationsChanged();
739 } 739 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698