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_PANELS_PANEL_H_ | 5 #ifndef CHROME_BROWSER_UI_PANELS_PANEL_H_ |
6 #define CHROME_BROWSER_UI_PANELS_PANEL_H_ | 6 #define CHROME_BROWSER_UI_PANELS_PANEL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/string16.h" | 12 #include "base/string16.h" |
13 #include "chrome/browser/command_updater.h" | 13 #include "chrome/browser/command_updater.h" |
14 #include "chrome/browser/sessions/session_id.h" | 14 #include "chrome/browser/sessions/session_id.h" |
15 #include "chrome/browser/ui/base_window.h" | 15 #include "chrome/browser/ui/base_window.h" |
16 #include "chrome/browser/ui/panels/panel_constants.h" | 16 #include "chrome/browser/ui/panels/panel_constants.h" |
17 #include "content/public/browser/notification_observer.h" | 17 #include "content/public/browser/notification_observer.h" |
18 #include "content/public/browser/notification_registrar.h" | 18 #include "content/public/browser/notification_registrar.h" |
19 #include "ui/gfx/rect.h" | 19 #include "ui/gfx/rect.h" |
20 | 20 |
21 class Browser; | 21 class Browser; |
22 class BrowserWindow; | 22 class BrowserWindow; |
23 class GURL; | 23 class GURL; |
24 class NativePanel; | 24 class NativePanel; |
25 class PanelHost; | 25 class PanelHost; |
26 class PanelManager; | 26 class PanelManager; |
27 class PanelStrip; | 27 class PanelStrip; |
28 class Profile; | 28 class Profile; |
29 class SkBitmap; | |
30 | 29 |
31 namespace content { | 30 namespace content { |
32 class WebContents; | 31 class WebContents; |
33 struct NativeWebKeyboardEvent; | 32 struct NativeWebKeyboardEvent; |
34 } | 33 } |
35 | 34 |
36 namespace extensions { | 35 namespace extensions { |
37 class WindowController; | 36 class WindowController; |
38 } | 37 } |
39 | 38 |
| 39 namespace gfx { |
| 40 class Image; |
| 41 } |
| 42 |
40 // A platform independent implementation of BaseWindow for Panels. | 43 // A platform independent implementation of BaseWindow for Panels. |
41 // This class gets the first crack at all the BaseWindow calls for Panels and | 44 // This class gets the first crack at all the BaseWindow calls for Panels and |
42 // does one or more of the following: | 45 // does one or more of the following: |
43 // - Do nothing. The function is not relevant to Panels. | 46 // - Do nothing. The function is not relevant to Panels. |
44 // - Do Panel specific platform independent processing and then invoke the | 47 // - Do Panel specific platform independent processing and then invoke the |
45 // function on the platform specific member. For example, restrict panel | 48 // function on the platform specific member. For example, restrict panel |
46 // size to certain limits. | 49 // size to certain limits. |
47 // - Invoke an appropriate PanelManager function to do stuff that might affect | 50 // - Invoke an appropriate PanelManager function to do stuff that might affect |
48 // other Panels. For example deleting a panel would rearrange other panels. | 51 // other Panels. For example deleting a panel would rearrange other panels. |
49 class Panel : public BaseWindow, | 52 class Panel : public BaseWindow, |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 virtual void OnWindowClosing(); | 288 virtual void OnWindowClosing(); |
286 | 289 |
287 // Executes a command if it's enabled. | 290 // Executes a command if it's enabled. |
288 // Returns true if the command is executed. | 291 // Returns true if the command is executed. |
289 bool ExecuteCommandIfEnabled(int id); | 292 bool ExecuteCommandIfEnabled(int id); |
290 | 293 |
291 // Gets the title of the window from the web contents. | 294 // Gets the title of the window from the web contents. |
292 string16 GetWindowTitle() const; | 295 string16 GetWindowTitle() const; |
293 | 296 |
294 // Gets the Favicon of the web contents. | 297 // Gets the Favicon of the web contents. |
295 virtual SkBitmap GetCurrentPageIcon() const; | 298 virtual gfx::Image GetCurrentPageIcon() const; |
296 | 299 |
297 // Updates the title bar to display the current title and icon. | 300 // Updates the title bar to display the current title and icon. |
298 void UpdateTitleBar(); | 301 void UpdateTitleBar(); |
299 | 302 |
300 // Updates UI to reflect change in loading state. | 303 // Updates UI to reflect change in loading state. |
301 void LoadingStateChanged(bool is_loading); | 304 void LoadingStateChanged(bool is_loading); |
302 | 305 |
303 // Updates UI to reflect that the web cotents receives the focus. | 306 // Updates UI to reflect that the web cotents receives the focus. |
304 void WebContentsFocused(content::WebContents* contents); | 307 void WebContentsFocused(content::WebContents* contents); |
305 | 308 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 | 384 |
382 content::NotificationRegistrar registrar_; | 385 content::NotificationRegistrar registrar_; |
383 const SessionID session_id_; | 386 const SessionID session_id_; |
384 scoped_ptr<extensions::WindowController> extension_window_controller_; | 387 scoped_ptr<extensions::WindowController> extension_window_controller_; |
385 scoped_ptr<PanelHost> panel_host_; | 388 scoped_ptr<PanelHost> panel_host_; |
386 | 389 |
387 DISALLOW_COPY_AND_ASSIGN(Panel); | 390 DISALLOW_COPY_AND_ASSIGN(Panel); |
388 }; | 391 }; |
389 | 392 |
390 #endif // CHROME_BROWSER_UI_PANELS_PANEL_H_ | 393 #endif // CHROME_BROWSER_UI_PANELS_PANEL_H_ |
OLD | NEW |