| 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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  427         GetKeywordShortName(keyword, &is_extension_keyword); |  427         GetKeywordShortName(keyword, &is_extension_keyword); | 
|  428   } |  428   } | 
|  429  |  429  | 
|  430   const bool is_keyword_hint = omnibox_view_->model()->is_keyword_hint(); |  430   const bool is_keyword_hint = omnibox_view_->model()->is_keyword_hint(); | 
|  431   if (!keyword.empty() && !is_keyword_hint) { |  431   if (!keyword.empty() && !is_keyword_hint) { | 
|  432     // Switch from location icon to keyword mode. |  432     // Switch from location icon to keyword mode. | 
|  433     location_icon_decoration_->SetVisible(false); |  433     location_icon_decoration_->SetVisible(false); | 
|  434     selected_keyword_decoration_->SetVisible(true); |  434     selected_keyword_decoration_->SetVisible(true); | 
|  435     selected_keyword_decoration_->SetKeyword(short_name, is_extension_keyword); |  435     selected_keyword_decoration_->SetKeyword(short_name, is_extension_keyword); | 
|  436     selected_keyword_decoration_->SetImage(GetKeywordImage(keyword)); |  436     selected_keyword_decoration_->SetImage(GetKeywordImage(keyword)); | 
|  437   } else if ((GetToolbarModel()->GetSecurityLevel(false) == |  437   } else if (GetToolbarModel()->GetSecurityLevel(false) == | 
|  438               ConnectionSecurityHelper::EV_SECURE)) { |  438              connection_security::EV_SECURE) { | 
|  439     // Switch from location icon to show the EV bubble instead. |  439     // Switch from location icon to show the EV bubble instead. | 
|  440     location_icon_decoration_->SetVisible(false); |  440     location_icon_decoration_->SetVisible(false); | 
|  441     ev_bubble_decoration_->SetVisible(true); |  441     ev_bubble_decoration_->SetVisible(true); | 
|  442  |  442  | 
|  443     base::string16 label(GetToolbarModel()->GetEVCertName()); |  443     base::string16 label(GetToolbarModel()->GetEVCertName()); | 
|  444     ev_bubble_decoration_->SetFullLabel(base::SysUTF16ToNSString(label)); |  444     ev_bubble_decoration_->SetFullLabel(base::SysUTF16ToNSString(label)); | 
|  445   } else if (!keyword.empty() && is_keyword_hint) { |  445   } else if (!keyword.empty() && is_keyword_hint) { | 
|  446     keyword_hint_decoration_->SetKeyword(short_name, |  446     keyword_hint_decoration_->SetKeyword(short_name, | 
|  447                                          is_extension_keyword); |  447                                          is_extension_keyword); | 
|  448     keyword_hint_decoration_->SetVisible(true); |  448     keyword_hint_decoration_->SetVisible(true); | 
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  729 } |  729 } | 
|  730  |  730  | 
|  731 bool LocationBarViewMac::UpdateMicSearchDecorationVisibility() { |  731 bool LocationBarViewMac::UpdateMicSearchDecorationVisibility() { | 
|  732   bool is_visible = !GetToolbarModel()->input_in_progress() && |  732   bool is_visible = !GetToolbarModel()->input_in_progress() && | 
|  733                     browser_->search_model()->voice_search_supported(); |  733                     browser_->search_model()->voice_search_supported(); | 
|  734   if (mic_search_decoration_->IsVisible() == is_visible) |  734   if (mic_search_decoration_->IsVisible() == is_visible) | 
|  735     return false; |  735     return false; | 
|  736   mic_search_decoration_->SetVisible(is_visible); |  736   mic_search_decoration_->SetVisible(is_visible); | 
|  737   return true; |  737   return true; | 
|  738 } |  738 } | 
| OLD | NEW |