Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7635)

Unified Diff: chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm

Issue 1305143008: [Mac] Implement LocationBarViewMac::UpdateLocationBarVisibility() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix comment Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 3417aa77227ed47eeaa62d5e80332d1840949ade..74dae558480737154dfc484bf283517da99407ae 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
@@ -29,6 +29,7 @@
#include "chrome/browser/translate/chrome_translate_client.h"
#include "chrome/browser/translate/translate_service.h"
#include "chrome/browser/ui/browser_list.h"
+#import "chrome/browser/ui/cocoa/browser_window_controller.h"
#import "chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa.h"
#import "chrome/browser/ui/cocoa/extensions/extension_popup_controller.h"
#import "chrome/browser/ui/cocoa/first_run_bubble_controller.h"
@@ -103,6 +104,7 @@ LocationBarViewMac::LocationBarViewMac(AutocompleteTextField* field,
manage_passwords_decoration_(
new ManagePasswordsDecoration(command_updater, this)),
browser_(browser),
+ visible_(true),
weak_ptr_factory_(this) {
for (ContentSettingsType type :
ContentSettingBubbleModel::GetSupportedBubbleTypes()) {
@@ -199,7 +201,16 @@ void LocationBarViewMac::UpdateBookmarkStarVisibility() {
void LocationBarViewMac::UpdateLocationBarVisibility(bool visible,
bool animate) {
- // Not implemented on Mac.
+ // The location bar is held within the toolbar, so its visibility is
+ // controlled by the visibility of the toolbar. In turn, the toolbar
+ // visibility is controlled by the BWC. If we have requested a visibility
+ // change, ask the BWC for the current view to tell the toolbar controller
+ // to update.
+ if (visible != visible_) {
+ [[BrowserWindowController browserWindowControllerForView:field_]
+ updateToolbarVisibility:visible withAnimation:animate];
tapted 2015/10/12 23:56:43 We should be able to find a way to call it directl
dominickn 2015/10/15 06:22:28 Done.
+ visible_ = visible;
+ }
}
bool LocationBarViewMac::ShowPageActionPopup(

Powered by Google App Engine
This is Rietveld 408576698