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

Unified Diff: chrome/browser/cocoa/bookmark_bar_state_controller.mm

Issue 46078: Mac bookmark work. ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 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/cocoa/bookmark_bar_state_controller.mm
===================================================================
--- chrome/browser/cocoa/bookmark_bar_state_controller.mm (revision 0)
+++ chrome/browser/cocoa/bookmark_bar_state_controller.mm (revision 0)
@@ -0,0 +1,38 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#import "chrome/browser/cocoa/bookmark_bar_state_controller.h"
+#import "chrome/browser/bookmarks/bookmark_utils.h"
+#import "chrome/browser/browser.h"
+
+
+@implementation BookmarkBarStateController
+
+- (id)initWithBrowser:(Browser *)browser {
+ if ((self = [super init])) {
+ browser_ = browser;
+ // Initial visibility state comes from our preference.
+ if (browser_->profile()->GetPrefs()->GetBoolean(prefs::kShowBookmarkBar)) {
+ visible_ = YES;
+ }
+ }
+ return self;
+}
+
+- (BOOL)visible {
+ return visible_;
+}
+
+// Whack and save a preference change. On Windows this call
+// is made from BookmarkBarView.
+- (void)togglePreference {
+ bookmark_utils::ToggleWhenVisible(browser_->profile());
+}
+
+- (void)toggleBookmarkBar {
+ visible_ = visible_ ? NO : YES;
+ [self togglePreference];
+}
+
+@end // BookmarkBarStateController
« no previous file with comments | « chrome/browser/cocoa/bookmark_bar_state_controller.h ('k') | chrome/browser/cocoa/bookmark_bar_state_controller_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698