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

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: rebase Created 4 years, 11 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 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 const bool is_keyword_hint = omnibox_view_->model()->is_keyword_hint(); 443 const bool is_keyword_hint = omnibox_view_->model()->is_keyword_hint();
444 ChromeToolbarModel* chrome_toolbar_model = 444 ChromeToolbarModel* chrome_toolbar_model =
445 static_cast<ChromeToolbarModel*>(GetToolbarModel()); 445 static_cast<ChromeToolbarModel*>(GetToolbarModel());
446 if (!keyword.empty() && !is_keyword_hint) { 446 if (!keyword.empty() && !is_keyword_hint) {
447 // Switch from location icon to keyword mode. 447 // Switch from location icon to keyword mode.
448 location_icon_decoration_->SetVisible(false); 448 location_icon_decoration_->SetVisible(false);
449 selected_keyword_decoration_->SetVisible(true); 449 selected_keyword_decoration_->SetVisible(true);
450 selected_keyword_decoration_->SetKeyword(short_name, is_extension_keyword); 450 selected_keyword_decoration_->SetKeyword(short_name, is_extension_keyword);
451 selected_keyword_decoration_->SetImage(GetKeywordImage(keyword)); 451 selected_keyword_decoration_->SetImage(GetKeywordImage(keyword));
452 } else if (chrome_toolbar_model->GetSecurityLevel(false) == 452 } else if (chrome_toolbar_model->GetSecurityLevel(false) ==
453 SecurityStateModel::EV_SECURE) { 453 security_state::SecurityStateModel::EV_SECURE) {
454 // Switch from location icon to show the EV bubble instead. 454 // Switch from location icon to show the EV bubble instead.
455 location_icon_decoration_->SetVisible(false); 455 location_icon_decoration_->SetVisible(false);
456 ev_bubble_decoration_->SetVisible(true); 456 ev_bubble_decoration_->SetVisible(true);
457 457
458 base::string16 label(GetToolbarModel()->GetEVCertName()); 458 base::string16 label(GetToolbarModel()->GetEVCertName());
459 ev_bubble_decoration_->SetFullLabel(base::SysUTF16ToNSString(label)); 459 ev_bubble_decoration_->SetFullLabel(base::SysUTF16ToNSString(label));
460 } else if (!keyword.empty() && is_keyword_hint) { 460 } else if (!keyword.empty() && is_keyword_hint) {
461 keyword_hint_decoration_->SetKeyword(short_name, 461 keyword_hint_decoration_->SetKeyword(short_name,
462 is_extension_keyword); 462 is_extension_keyword);
463 keyword_hint_decoration_->SetVisible(true); 463 keyword_hint_decoration_->SetVisible(true);
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 720
721 return zoom_decoration_->UpdateIfNecessary( 721 return zoom_decoration_->UpdateIfNecessary(
722 ui_zoom::ZoomController::FromWebContents(web_contents), 722 ui_zoom::ZoomController::FromWebContents(web_contents),
723 default_zoom_changed); 723 default_zoom_changed);
724 } 724 }
725 725
726 void LocationBarViewMac::OnDefaultZoomLevelChanged() { 726 void LocationBarViewMac::OnDefaultZoomLevelChanged() {
727 if (UpdateZoomDecoration(/*default_zoom_changed=*/true)) 727 if (UpdateZoomDecoration(/*default_zoom_changed=*/true))
728 OnDecorationsChanged(); 728 OnDecorationsChanged();
729 } 729 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_cocoa.mm ('k') | chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698