OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <Carbon/Carbon.h> | 7 #include <Carbon/Carbon.h> |
8 | 8 |
9 #include <cmath> | 9 #include <cmath> |
10 #include <numeric> | 10 #include <numeric> |
(...skipping 1616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1627 bookmarkBubbleController_ = nil; | 1627 bookmarkBubbleController_ = nil; |
1628 } | 1628 } |
1629 | 1629 |
1630 // Handle the editBookmarkNode: action sent from bookmark bubble controllers. | 1630 // Handle the editBookmarkNode: action sent from bookmark bubble controllers. |
1631 - (void)editBookmarkNode:(id)sender { | 1631 - (void)editBookmarkNode:(id)sender { |
1632 BOOL responds = [sender respondsToSelector:@selector(node)]; | 1632 BOOL responds = [sender respondsToSelector:@selector(node)]; |
1633 DCHECK(responds); | 1633 DCHECK(responds); |
1634 if (responds) { | 1634 if (responds) { |
1635 const BookmarkNode* node = [sender node]; | 1635 const BookmarkNode* node = [sender node]; |
1636 if (node) { | 1636 if (node) { |
1637 #if defined(WEBUI_DIALOGS) | |
1638 DCHECK(browser_); | |
1639 browser_->OpenBookmarkManagerEditNode(node->id()); | |
1640 #else | |
1641 // A BookmarkEditorController is a sheet that owns itself, and | 1637 // A BookmarkEditorController is a sheet that owns itself, and |
1642 // deallocates itself when closed. | 1638 // deallocates itself when closed. |
1643 [[[BookmarkEditorController alloc] | 1639 [[[BookmarkEditorController alloc] |
1644 initWithParentWindow:[self window] | 1640 initWithParentWindow:[self window] |
1645 profile:browser_->profile() | 1641 profile:browser_->profile() |
1646 parent:node->parent() | 1642 parent:node->parent() |
1647 node:node | 1643 node:node |
1648 configuration:BookmarkEditor::SHOW_TREE] | 1644 configuration:BookmarkEditor::SHOW_TREE] |
1649 runAsModalSheet]; | 1645 runAsModalSheet]; |
1650 #endif | |
1651 } | 1646 } |
1652 } | 1647 } |
1653 } | 1648 } |
1654 | 1649 |
1655 // If the browser is in incognito mode or has multi-profiles, install the image | 1650 // If the browser is in incognito mode or has multi-profiles, install the image |
1656 // view to decorate the window at the upper right. Use the same base y | 1651 // view to decorate the window at the upper right. Use the same base y |
1657 // coordinate as the tab strip. | 1652 // coordinate as the tab strip. |
1658 - (void)installAvatar { | 1653 - (void)installAvatar { |
1659 // Only install if this browser window is OTR and has a tab strip. | 1654 // Only install if this browser window is OTR and has a tab strip. |
1660 if (![self shouldShowAvatar]) | 1655 if (![self shouldShowAvatar]) |
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2156 | 2151 |
2157 - (BOOL)supportsBookmarkBar { | 2152 - (BOOL)supportsBookmarkBar { |
2158 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; | 2153 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; |
2159 } | 2154 } |
2160 | 2155 |
2161 - (BOOL)isTabbedWindow { | 2156 - (BOOL)isTabbedWindow { |
2162 return browser_->is_type_tabbed(); | 2157 return browser_->is_type_tabbed(); |
2163 } | 2158 } |
2164 | 2159 |
2165 @end // @implementation BrowserWindowController(WindowType) | 2160 @end // @implementation BrowserWindowController(WindowType) |
OLD | NEW |