Chromium Code Reviews| 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 CONTENT_SHELL_SHELL_H_ | 5 #ifndef CONTENT_SHELL_SHELL_H_ |
| 6 #define CONTENT_SHELL_SHELL_H_ | 6 #define CONTENT_SHELL_SHELL_H_ |
| 7 | 7 |
| 8 #pragma once | 8 #pragma once |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/string_piece.h" | 14 #include "base/string_piece.h" |
| 15 #include "content/public/browser/web_contents_delegate.h" | 15 #include "content/public/browser/web_contents_delegate.h" |
| 16 #include "ui/gfx/native_widget_types.h" | 16 #include "ui/gfx/native_widget_types.h" |
| 17 | 17 |
| 18 #if defined(OS_LINUX) | 18 #if defined(OS_LINUX) |
| 19 #include <gtk/gtk.h> | 19 #include <gtk/gtk.h> |
| 20 #include "ui/base/gtk/gtk_signal.h" | 20 #include "ui/base/gtk/gtk_signal.h" |
| 21 | 21 |
| 22 typedef struct _GtkToolItem GtkToolItem; | 22 typedef struct _GtkToolItem GtkToolItem; |
| 23 #endif | 23 #endif |
| 24 | 24 |
| 25 class GURL; | 25 class GURL; |
| 26 class SiteInstance; | |
| 27 class TabContents; | 26 class TabContents; |
| 28 | 27 |
| 29 namespace content { | 28 namespace content { |
| 30 | |
| 31 class BrowserContext; | 29 class BrowserContext; |
| 30 class SiteInstance; | |
| 32 | 31 |
| 33 // This represents one window of the Content Shell, i.e. all the UI including | 32 // This represents one window of the Content Shell, i.e. all the UI including |
| 34 // buttons and url bar, as well as the web content area. | 33 // buttons and url bar, as well as the web content area. |
| 35 class Shell : public WebContentsDelegate { | 34 class Shell : public WebContentsDelegate { |
| 36 public: | 35 public: |
| 37 virtual ~Shell(); | 36 virtual ~Shell(); |
| 38 | 37 |
| 39 void LoadURL(const GURL& url); | 38 void LoadURL(const GURL& url); |
| 40 void GoBackOrForward(int offset); | 39 void GoBackOrForward(int offset); |
| 41 void Reload(); | 40 void Reload(); |
| 42 void Stop(); | 41 void Stop(); |
| 43 void UpdateNavigationControls(); | 42 void UpdateNavigationControls(); |
| 44 | 43 |
| 45 // Do one time initialization at application startup. | 44 // Do one time initialization at application startup. |
| 46 static void PlatformInitialize(); | 45 static void PlatformInitialize(); |
| 47 | 46 |
| 48 // This is called indirectly by the modules that need access resources. | 47 // This is called indirectly by the modules that need access resources. |
| 49 static base::StringPiece PlatformResourceProvider(int key); | 48 static base::StringPiece PlatformResourceProvider(int key); |
| 50 | 49 |
| 51 static Shell* CreateNewWindow(content::BrowserContext* browser_context, | 50 static Shell* CreateNewWindow(content::BrowserContext* browser_context, |
| 52 const GURL& url, | 51 const GURL& url, |
| 53 SiteInstance* site_instance, | 52 content::SiteInstance* site_instance, |
|
jam
2012/01/24 03:29:33
ditto
ananta
2012/01/24 23:46:26
Done.
| |
| 54 int routing_id, | 53 int routing_id, |
| 55 TabContents* base_tab_contents); | 54 TabContents* base_tab_contents); |
| 56 | 55 |
| 57 // Closes all windows and exits. | 56 // Closes all windows and exits. |
| 58 static void PlatformExit(); | 57 static void PlatformExit(); |
| 59 | 58 |
| 60 TabContents* tab_contents() const { return tab_contents_.get(); } | 59 TabContents* tab_contents() const { return tab_contents_.get(); } |
| 61 | 60 |
| 62 #if defined(OS_MACOSX) | 61 #if defined(OS_MACOSX) |
| 63 // Public to be called by an ObjC bridge object. | 62 // Public to be called by an ObjC bridge object. |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 150 #endif | 149 #endif |
| 151 | 150 |
| 152 // A container of all the open windows. We use a vector so we can keep track | 151 // A container of all the open windows. We use a vector so we can keep track |
| 153 // of ordering. | 152 // of ordering. |
| 154 static std::vector<Shell*> windows_; | 153 static std::vector<Shell*> windows_; |
| 155 }; | 154 }; |
| 156 | 155 |
| 157 } // namespace content | 156 } // namespace content |
| 158 | 157 |
| 159 #endif // CONTENT_SHELL_SHELL_H_ | 158 #endif // CONTENT_SHELL_SHELL_H_ |
| OLD | NEW |