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" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 virtual void Cut(); | 106 virtual void Cut(); |
107 virtual void Copy(); | 107 virtual void Copy(); |
108 virtual void Paste(); | 108 virtual void Paste(); |
109 virtual void ToggleTabStripMode(); | 109 virtual void ToggleTabStripMode(); |
110 virtual void OpenTabpose(); | 110 virtual void OpenTabpose(); |
111 virtual void PrepareForInstant(); | 111 virtual void PrepareForInstant(); |
112 virtual void ShowInstant(TabContents* preview_contents); | 112 virtual void ShowInstant(TabContents* preview_contents); |
113 virtual void HideInstant(bool instant_is_active); | 113 virtual void HideInstant(bool instant_is_active); |
114 virtual gfx::Rect GetInstantBounds(); | 114 virtual gfx::Rect GetInstantBounds(); |
115 | 115 |
116 virtual gfx::Rect GrabWindowSnapshot(std::vector<unsigned char>* | |
117 png_representation); | |
118 | |
119 // Overridden from NotificationObserver | 116 // Overridden from NotificationObserver |
120 virtual void Observe(NotificationType type, | 117 virtual void Observe(NotificationType type, |
121 const NotificationSource& source, | 118 const NotificationSource& source, |
122 const NotificationDetails& details); | 119 const NotificationDetails& details); |
123 | 120 |
124 // Adds the given FindBar cocoa controller to this browser window. | 121 // Adds the given FindBar cocoa controller to this browser window. |
125 void AddFindBar(FindBarCocoaController* find_bar_cocoa_controller); | 122 void AddFindBar(FindBarCocoaController* find_bar_cocoa_controller); |
126 | 123 |
127 // Returns the cocoa-world BrowserWindowController | 124 // Returns the cocoa-world BrowserWindowController |
128 BrowserWindowController* cocoa_controller() { return controller_; } | 125 BrowserWindowController* cocoa_controller() { return controller_; } |
129 | 126 |
130 protected: | 127 protected: |
131 virtual void DestroyBrowser(); | 128 virtual void DestroyBrowser(); |
132 | 129 |
133 private: | 130 private: |
134 int GetCommandId(const NativeWebKeyboardEvent& event); | 131 int GetCommandId(const NativeWebKeyboardEvent& event); |
135 bool HandleKeyboardEventInternal(NSEvent* event); | 132 bool HandleKeyboardEventInternal(NSEvent* event); |
136 NSWindow* window() const; // Accessor for the (current) |NSWindow|. | 133 NSWindow* window() const; // Accessor for the (current) |NSWindow|. |
137 void UpdateSidebarForContents(TabContents* tab_contents); | 134 void UpdateSidebarForContents(TabContents* tab_contents); |
138 | 135 |
139 NotificationRegistrar registrar_; | 136 NotificationRegistrar registrar_; |
140 Browser* browser_; // weak, owned by controller | 137 Browser* browser_; // weak, owned by controller |
141 BrowserWindowController* controller_; // weak, owns us | 138 BrowserWindowController* controller_; // weak, owns us |
142 ScopedRunnableMethodFactory<Browser> confirm_close_factory_; | 139 ScopedRunnableMethodFactory<Browser> confirm_close_factory_; |
143 scoped_nsobject<NSString> pending_window_title_; | 140 scoped_nsobject<NSString> pending_window_title_; |
144 }; | 141 }; |
145 | 142 |
146 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_COCOA_H_ | 143 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_COCOA_H_ |
OLD | NEW |