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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #import "chrome/browser/cocoa/bookmark_bar_state_controller.h"
6 #import "chrome/browser/bookmarks/bookmark_utils.h"
7 #import "chrome/browser/browser.h"
8
9
10 @implementation BookmarkBarStateController
11
12 - (id)initWithBrowser:(Browser *)browser {
13 if ((self = [super init])) {
14 browser_ = browser;
15 // Initial visibility state comes from our preference.
16 if (browser_->profile()->GetPrefs()->GetBoolean(prefs::kShowBookmarkBar)) {
17 visible_ = YES;
18 }
19 }
20 return self;
21 }
22
23 - (BOOL)visible {
24 return visible_;
25 }
26
27 // Whack and save a preference change. On Windows this call
28 // is made from BookmarkBarView.
29 - (void)togglePreference {
30 bookmark_utils::ToggleWhenVisible(browser_->profile());
31 }
32
33 - (void)toggleBookmarkBar {
34 visible_ = visible_ ? NO : YES;
35 [self togglePreference];
36 }
37
38 @end // BookmarkBarStateController
OLDNEW
« 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