| 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 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 gfx::Rect bounds(NSRectToCGRect([field_ frame])); | 586 gfx::Rect bounds(NSRectToCGRect([field_ frame])); |
| 587 instant_service->OnOmniboxStartMarginChanged(bounds.x()); | 587 instant_service->OnOmniboxStartMarginChanged(bounds.x()); |
| 588 } | 588 } |
| 589 } | 589 } |
| 590 | 590 |
| 591 void LocationBarViewMac::OnSetFocus() { | 591 void LocationBarViewMac::OnSetFocus() { |
| 592 // Update the keyword and search hint states. | 592 // Update the keyword and search hint states. |
| 593 OnChanged(); | 593 OnChanged(); |
| 594 } | 594 } |
| 595 | 595 |
| 596 void LocationBarViewMac::ShowURL() { |
| 597 omnibox_view_->ShowURL(); |
| 598 } |
| 599 |
| 600 void LocationBarViewMac::HideURL() { |
| 601 omnibox_view_->HideURL(); |
| 602 } |
| 603 |
| 596 InstantController* LocationBarViewMac::GetInstant() { | 604 InstantController* LocationBarViewMac::GetInstant() { |
| 597 return browser_->instant_controller() ? | 605 return browser_->instant_controller() ? |
| 598 browser_->instant_controller()->instant() : NULL; | 606 browser_->instant_controller()->instant() : NULL; |
| 599 } | 607 } |
| 600 | 608 |
| 601 WebContents* LocationBarViewMac::GetWebContents() { | 609 WebContents* LocationBarViewMac::GetWebContents() { |
| 602 return browser_->tab_strip_model()->GetActiveWebContents(); | 610 return browser_->tab_strip_model()->GetActiveWebContents(); |
| 603 } | 611 } |
| 604 | 612 |
| 605 ToolbarModel* LocationBarViewMac::GetToolbarModel() { | 613 ToolbarModel* LocationBarViewMac::GetToolbarModel() { |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 799 } | 807 } |
| 800 | 808 |
| 801 bool LocationBarViewMac::UpdateMicSearchDecorationVisibility() { | 809 bool LocationBarViewMac::UpdateMicSearchDecorationVisibility() { |
| 802 bool is_visible = !GetToolbarModel()->input_in_progress() && | 810 bool is_visible = !GetToolbarModel()->input_in_progress() && |
| 803 browser_->search_model()->voice_search_supported(); | 811 browser_->search_model()->voice_search_supported(); |
| 804 if (mic_search_decoration_->IsVisible() == is_visible) | 812 if (mic_search_decoration_->IsVisible() == is_visible) |
| 805 return false; | 813 return false; |
| 806 mic_search_decoration_->SetVisible(is_visible); | 814 mic_search_decoration_->SetVisible(is_visible); |
| 807 return true; | 815 return true; |
| 808 } | 816 } |
| OLD | NEW |