| 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/browser_window_controller.h" | 5 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 #include <numeric> | 8 #include <numeric> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 1702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1713 - (NSPoint)bookmarkBubblePoint { | 1713 - (NSPoint)bookmarkBubblePoint { |
| 1714 return [toolbarController_ bookmarkBubblePoint]; | 1714 return [toolbarController_ bookmarkBubblePoint]; |
| 1715 } | 1715 } |
| 1716 | 1716 |
| 1717 // Show the bookmark bubble (e.g. user just clicked on the STAR). | 1717 // Show the bookmark bubble (e.g. user just clicked on the STAR). |
| 1718 - (void)showBookmarkBubbleForURL:(const GURL&)url | 1718 - (void)showBookmarkBubbleForURL:(const GURL&)url |
| 1719 alreadyBookmarked:(BOOL)alreadyMarked { | 1719 alreadyBookmarked:(BOOL)alreadyMarked { |
| 1720 if (!bookmarkBubbleController_) { | 1720 if (!bookmarkBubbleController_) { |
| 1721 BookmarkModel* model = | 1721 BookmarkModel* model = |
| 1722 BookmarkModelFactory::GetForProfile(browser_->profile()); | 1722 BookmarkModelFactory::GetForProfile(browser_->profile()); |
| 1723 const BookmarkNode* node = model->GetMostRecentlyAddedNodeForURL(url); | 1723 const BookmarkNode* node = model->GetMostRecentlyAddedUserNodeForURL(url); |
| 1724 bookmarkBubbleController_ = | 1724 bookmarkBubbleController_ = |
| 1725 [[BookmarkBubbleController alloc] initWithParentWindow:[self window] | 1725 [[BookmarkBubbleController alloc] initWithParentWindow:[self window] |
| 1726 model:model | 1726 model:model |
| 1727 node:node | 1727 node:node |
| 1728 alreadyBookmarked:alreadyMarked]; | 1728 alreadyBookmarked:alreadyMarked]; |
| 1729 [bookmarkBubbleController_ showWindow:self]; | 1729 [bookmarkBubbleController_ showWindow:self]; |
| 1730 NSNotificationCenter* center = [NSNotificationCenter defaultCenter]; | 1730 NSNotificationCenter* center = [NSNotificationCenter defaultCenter]; |
| 1731 [center addObserver:self | 1731 [center addObserver:self |
| 1732 selector:@selector(bookmarkBubbleWindowWillClose:) | 1732 selector:@selector(bookmarkBubbleWindowWillClose:) |
| 1733 name:NSWindowWillCloseNotification | 1733 name:NSWindowWillCloseNotification |
| (...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2302 | 2302 |
| 2303 - (BOOL)supportsBookmarkBar { | 2303 - (BOOL)supportsBookmarkBar { |
| 2304 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; | 2304 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; |
| 2305 } | 2305 } |
| 2306 | 2306 |
| 2307 - (BOOL)isTabbedWindow { | 2307 - (BOOL)isTabbedWindow { |
| 2308 return browser_->is_type_tabbed(); | 2308 return browser_->is_type_tabbed(); |
| 2309 } | 2309 } |
| 2310 | 2310 |
| 2311 @end // @implementation BrowserWindowController(WindowType) | 2311 @end // @implementation BrowserWindowController(WindowType) |
| OLD | NEW |