OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 10 matching lines...) Expand all Loading... |
21 #include "chrome/browser/profiles/profile.h" | 21 #include "chrome/browser/profiles/profile.h" |
22 #include "chrome/browser/profiles/profile_info_cache.h" | 22 #include "chrome/browser/profiles/profile_info_cache.h" |
23 #include "chrome/browser/profiles/profile_manager.h" | 23 #include "chrome/browser/profiles/profile_manager.h" |
24 #include "chrome/browser/sync/profile_sync_service.h" | 24 #include "chrome/browser/sync/profile_sync_service.h" |
25 #include "chrome/browser/sync/sync_ui_util_mac.h" | 25 #include "chrome/browser/sync/sync_ui_util_mac.h" |
26 #include "chrome/browser/themes/theme_service.h" | 26 #include "chrome/browser/themes/theme_service.h" |
27 #include "chrome/browser/themes/theme_service_factory.h" | 27 #include "chrome/browser/themes/theme_service_factory.h" |
28 #include "chrome/browser/ui/browser.h" | 28 #include "chrome/browser/ui/browser.h" |
29 #include "chrome/browser/ui/browser_command_controller.h" | 29 #include "chrome/browser/ui/browser_command_controller.h" |
30 #include "chrome/browser/ui/browser_commands.h" | 30 #include "chrome/browser/ui/browser_commands.h" |
| 31 #include "chrome/browser/ui/browser_instant_controller.h" |
31 #include "chrome/browser/ui/browser_list.h" | 32 #include "chrome/browser/ui/browser_list.h" |
32 #include "chrome/browser/ui/browser_tabstrip.h" | 33 #include "chrome/browser/ui/browser_tabstrip.h" |
33 #include "chrome/browser/ui/browser_window_state.h" | 34 #include "chrome/browser/ui/browser_window_state.h" |
34 #import "chrome/browser/ui/cocoa/background_gradient_view.h" | 35 #import "chrome/browser/ui/cocoa/background_gradient_view.h" |
35 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h" | 36 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h" |
36 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_editor_controller.h" | 37 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_editor_controller.h" |
37 #import "chrome/browser/ui/cocoa/browser/avatar_button_controller.h" | 38 #import "chrome/browser/ui/cocoa/browser/avatar_button_controller.h" |
38 #import "chrome/browser/ui/cocoa/browser_window_cocoa.h" | 39 #import "chrome/browser/ui/cocoa/browser_window_cocoa.h" |
39 #import "chrome/browser/ui/cocoa/browser_window_controller_private.h" | 40 #import "chrome/browser/ui/cocoa/browser_window_controller_private.h" |
40 #import "chrome/browser/ui/cocoa/browser_window_utils.h" | 41 #import "chrome/browser/ui/cocoa/browser_window_utils.h" |
(...skipping 1867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1908 // TODO(rohitrao): Revisit whether or not this method should be called when | 1909 // TODO(rohitrao): Revisit whether or not this method should be called when |
1909 // instant isn't showing. | 1910 // instant isn't showing. |
1910 if (![previewableContentsController_ isShowingPreview]) | 1911 if (![previewableContentsController_ isShowingPreview]) |
1911 return; | 1912 return; |
1912 | 1913 |
1913 [previewableContentsController_ hidePreview]; | 1914 [previewableContentsController_ hidePreview]; |
1914 [self updateBookmarkBarVisibilityWithAnimation:NO]; | 1915 [self updateBookmarkBarVisibilityWithAnimation:NO]; |
1915 } | 1916 } |
1916 | 1917 |
1917 - (void)commitInstant { | 1918 - (void)commitInstant { |
1918 InstantController* instant = browser_->instant(); | 1919 InstantController* instant = browser_->instant_controller()->instant(); |
1919 if (instant) | 1920 if (instant) |
1920 instant->CommitIfCurrent(); | 1921 instant->CommitIfCurrent(); |
1921 } | 1922 } |
1922 | 1923 |
1923 | 1924 |
1924 - (NSRect)instantFrame { | 1925 - (NSRect)instantFrame { |
1925 // The view's bounds are in its own coordinate system. Convert that to the | 1926 // The view's bounds are in its own coordinate system. Convert that to the |
1926 // window base coordinate system, then translate it into the screen's | 1927 // window base coordinate system, then translate it into the screen's |
1927 // coordinate system. | 1928 // coordinate system. |
1928 NSView* view = [previewableContentsController_ view]; | 1929 NSView* view = [previewableContentsController_ view]; |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2217 | 2218 |
2218 - (BOOL)supportsBookmarkBar { | 2219 - (BOOL)supportsBookmarkBar { |
2219 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; | 2220 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; |
2220 } | 2221 } |
2221 | 2222 |
2222 - (BOOL)isTabbedWindow { | 2223 - (BOOL)isTabbedWindow { |
2223 return browser_->is_type_tabbed(); | 2224 return browser_->is_type_tabbed(); |
2224 } | 2225 } |
2225 | 2226 |
2226 @end // @implementation BrowserWindowController(WindowType) | 2227 @end // @implementation BrowserWindowController(WindowType) |
OLD | NEW |