| 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.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 location_icon_decoration_(new LocationIconDecoration(this)), | 96 location_icon_decoration_(new LocationIconDecoration(this)), |
| 97 search_token_decoration_(new SearchTokenDecoration()), | 97 search_token_decoration_(new SearchTokenDecoration()), |
| 98 selected_keyword_decoration_( | 98 selected_keyword_decoration_( |
| 99 new SelectedKeywordDecoration(OmniboxViewMac::GetFieldFont())), | 99 new SelectedKeywordDecoration(OmniboxViewMac::GetFieldFont())), |
| 100 separator_decoration_(new SeparatorDecoration()), | 100 separator_decoration_(new SeparatorDecoration()), |
| 101 ev_bubble_decoration_( | 101 ev_bubble_decoration_( |
| 102 new EVBubbleDecoration(location_icon_decoration_.get(), | 102 new EVBubbleDecoration(location_icon_decoration_.get(), |
| 103 OmniboxViewMac::GetFieldFont())), | 103 OmniboxViewMac::GetFieldFont())), |
| 104 plus_decoration_(NULL), | 104 plus_decoration_(NULL), |
| 105 star_decoration_(new StarDecoration(command_updater)), | 105 star_decoration_(new StarDecoration(command_updater)), |
| 106 zoom_decoration_(new ZoomDecoration(toolbar_model)), | 106 zoom_decoration_(new ZoomDecoration(this)), |
| 107 keyword_hint_decoration_( | 107 keyword_hint_decoration_( |
| 108 new KeywordHintDecoration(OmniboxViewMac::GetFieldFont())), | 108 new KeywordHintDecoration(OmniboxViewMac::GetFieldFont())), |
| 109 profile_(profile), | 109 profile_(profile), |
| 110 browser_(browser), | 110 browser_(browser), |
| 111 toolbar_model_(toolbar_model), | 111 toolbar_model_(toolbar_model), |
| 112 transition_(content::PageTransitionFromInt( | 112 transition_(content::PageTransitionFromInt( |
| 113 content::PAGE_TRANSITION_TYPED | | 113 content::PAGE_TRANSITION_TYPED | |
| 114 content::PAGE_TRANSITION_FROM_ADDRESS_BAR)), | 114 content::PAGE_TRANSITION_FROM_ADDRESS_BAR)), |
| 115 weak_ptr_factory_(this) { | 115 weak_ptr_factory_(this) { |
| 116 if (extensions::FeatureSwitch::action_box()->IsEnabled()) { | 116 if (extensions::FeatureSwitch::action_box()->IsEnabled()) { |
| (...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 660 // TODO(shess): Shortly, this code will live somewhere else, like in | 660 // TODO(shess): Shortly, this code will live somewhere else, like in |
| 661 // the constructor. I am still wrestling with how best to deal with | 661 // the constructor. I am still wrestling with how best to deal with |
| 662 // right-hand decorations, which are not a static set. | 662 // right-hand decorations, which are not a static set. |
| 663 [cell clearDecorations]; | 663 [cell clearDecorations]; |
| 664 [cell addLeftDecoration:location_icon_decoration_.get()]; | 664 [cell addLeftDecoration:location_icon_decoration_.get()]; |
| 665 [cell addLeftDecoration:selected_keyword_decoration_.get()]; | 665 [cell addLeftDecoration:selected_keyword_decoration_.get()]; |
| 666 [cell addLeftDecoration:ev_bubble_decoration_.get()]; | 666 [cell addLeftDecoration:ev_bubble_decoration_.get()]; |
| 667 if (plus_decoration_.get()) | 667 if (plus_decoration_.get()) |
| 668 [cell addRightDecoration:plus_decoration_.get()]; | 668 [cell addRightDecoration:plus_decoration_.get()]; |
| 669 [cell addRightDecoration:star_decoration_.get()]; | 669 [cell addRightDecoration:star_decoration_.get()]; |
| 670 // TODO(dbeam): uncomment when zoom bubble exists. | 670 [cell addRightDecoration:zoom_decoration_.get()]; |
| 671 // [cell addRightDecoration:zoom_decoration_.get()]; | |
| 672 | 671 |
| 673 // Note that display order is right to left. | 672 // Note that display order is right to left. |
| 674 for (size_t i = 0; i < page_action_decorations_.size(); ++i) { | 673 for (size_t i = 0; i < page_action_decorations_.size(); ++i) { |
| 675 [cell addRightDecoration:page_action_decorations_[i]]; | 674 [cell addRightDecoration:page_action_decorations_[i]]; |
| 676 } | 675 } |
| 677 for (size_t i = 0; i < content_setting_decorations_.size(); ++i) { | 676 for (size_t i = 0; i < content_setting_decorations_.size(); ++i) { |
| 678 [cell addRightDecoration:content_setting_decorations_[i]]; | 677 [cell addRightDecoration:content_setting_decorations_[i]]; |
| 679 } | 678 } |
| 680 | 679 |
| 681 [cell addRightDecoration:keyword_hint_decoration_.get()]; | 680 [cell addRightDecoration:keyword_hint_decoration_.get()]; |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 783 if (!toolbar_model_->GetInputInProgress() && | 782 if (!toolbar_model_->GetInputInProgress() && |
| 784 toolbar_model_->WouldReplaceSearchURLWithSearchTerms()) { | 783 toolbar_model_->WouldReplaceSearchURLWithSearchTerms()) { |
| 785 const TemplateURL* template_url = | 784 const TemplateURL* template_url = |
| 786 TemplateURLServiceFactory::GetForProfile(profile_)-> | 785 TemplateURLServiceFactory::GetForProfile(profile_)-> |
| 787 GetDefaultSearchProvider(); | 786 GetDefaultSearchProvider(); |
| 788 if (template_url) | 787 if (template_url) |
| 789 return template_url->short_name(); | 788 return template_url->short_name(); |
| 790 } | 789 } |
| 791 return string16(); | 790 return string16(); |
| 792 } | 791 } |
| OLD | NEW |