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 #ifndef CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_H_ |
7 | 7 |
8 // A class acting as the Objective-C controller for the Browser | 8 // A class acting as the Objective-C controller for the Browser |
9 // object. Handles interactions between Cocoa and the cross-platform | 9 // object. Handles interactions between Cocoa and the cross-platform |
10 // code. Each window has a single toolbar and, by virtue of being a | 10 // code. Each window has a single toolbar and, by virtue of being a |
11 // TabWindowController, a tab strip along the top. | 11 // TabWindowController, a tab strip along the top. |
12 | 12 |
13 #import <Cocoa/Cocoa.h> | 13 #import <Cocoa/Cocoa.h> |
14 | 14 |
15 #include "base/mac/scoped_nsobject.h" | 15 #include "base/mac/scoped_nsobject.h" |
16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
17 #include "chrome/browser/translate/chrome_translate_client.h" | 17 #include "chrome/browser/translate/chrome_translate_client.h" |
18 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h" | 18 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h" |
19 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.h" | 19 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.h" |
20 #import "chrome/browser/ui/cocoa/browser_command_executor.h" | |
21 #import "chrome/browser/ui/cocoa/exclusive_access_bubble_window_controller.h" | 20 #import "chrome/browser/ui/cocoa/exclusive_access_bubble_window_controller.h" |
22 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" | 21 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" |
23 #import "chrome/browser/ui/cocoa/tabs/tab_window_controller.h" | 22 #import "chrome/browser/ui/cocoa/tabs/tab_window_controller.h" |
24 #import "chrome/browser/ui/cocoa/themed_window.h" | 23 #import "chrome/browser/ui/cocoa/themed_window.h" |
25 #import "chrome/browser/ui/cocoa/url_drop_target.h" | 24 #import "chrome/browser/ui/cocoa/url_drop_target.h" |
26 #import "chrome/browser/ui/cocoa/view_resizer.h" | 25 #import "chrome/browser/ui/cocoa/view_resizer.h" |
27 #include "components/translate/core/common/translate_errors.h" | 26 #include "components/translate/core/common/translate_errors.h" |
28 #include "ui/base/accelerators/accelerator_manager.h" | 27 #include "ui/base/accelerators/accelerator_manager.h" |
29 #include "ui/gfx/geometry/rect.h" | 28 #include "ui/gfx/geometry/rect.h" |
30 | 29 |
(...skipping 23 matching lines...) Expand all Loading... |
54 class WebContents; | 53 class WebContents; |
55 } | 54 } |
56 | 55 |
57 namespace extensions { | 56 namespace extensions { |
58 class Command; | 57 class Command; |
59 } | 58 } |
60 | 59 |
61 @interface BrowserWindowController : | 60 @interface BrowserWindowController : |
62 TabWindowController<NSUserInterfaceValidations, | 61 TabWindowController<NSUserInterfaceValidations, |
63 BookmarkBarControllerDelegate, | 62 BookmarkBarControllerDelegate, |
64 BrowserCommandExecutor, | |
65 ViewResizer, | 63 ViewResizer, |
66 TabStripControllerDelegate> { | 64 TabStripControllerDelegate> { |
67 @private | 65 @private |
68 // The ordering of these members is important as it determines the order in | 66 // The ordering of these members is important as it determines the order in |
69 // which they are destroyed. |browser_| needs to be destroyed last as most of | 67 // which they are destroyed. |browser_| needs to be destroyed last as most of |
70 // the other objects hold weak references to it or things it owns | 68 // the other objects hold weak references to it or things it owns |
71 // (tab/toolbar/bookmark models, profiles, etc). | 69 // (tab/toolbar/bookmark models, profiles, etc). |
72 scoped_ptr<Browser> browser_; | 70 scoped_ptr<Browser> browser_; |
73 NSWindow* savedRegularWindow_; | 71 NSWindow* savedRegularWindow_; |
74 scoped_ptr<BrowserWindowCocoa> windowShim_; | 72 scoped_ptr<BrowserWindowCocoa> windowShim_; |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 - (DownloadShelfController*)downloadShelf; | 306 - (DownloadShelfController*)downloadShelf; |
309 | 307 |
310 // Retains the given FindBarCocoaController and adds its view to this | 308 // Retains the given FindBarCocoaController and adds its view to this |
311 // browser window. Must only be called once per | 309 // browser window. Must only be called once per |
312 // BrowserWindowController. | 310 // BrowserWindowController. |
313 - (void)addFindBar:(FindBarCocoaController*)findBarCocoaController; | 311 - (void)addFindBar:(FindBarCocoaController*)findBarCocoaController; |
314 | 312 |
315 // The user changed the theme. | 313 // The user changed the theme. |
316 - (void)userChangedTheme; | 314 - (void)userChangedTheme; |
317 | 315 |
318 // Executes the command in the context of the current browser. | |
319 // |command| is an integer value containing one of the constants defined in the | |
320 // "chrome/app/chrome_command_ids.h" file. | |
321 - (void)executeCommand:(int)command; | |
322 | |
323 // Consults the Command Registry to see if this |event| needs to be handled as | 316 // Consults the Command Registry to see if this |event| needs to be handled as |
324 // an extension command and returns YES if so (NO otherwise). | 317 // an extension command and returns YES if so (NO otherwise). |
325 // Only extensions with the given |priority| are considered. | 318 // Only extensions with the given |priority| are considered. |
326 - (BOOL)handledByExtensionCommand:(NSEvent*)event | 319 - (BOOL)handledByExtensionCommand:(NSEvent*)event |
327 priority:(ui::AcceleratorManager::HandlerPriority)priority; | 320 priority:(ui::AcceleratorManager::HandlerPriority)priority; |
328 | 321 |
329 // Delegate method for the status bubble to query its base frame. | 322 // Delegate method for the status bubble to query its base frame. |
330 - (NSRect)statusBubbleBaseFrame; | 323 - (NSRect)statusBubbleBaseFrame; |
331 | 324 |
332 // Show the bookmark bubble (e.g. user just clicked on the STAR) | 325 // Show the bookmark bubble (e.g. user just clicked on the STAR) |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
608 - (ExclusiveAccessBubbleWindowController*)exclusiveAccessBubbleWindowController; | 601 - (ExclusiveAccessBubbleWindowController*)exclusiveAccessBubbleWindowController; |
609 | 602 |
610 // Gets the rect, in window base coordinates, that the omnibox popup should be | 603 // Gets the rect, in window base coordinates, that the omnibox popup should be |
611 // positioned relative to. | 604 // positioned relative to. |
612 - (NSRect)omniboxPopupAnchorRect; | 605 - (NSRect)omniboxPopupAnchorRect; |
613 | 606 |
614 @end // @interface BrowserWindowController (TestingAPI) | 607 @end // @interface BrowserWindowController (TestingAPI) |
615 | 608 |
616 | 609 |
617 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_H_ | 610 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_H_ |
OLD | NEW |