| 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 ExtensionWindowController; | |
| 24 class GURL; | 23 class GURL; |
| 25 class NativePanel; | 24 class NativePanel; |
| 26 class PanelHost; | 25 class PanelHost; |
| 27 class PanelManager; | 26 class PanelManager; |
| 28 class PanelStrip; | 27 class PanelStrip; |
| 29 class Profile; | 28 class Profile; |
| 30 class SkBitmap; | 29 class SkBitmap; |
| 31 | 30 |
| 32 namespace content { | 31 namespace content { |
| 33 class WebContents; | 32 class WebContents; |
| 34 struct NativeWebKeyboardEvent; | 33 struct NativeWebKeyboardEvent; |
| 35 } | 34 } |
| 36 | 35 |
| 36 namespace extensions { |
| 37 class WindowController; |
| 38 } |
| 39 |
| 37 // A platform independent implementation of BaseWindow for Panels. | 40 // A platform independent implementation of BaseWindow for Panels. |
| 38 // This class gets the first crack at all the BaseWindow calls for Panels and | 41 // This class gets the first crack at all the BaseWindow calls for Panels and |
| 39 // does one or more of the following: | 42 // does one or more of the following: |
| 40 // - Do nothing. The function is not relevant to Panels. | 43 // - Do nothing. The function is not relevant to Panels. |
| 41 // - Do Panel specific platform independent processing and then invoke the | 44 // - Do Panel specific platform independent processing and then invoke the |
| 42 // function on the platform specific member. For example, restrict panel | 45 // function on the platform specific member. For example, restrict panel |
| 43 // size to certain limits. | 46 // size to certain limits. |
| 44 // - Invoke an appropriate PanelManager function to do stuff that might affect | 47 // - Invoke an appropriate PanelManager function to do stuff that might affect |
| 45 // other Panels. For example deleting a panel would rearrange other panels. | 48 // other Panels. For example deleting a panel would rearrange other panels. |
| 46 class Panel : public BaseWindow, | 49 class Panel : public BaseWindow, |
| (...skipping 20 matching lines...) Expand all Loading... |
| 67 USE_SYSTEM_ATTENTION = 0x02 | 70 USE_SYSTEM_ATTENTION = 0x02 |
| 68 }; | 71 }; |
| 69 | 72 |
| 70 virtual ~Panel(); | 73 virtual ~Panel(); |
| 71 | 74 |
| 72 // Returns the PanelManager associated with this panel. | 75 // Returns the PanelManager associated with this panel. |
| 73 PanelManager* manager() const; | 76 PanelManager* manager() const; |
| 74 | 77 |
| 75 const std::string& app_name() const { return app_name_; } | 78 const std::string& app_name() const { return app_name_; } |
| 76 const SessionID& session_id() const { return session_id_; } | 79 const SessionID& session_id() const { return session_id_; } |
| 77 ExtensionWindowController* extension_window_controller() const { | 80 extensions::WindowController* extension_window_controller() const { |
| 78 return extension_window_controller_.get(); | 81 return extension_window_controller_.get(); |
| 79 } | 82 } |
| 80 const std::string extension_id() const; | 83 const std::string extension_id() const; |
| 81 | 84 |
| 82 virtual CommandUpdater* command_updater(); | 85 virtual CommandUpdater* command_updater(); |
| 83 virtual Profile* profile() const; | 86 virtual Profile* profile() const; |
| 84 | 87 |
| 85 // Returns web contents of the panel, if any. There may be none if web | 88 // Returns web contents of the panel, if any. There may be none if web |
| 86 // contents have not been added to the panel yet. | 89 // contents have not been added to the panel yet. |
| 87 virtual content::WebContents* GetWebContents() const; | 90 virtual content::WebContents* GetWebContents() const; |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 | 371 |
| 369 AttentionMode attention_mode_; | 372 AttentionMode attention_mode_; |
| 370 | 373 |
| 371 ExpansionState expansion_state_; | 374 ExpansionState expansion_state_; |
| 372 | 375 |
| 373 // The CommandUpdater manages the window commands. | 376 // The CommandUpdater manages the window commands. |
| 374 CommandUpdater command_updater_; | 377 CommandUpdater command_updater_; |
| 375 | 378 |
| 376 content::NotificationRegistrar registrar_; | 379 content::NotificationRegistrar registrar_; |
| 377 const SessionID session_id_; | 380 const SessionID session_id_; |
| 378 scoped_ptr<ExtensionWindowController> extension_window_controller_; | 381 scoped_ptr<extensions::WindowController> extension_window_controller_; |
| 379 scoped_ptr<PanelHost> panel_host_; | 382 scoped_ptr<PanelHost> panel_host_; |
| 380 | 383 |
| 381 DISALLOW_COPY_AND_ASSIGN(Panel); | 384 DISALLOW_COPY_AND_ASSIGN(Panel); |
| 382 }; | 385 }; |
| 383 | 386 |
| 384 #endif // CHROME_BROWSER_UI_PANELS_PANEL_H_ | 387 #endif // CHROME_BROWSER_UI_PANELS_PANEL_H_ |
| OLD | NEW |