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 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 gfx::Rect bounds(NSRectToCGRect([field_ frame])); | 563 gfx::Rect bounds(NSRectToCGRect([field_ frame])); |
564 instant_service->OnOmniboxStartMarginChanged(bounds.x()); | 564 instant_service->OnOmniboxStartMarginChanged(bounds.x()); |
565 } | 565 } |
566 } | 566 } |
567 | 567 |
568 void LocationBarViewMac::OnSetFocus() { | 568 void LocationBarViewMac::OnSetFocus() { |
569 // Update the keyword and search hint states. | 569 // Update the keyword and search hint states. |
570 OnChanged(); | 570 OnChanged(); |
571 } | 571 } |
572 | 572 |
| 573 void LocationBarViewMac::ShowURL() { |
| 574 omnibox_view_->ShowURL(); |
| 575 } |
| 576 |
| 577 void LocationBarViewMac::HideURL() { |
| 578 omnibox_view_->HideURL(); |
| 579 } |
| 580 |
573 InstantController* LocationBarViewMac::GetInstant() { | 581 InstantController* LocationBarViewMac::GetInstant() { |
574 return browser_->instant_controller() ? | 582 return browser_->instant_controller() ? |
575 browser_->instant_controller()->instant() : NULL; | 583 browser_->instant_controller()->instant() : NULL; |
576 } | 584 } |
577 | 585 |
578 WebContents* LocationBarViewMac::GetWebContents() { | 586 WebContents* LocationBarViewMac::GetWebContents() { |
579 return browser_->tab_strip_model()->GetActiveWebContents(); | 587 return browser_->tab_strip_model()->GetActiveWebContents(); |
580 } | 588 } |
581 | 589 |
582 ToolbarModel* LocationBarViewMac::GetToolbarModel() { | 590 ToolbarModel* LocationBarViewMac::GetToolbarModel() { |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
776 } | 784 } |
777 | 785 |
778 bool LocationBarViewMac::UpdateMicSearchDecorationVisibility() { | 786 bool LocationBarViewMac::UpdateMicSearchDecorationVisibility() { |
779 bool is_visible = !GetToolbarModel()->input_in_progress() && | 787 bool is_visible = !GetToolbarModel()->input_in_progress() && |
780 browser_->search_model()->voice_search_supported(); | 788 browser_->search_model()->voice_search_supported(); |
781 if (mic_search_decoration_->IsVisible() == is_visible) | 789 if (mic_search_decoration_->IsVisible() == is_visible) |
782 return false; | 790 return false; |
783 mic_search_decoration_->SetVisible(is_visible); | 791 mic_search_decoration_->SetVisible(is_visible); |
784 return true; | 792 return true; |
785 } | 793 } |
OLD | NEW |