Chromium Code Reviews| 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 // Reverse iterating through |content_setting_decoration_| as in aura | |
|
Ilya Sherman
2013/09/14 04:01:32
nit: "Iterate through |content_setting_decorations
npentrel
2013/09/17 11:13:22
Done.
| |
| 665 for (int i = content_setting_decorations_.size()-1; i >= 0; --i) { | |
|
Ilya Sherman
2013/09/14 04:01:32
nit: Please use rbegin() and rend() for iterating
npentrel
2013/09/17 11:13:22
Done.
| |
| 664 [cell addRightDecoration:content_setting_decorations_[i]]; | 666 [cell addRightDecoration:content_setting_decorations_[i]]; |
| 665 } | 667 } |
| 666 | 668 |
| 667 [cell addRightDecoration:keyword_hint_decoration_.get()]; | 669 [cell addRightDecoration:keyword_hint_decoration_.get()]; |
| 668 [cell addRightDecoration:mic_search_decoration_.get()]; | 670 [cell addRightDecoration:mic_search_decoration_.get()]; |
| 669 | 671 |
| 670 // By default only the location icon is visible. | 672 // By default only the location icon is visible. |
| 671 location_icon_decoration_->SetVisible(true); | 673 location_icon_decoration_->SetVisible(true); |
| 672 selected_keyword_decoration_->SetVisible(false); | 674 selected_keyword_decoration_->SetVisible(false); |
| 673 ev_bubble_decoration_->SetVisible(false); | 675 ev_bubble_decoration_->SetVisible(false); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 738 } | 740 } |
| 739 | 741 |
| 740 bool LocationBarViewMac::UpdateMicSearchDecorationVisibility() { | 742 bool LocationBarViewMac::UpdateMicSearchDecorationVisibility() { |
| 741 bool is_visible = !GetToolbarModel()->input_in_progress() && | 743 bool is_visible = !GetToolbarModel()->input_in_progress() && |
| 742 browser_->search_model()->voice_search_supported(); | 744 browser_->search_model()->voice_search_supported(); |
| 743 if (mic_search_decoration_->IsVisible() == is_visible) | 745 if (mic_search_decoration_->IsVisible() == is_visible) |
| 744 return false; | 746 return false; |
| 745 mic_search_decoration_->SetVisible(is_visible); | 747 mic_search_decoration_->SetVisible(is_visible); |
| 746 return true; | 748 return true; |
| 747 } | 749 } |
| OLD | NEW |