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

Side by Side Diff: chrome/browser/ui/cocoa/browser_window_controller.mm

Issue 1233673002: Fix componentization of chrome/browser/bookmarks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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
OLDNEW
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"
11 #include "base/mac/bundle_locations.h" 11 #include "base/mac/bundle_locations.h"
12 #import "base/mac/foundation_util.h" 12 #import "base/mac/foundation_util.h"
13 #include "base/mac/mac_util.h" 13 #include "base/mac/mac_util.h"
14 #import "base/mac/sdk_forward_declarations.h" 14 #import "base/mac/sdk_forward_declarations.h"
15 #include "base/strings/sys_string_conversions.h" 15 #include "base/strings/sys_string_conversions.h"
16 #include "base/strings/utf_string_conversions.h" 16 #include "base/strings/utf_string_conversions.h"
17 #include "chrome/app/chrome_command_ids.h" // IDC_* 17 #include "chrome/app/chrome_command_ids.h" // IDC_*
18 #import "chrome/browser/app_controller_mac.h" 18 #import "chrome/browser/app_controller_mac.h"
19 #include "chrome/browser/bookmarks/bookmark_model_factory.h" 19 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
20 #include "chrome/browser/bookmarks/chrome_bookmark_client.h" 20 #include "chrome/browser/bookmarks/managed_bookmark_service_factory.h"
21 #include "chrome/browser/bookmarks/chrome_bookmark_client_factory.h"
22 #include "chrome/browser/browser_process.h" 21 #include "chrome/browser/browser_process.h"
23 #include "chrome/browser/devtools/devtools_window.h" 22 #include "chrome/browser/devtools/devtools_window.h"
24 #include "chrome/browser/extensions/extension_commands_global_registry.h" 23 #include "chrome/browser/extensions/extension_commands_global_registry.h"
25 #include "chrome/browser/fullscreen.h" 24 #include "chrome/browser/fullscreen.h"
26 #include "chrome/browser/profiles/avatar_menu.h" 25 #include "chrome/browser/profiles/avatar_menu.h"
27 #include "chrome/browser/profiles/profile.h" 26 #include "chrome/browser/profiles/profile.h"
28 #include "chrome/browser/profiles/profile_info_cache.h" 27 #include "chrome/browser/profiles/profile_info_cache.h"
29 #include "chrome/browser/profiles/profile_manager.h" 28 #include "chrome/browser/profiles/profile_manager.h"
30 #include "chrome/browser/profiles/profiles_state.h" 29 #include "chrome/browser/profiles/profiles_state.h"
31 #include "chrome/browser/themes/theme_service.h" 30 #include "chrome/browser/themes/theme_service.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 #include "chrome/browser/ui/toolbar/encoding_menu_controller.h" 76 #include "chrome/browser/ui/toolbar/encoding_menu_controller.h"
78 #include "chrome/browser/ui/translate/translate_bubble_model_impl.h" 77 #include "chrome/browser/ui/translate/translate_bubble_model_impl.h"
79 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h" 78 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h"
80 #include "chrome/browser/ui/window_sizer/window_sizer.h" 79 #include "chrome/browser/ui/window_sizer/window_sizer.h"
81 #include "chrome/common/chrome_switches.h" 80 #include "chrome/common/chrome_switches.h"
82 #include "chrome/common/extensions/command.h" 81 #include "chrome/common/extensions/command.h"
83 #include "chrome/common/url_constants.h" 82 #include "chrome/common/url_constants.h"
84 #include "chrome/grit/generated_resources.h" 83 #include "chrome/grit/generated_resources.h"
85 #include "chrome/grit/locale_settings.h" 84 #include "chrome/grit/locale_settings.h"
86 #include "components/bookmarks/browser/bookmark_model.h" 85 #include "components/bookmarks/browser/bookmark_model.h"
86 #include "components/bookmarks/managed/managed_bookmark_service.h"
87 #include "components/signin/core/common/profile_management_switches.h" 87 #include "components/signin/core/common/profile_management_switches.h"
88 #include "components/translate/core/browser/translate_manager.h" 88 #include "components/translate/core/browser/translate_manager.h"
89 #include "components/translate/core/browser/translate_ui_delegate.h" 89 #include "components/translate/core/browser/translate_ui_delegate.h"
90 #include "components/web_modal/popup_manager.h" 90 #include "components/web_modal/popup_manager.h"
91 #include "components/web_modal/web_contents_modal_dialog_manager.h" 91 #include "components/web_modal/web_contents_modal_dialog_manager.h"
92 #include "content/public/browser/render_view_host.h" 92 #include "content/public/browser/render_view_host.h"
93 #include "content/public/browser/render_widget_host_view.h" 93 #include "content/public/browser/render_widget_host_view.h"
94 #include "content/public/browser/web_contents.h" 94 #include "content/public/browser/web_contents.h"
95 #import "ui/base/cocoa/cocoa_base_utils.h" 95 #import "ui/base/cocoa/cocoa_base_utils.h"
96 #import "ui/base/cocoa/nsview_additions.h" 96 #import "ui/base/cocoa/nsview_additions.h"
(...skipping 1668 matching lines...) Expand 10 before | Expand all | Expand 10 after
1765 - (NSPoint)bookmarkBubblePoint { 1765 - (NSPoint)bookmarkBubblePoint {
1766 return [toolbarController_ bookmarkBubblePoint]; 1766 return [toolbarController_ bookmarkBubblePoint];
1767 } 1767 }
1768 1768
1769 // Show the bookmark bubble (e.g. user just clicked on the STAR). 1769 // Show the bookmark bubble (e.g. user just clicked on the STAR).
1770 - (void)showBookmarkBubbleForURL:(const GURL&)url 1770 - (void)showBookmarkBubbleForURL:(const GURL&)url
1771 alreadyBookmarked:(BOOL)alreadyMarked { 1771 alreadyBookmarked:(BOOL)alreadyMarked {
1772 if (!bookmarkBubbleController_) { 1772 if (!bookmarkBubbleController_) {
1773 BookmarkModel* model = 1773 BookmarkModel* model =
1774 BookmarkModelFactory::GetForProfile(browser_->profile()); 1774 BookmarkModelFactory::GetForProfile(browser_->profile());
1775 ChromeBookmarkClient* client = 1775 bookmarks::ManagedBookmarkService* managed =
1776 ChromeBookmarkClientFactory::GetForProfile(browser_->profile()); 1776 ManagedBookmarkServiceFactory::GetForProfile(browser_->profile());
1777 const BookmarkNode* node = model->GetMostRecentlyAddedUserNodeForURL(url); 1777 const BookmarkNode* node = model->GetMostRecentlyAddedUserNodeForURL(url);
1778 bookmarkBubbleController_ = 1778 bookmarkBubbleController_ =
1779 [[BookmarkBubbleController alloc] initWithParentWindow:[self window] 1779 [[BookmarkBubbleController alloc] initWithParentWindow:[self window]
1780 client:client 1780 managed:managed
1781 model:model 1781 model:model
1782 node:node 1782 node:node
1783 alreadyBookmarked:alreadyMarked]; 1783 alreadyBookmarked:alreadyMarked];
1784 [bookmarkBubbleController_ showWindow:self]; 1784 [bookmarkBubbleController_ showWindow:self];
1785 NSNotificationCenter* center = [NSNotificationCenter defaultCenter]; 1785 NSNotificationCenter* center = [NSNotificationCenter defaultCenter];
1786 [center addObserver:self 1786 [center addObserver:self
1787 selector:@selector(bookmarkBubbleWindowWillClose:) 1787 selector:@selector(bookmarkBubbleWindowWillClose:)
1788 name:NSWindowWillCloseNotification 1788 name:NSWindowWillCloseNotification
1789 object:[bookmarkBubbleController_ window]]; 1789 object:[bookmarkBubbleController_ window]];
1790 } 1790 }
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
2257 2257
2258 - (BOOL)supportsBookmarkBar { 2258 - (BOOL)supportsBookmarkBar {
2259 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; 2259 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR];
2260 } 2260 }
2261 2261
2262 - (BOOL)isTabbedWindow { 2262 - (BOOL)isTabbedWindow {
2263 return browser_->is_type_tabbed(); 2263 return browser_->is_type_tabbed();
2264 } 2264 }
2265 2265
2266 @end // @implementation BrowserWindowController(WindowType) 2266 @end // @implementation BrowserWindowController(WindowType)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698