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 #ifndef CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_COCOA_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_COCOA_H_ |
6 #define CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_COCOA_H_ | 6 #define CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_COCOA_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/scoped_nsobject.h" | 9 #include "base/scoped_nsobject.h" |
10 #include "base/task.h" | 10 #include "base/task.h" |
11 #include "chrome/browser/browser_window.h" | 11 #include "chrome/browser/browser_window.h" |
12 #include "chrome/browser/bookmarks/bookmark_model.h" | 12 #include "chrome/browser/bookmarks/bookmark_model.h" |
13 #include "chrome/common/notification_registrar.h" | 13 #include "chrome/common/notification_registrar.h" |
14 | 14 |
15 class Browser; | 15 class Browser; |
16 @class BrowserWindowController; | 16 @class BrowserWindowController; |
17 @class FindBarCocoaController; | 17 @class FindBarCocoaController; |
18 @class NSEvent; | 18 @class NSEvent; |
19 @class NSMenu; | 19 @class NSMenu; |
20 @class NSWindow; | 20 @class NSWindow; |
| 21 struct SidebarChangedDetails; |
21 | 22 |
22 // An implementation of BrowserWindow for Cocoa. Bridges between C++ and | 23 // An implementation of BrowserWindow for Cocoa. Bridges between C++ and |
23 // the Cocoa NSWindow. Cross-platform code will interact with this object when | 24 // the Cocoa NSWindow. Cross-platform code will interact with this object when |
24 // it needs to manipulate the window. | 25 // it needs to manipulate the window. |
25 | 26 |
26 class BrowserWindowCocoa : public BrowserWindow, | 27 class BrowserWindowCocoa : public BrowserWindow, |
27 public NotificationObserver { | 28 public NotificationObserver { |
28 public: | 29 public: |
29 BrowserWindowCocoa(Browser* browser, | 30 BrowserWindowCocoa(Browser* browser, |
30 BrowserWindowController* controller, | 31 BrowserWindowController* controller, |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 // Returns the cocoa-world BrowserWindowController | 126 // Returns the cocoa-world BrowserWindowController |
126 BrowserWindowController* cocoa_controller() { return controller_; } | 127 BrowserWindowController* cocoa_controller() { return controller_; } |
127 | 128 |
128 protected: | 129 protected: |
129 virtual void DestroyBrowser(); | 130 virtual void DestroyBrowser(); |
130 | 131 |
131 private: | 132 private: |
132 int GetCommandId(const NativeWebKeyboardEvent& event); | 133 int GetCommandId(const NativeWebKeyboardEvent& event); |
133 bool HandleKeyboardEventInternal(NSEvent* event); | 134 bool HandleKeyboardEventInternal(NSEvent* event); |
134 NSWindow* window() const; // Accessor for the (current) |NSWindow|. | 135 NSWindow* window() const; // Accessor for the (current) |NSWindow|. |
135 void UpdateSidebarForContents(TabContents* tab_contents); | 136 void UpdateSidebar(SidebarChangedDetails* details); |
136 | 137 |
137 NotificationRegistrar registrar_; | 138 NotificationRegistrar registrar_; |
138 Browser* browser_; // weak, owned by controller | 139 Browser* browser_; // weak, owned by controller |
139 BrowserWindowController* controller_; // weak, owns us | 140 BrowserWindowController* controller_; // weak, owns us |
140 ScopedRunnableMethodFactory<Browser> confirm_close_factory_; | 141 ScopedRunnableMethodFactory<Browser> confirm_close_factory_; |
141 scoped_nsobject<NSString> pending_window_title_; | 142 scoped_nsobject<NSString> pending_window_title_; |
142 }; | 143 }; |
143 | 144 |
144 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_COCOA_H_ | 145 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_COCOA_H_ |
OLD | NEW |