| 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 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 653 [cell addLeftDecoration:location_icon_decoration_.get()]; | 653 [cell addLeftDecoration:location_icon_decoration_.get()]; |
| 654 [cell addLeftDecoration:selected_keyword_decoration_.get()]; | 654 [cell addLeftDecoration:selected_keyword_decoration_.get()]; |
| 655 [cell addLeftDecoration:ev_bubble_decoration_.get()]; | 655 [cell addLeftDecoration:ev_bubble_decoration_.get()]; |
| 656 [cell addRightDecoration:star_decoration_.get()]; | 656 [cell addRightDecoration:star_decoration_.get()]; |
| 657 [cell addRightDecoration:zoom_decoration_.get()]; | 657 [cell addRightDecoration:zoom_decoration_.get()]; |
| 658 | 658 |
| 659 // Note that display order is right to left. | 659 // Note that display order is right to left. |
| 660 for (size_t i = 0; i < page_action_decorations_.size(); ++i) { | 660 for (size_t i = 0; i < page_action_decorations_.size(); ++i) { |
| 661 [cell addRightDecoration:page_action_decorations_[i]]; | 661 [cell addRightDecoration:page_action_decorations_[i]]; |
| 662 } | 662 } |
| 663 for (size_t i = 0; i < content_setting_decorations_.size(); ++i) { | 663 |
| 664 [cell addRightDecoration:content_setting_decorations_[i]]; | 664 // Iterate through |content_setting_decorations_| in reverse order so that |
| 665 // the order in which the decorations are drawn matches the Views code. |
| 666 for (ScopedVector<ContentSettingDecoration>::reverse_iterator i = |
| 667 content_setting_decorations_.rbegin(); |
| 668 i != content_setting_decorations_.rend(); ++i) { |
| 669 [cell addRightDecoration:*i]; |
| 665 } | 670 } |
| 666 | 671 |
| 667 [cell addRightDecoration:keyword_hint_decoration_.get()]; | 672 [cell addRightDecoration:keyword_hint_decoration_.get()]; |
| 668 [cell addRightDecoration:mic_search_decoration_.get()]; | 673 [cell addRightDecoration:mic_search_decoration_.get()]; |
| 669 | 674 |
| 670 // By default only the location icon is visible. | 675 // By default only the location icon is visible. |
| 671 location_icon_decoration_->SetVisible(true); | 676 location_icon_decoration_->SetVisible(true); |
| 672 selected_keyword_decoration_->SetVisible(false); | 677 selected_keyword_decoration_->SetVisible(false); |
| 673 ev_bubble_decoration_->SetVisible(false); | 678 ev_bubble_decoration_->SetVisible(false); |
| 674 keyword_hint_decoration_->SetVisible(false); | 679 keyword_hint_decoration_->SetVisible(false); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 738 } | 743 } |
| 739 | 744 |
| 740 bool LocationBarViewMac::UpdateMicSearchDecorationVisibility() { | 745 bool LocationBarViewMac::UpdateMicSearchDecorationVisibility() { |
| 741 bool is_visible = !GetToolbarModel()->input_in_progress() && | 746 bool is_visible = !GetToolbarModel()->input_in_progress() && |
| 742 browser_->search_model()->voice_search_supported(); | 747 browser_->search_model()->voice_search_supported(); |
| 743 if (mic_search_decoration_->IsVisible() == is_visible) | 748 if (mic_search_decoration_->IsVisible() == is_visible) |
| 744 return false; | 749 return false; |
| 745 mic_search_decoration_->SetVisible(is_visible); | 750 mic_search_decoration_->SetVisible(is_visible); |
| 746 return true; | 751 return true; |
| 747 } | 752 } |
| OLD | NEW |