| 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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 [cell addLeftDecoration:selected_keyword_decoration_.get()]; | 344 [cell addLeftDecoration:selected_keyword_decoration_.get()]; |
| 345 [cell addLeftDecoration:ev_bubble_decoration_.get()]; | 345 [cell addLeftDecoration:ev_bubble_decoration_.get()]; |
| 346 [cell addRightDecoration:star_decoration_.get()]; | 346 [cell addRightDecoration:star_decoration_.get()]; |
| 347 [cell addRightDecoration:zoom_decoration_.get()]; | 347 [cell addRightDecoration:zoom_decoration_.get()]; |
| 348 | 348 |
| 349 // Note that display order is right to left. | 349 // Note that display order is right to left. |
| 350 for (size_t i = 0; i < page_action_decorations_.size(); ++i) { | 350 for (size_t i = 0; i < page_action_decorations_.size(); ++i) { |
| 351 [cell addRightDecoration:page_action_decorations_[i]]; | 351 [cell addRightDecoration:page_action_decorations_[i]]; |
| 352 } | 352 } |
| 353 | 353 |
| 354 // Iterate through |content_setting_decorations_| in reverse order so that | |
| 355 // the order in which the decorations are drawn matches the Views code. | |
| 356 for (ScopedVector<ContentSettingDecoration>::iterator i = | 354 for (ScopedVector<ContentSettingDecoration>::iterator i = |
| 357 content_setting_decorations_.begin(); | 355 content_setting_decorations_.begin(); |
| 358 i != content_setting_decorations_.end(); ++i) { | 356 i != content_setting_decorations_.end(); ++i) { |
| 359 [cell addRightDecoration:*i]; | 357 [cell addRightDecoration:*i]; |
| 360 } | 358 } |
| 361 | 359 |
| 362 [cell addRightDecoration:keyword_hint_decoration_.get()]; | 360 [cell addRightDecoration:keyword_hint_decoration_.get()]; |
| 363 [cell addRightDecoration:mic_search_decoration_.get()]; | 361 [cell addRightDecoration:mic_search_decoration_.get()]; |
| 364 | 362 |
| 365 // By default only the location icon is visible. | 363 // By default only the location icon is visible. |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 684 } | 682 } |
| 685 | 683 |
| 686 bool LocationBarViewMac::UpdateMicSearchDecorationVisibility() { | 684 bool LocationBarViewMac::UpdateMicSearchDecorationVisibility() { |
| 687 bool is_visible = !GetToolbarModel()->input_in_progress() && | 685 bool is_visible = !GetToolbarModel()->input_in_progress() && |
| 688 browser_->search_model()->voice_search_supported(); | 686 browser_->search_model()->voice_search_supported(); |
| 689 if (mic_search_decoration_->IsVisible() == is_visible) | 687 if (mic_search_decoration_->IsVisible() == is_visible) |
| 690 return false; | 688 return false; |
| 691 mic_search_decoration_->SetVisible(is_visible); | 689 mic_search_decoration_->SetVisible(is_visible); |
| 692 return true; | 690 return true; |
| 693 } | 691 } |
| OLD | NEW |