OLD | NEW |
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 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 const bool is_keyword_hint = omnibox_view_->model()->is_keyword_hint(); | 416 const bool is_keyword_hint = omnibox_view_->model()->is_keyword_hint(); |
417 ChromeToolbarModel* chrome_toolbar_model = | 417 ChromeToolbarModel* chrome_toolbar_model = |
418 static_cast<ChromeToolbarModel*>(GetToolbarModel()); | 418 static_cast<ChromeToolbarModel*>(GetToolbarModel()); |
419 if (!keyword.empty() && !is_keyword_hint) { | 419 if (!keyword.empty() && !is_keyword_hint) { |
420 // Switch from location icon to keyword mode. | 420 // Switch from location icon to keyword mode. |
421 location_icon_decoration_->SetVisible(false); | 421 location_icon_decoration_->SetVisible(false); |
422 selected_keyword_decoration_->SetVisible(true); | 422 selected_keyword_decoration_->SetVisible(true); |
423 selected_keyword_decoration_->SetKeyword(short_name, is_extension_keyword); | 423 selected_keyword_decoration_->SetKeyword(short_name, is_extension_keyword); |
424 selected_keyword_decoration_->SetImage(GetKeywordImage(keyword)); | 424 selected_keyword_decoration_->SetImage(GetKeywordImage(keyword)); |
425 } else if (chrome_toolbar_model->GetSecurityLevel(false) == | 425 } else if (chrome_toolbar_model->GetSecurityLevel(false) == |
426 connection_security::EV_SECURE) { | 426 SecurityStateModel::EV_SECURE) { |
427 // Switch from location icon to show the EV bubble instead. | 427 // Switch from location icon to show the EV bubble instead. |
428 location_icon_decoration_->SetVisible(false); | 428 location_icon_decoration_->SetVisible(false); |
429 ev_bubble_decoration_->SetVisible(true); | 429 ev_bubble_decoration_->SetVisible(true); |
430 | 430 |
431 base::string16 label(GetToolbarModel()->GetEVCertName()); | 431 base::string16 label(GetToolbarModel()->GetEVCertName()); |
432 ev_bubble_decoration_->SetFullLabel(base::SysUTF16ToNSString(label)); | 432 ev_bubble_decoration_->SetFullLabel(base::SysUTF16ToNSString(label)); |
433 } else if (!keyword.empty() && is_keyword_hint) { | 433 } else if (!keyword.empty() && is_keyword_hint) { |
434 keyword_hint_decoration_->SetKeyword(short_name, | 434 keyword_hint_decoration_->SetKeyword(short_name, |
435 is_extension_keyword); | 435 is_extension_keyword); |
436 keyword_hint_decoration_->SetVisible(true); | 436 keyword_hint_decoration_->SetVisible(true); |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
715 } | 715 } |
716 | 716 |
717 bool LocationBarViewMac::UpdateMicSearchDecorationVisibility() { | 717 bool LocationBarViewMac::UpdateMicSearchDecorationVisibility() { |
718 bool is_visible = !GetToolbarModel()->input_in_progress() && | 718 bool is_visible = !GetToolbarModel()->input_in_progress() && |
719 browser_->search_model()->voice_search_supported(); | 719 browser_->search_model()->voice_search_supported(); |
720 if (mic_search_decoration_->IsVisible() == is_visible) | 720 if (mic_search_decoration_->IsVisible() == is_visible) |
721 return false; | 721 return false; |
722 mic_search_decoration_->SetVisible(is_visible); | 722 mic_search_decoration_->SetVisible(is_visible); |
723 return true; | 723 return true; |
724 } | 724 } |
OLD | NEW |