Chromium Code Reviews| Index: chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm |
| diff --git a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm |
| index a72928503a1fde8b0108c8703c9b5da175e02c1c..d5c7f231ef000ecdf91f108423ad41935c6400e3 100644 |
| --- a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm |
| +++ b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm |
| @@ -80,6 +80,13 @@ const static int kFirstRunBubbleYOffset = 1; |
| } // namespace |
| +namespace chrome { |
| + |
| +NSString* const kShowToolbarNotification = @"ShowToolbarNotification"; |
| +NSString* const kHideToolbarNotification = @"HideToolbarNotification"; |
| + |
| +} // namespace chrome |
| + |
| // TODO(shess): This code is mostly copied from the gtk |
| // implementation. Make sure it's all appropriate and flesh it out. |
| @@ -103,6 +110,7 @@ LocationBarViewMac::LocationBarViewMac(AutocompleteTextField* field, |
| manage_passwords_decoration_( |
| new ManagePasswordsDecoration(command_updater, this)), |
| browser_(browser), |
| + show_location_bar_(true), |
| weak_ptr_factory_(this) { |
| for (size_t i = 0; i < CONTENT_SETTINGS_NUM_TYPES; ++i) { |
| DCHECK_EQ(i, content_setting_decorations_.size()); |
| @@ -200,7 +208,15 @@ void LocationBarViewMac::UpdateBookmarkStarVisibility() { |
| void LocationBarViewMac::UpdateLocationBarVisibility(bool visible, |
| bool animate) { |
| - // Not implemented on Mac. |
| + // TODO(dominickn): respect the |animate| value. |
| + if (visible != show_location_bar_) { |
| + [[NSNotificationCenter defaultCenter] |
|
tapted
2015/09/08 05:55:06
Something like
[[BrowserWindowController browserW
dominickn
2015/10/09 06:37:02
Done.
|
| + postNotificationName:(visible ? chrome::kShowToolbarNotification |
| + : chrome::kHideToolbarNotification) |
| + object:nil]; |
| + show_location_bar_ = visible; |
| + [field_ setHidden:!visible]; |
| + } |
| } |
| bool LocationBarViewMac::ShowPageActionPopup( |