| 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 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 UpdateZoomDecoration(); | 332 UpdateZoomDecoration(); |
| 333 UpdatePageActions(); | 333 UpdatePageActions(); |
| 334 Layout(); | 334 Layout(); |
| 335 } | 335 } |
| 336 | 336 |
| 337 bool LocationBarViewMac::IsEditable() { | 337 bool LocationBarViewMac::IsEditable() { |
| 338 return [field_ isEditable] ? true : false; | 338 return [field_ isEditable] ? true : false; |
| 339 } | 339 } |
| 340 | 340 |
| 341 void LocationBarViewMac::SetStarred(bool starred) { | 341 void LocationBarViewMac::SetStarred(bool starred) { |
| 342 if (star_decoration_->starred() == starred) |
| 343 return; |
| 344 |
| 342 star_decoration_->SetStarred(starred); | 345 star_decoration_->SetStarred(starred); |
| 343 UpdateStarDecorationVisibility(); | 346 UpdateStarDecorationVisibility(); |
| 344 OnDecorationsChanged(); | 347 OnDecorationsChanged(); |
| 345 } | 348 } |
| 346 | 349 |
| 347 void LocationBarViewMac::SetTranslateIconLit(bool on) { | 350 void LocationBarViewMac::SetTranslateIconLit(bool on) { |
| 348 translate_decoration_->SetLit(on); | 351 translate_decoration_->SetLit(on); |
| 349 OnDecorationsChanged(); | 352 OnDecorationsChanged(); |
| 350 } | 353 } |
| 351 | 354 |
| (...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 801 } | 804 } |
| 802 | 805 |
| 803 bool LocationBarViewMac::UpdateMicSearchDecorationVisibility() { | 806 bool LocationBarViewMac::UpdateMicSearchDecorationVisibility() { |
| 804 bool is_visible = !GetToolbarModel()->input_in_progress() && | 807 bool is_visible = !GetToolbarModel()->input_in_progress() && |
| 805 browser_->search_model()->voice_search_supported(); | 808 browser_->search_model()->voice_search_supported(); |
| 806 if (mic_search_decoration_->IsVisible() == is_visible) | 809 if (mic_search_decoration_->IsVisible() == is_visible) |
| 807 return false; | 810 return false; |
| 808 mic_search_decoration_->SetVisible(is_visible); | 811 mic_search_decoration_->SetVisible(is_visible); |
| 809 return true; | 812 return true; |
| 810 } | 813 } |
| OLD | NEW |