Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: content/shell/shell.h

Issue 10831056: Port the render_view_host_manager_browsertest.cc to content_browsertests. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 8
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/callback_forward.h"
12 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
13 #include "base/string_piece.h" 14 #include "base/string_piece.h"
14 #include "content/public/browser/notification_registrar.h" 15 #include "content/public/browser/notification_registrar.h"
15 #include "content/public/browser/notification_observer.h" 16 #include "content/public/browser/notification_observer.h"
16 #include "content/public/browser/web_contents_delegate.h" 17 #include "content/public/browser/web_contents_delegate.h"
17 #include "ipc/ipc_channel.h" 18 #include "ipc/ipc_channel.h"
18 #include "ui/gfx/native_widget_types.h" 19 #include "ui/gfx/native_widget_types.h"
19 20
20 #if defined(TOOLKIT_GTK) 21 #if defined(TOOLKIT_GTK)
21 #include <gtk/gtk.h> 22 #include <gtk/gtk.h>
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 66
66 // Returns the currently open windows. 67 // Returns the currently open windows.
67 static std::vector<Shell*>& windows() { return windows_; } 68 static std::vector<Shell*>& windows() { return windows_; }
68 69
69 // Closes all windows and returns. This runs a message loop. 70 // Closes all windows and returns. This runs a message loop.
70 static void CloseAllWindows(); 71 static void CloseAllWindows();
71 72
72 // Closes all windows and exits. 73 // Closes all windows and exits.
73 static void PlatformExit(); 74 static void PlatformExit();
74 75
76 // Used for content_browsertests. Called once.
77 static void SetShellCreatedCallback(
78 base::Callback<void(Shell*)> shell_created_callback);
79
75 WebContents* web_contents() const { return web_contents_.get(); } 80 WebContents* web_contents() const { return web_contents_.get(); }
76 gfx::NativeWindow window() { return window_; } 81 gfx::NativeWindow window() { return window_; }
77 82
78 #if defined(OS_MACOSX) 83 #if defined(OS_MACOSX)
79 // Public to be called by an ObjC bridge object. 84 // Public to be called by an ObjC bridge object.
80 void ActionPerformed(int control); 85 void ActionPerformed(int control);
81 void URLEntered(std::string url_string); 86 void URLEntered(std::string url_string);
82 #elif defined(OS_ANDROID) 87 #elif defined(OS_ANDROID)
83 // Registers the Android Java to native methods. 88 // Registers the Android Java to native methods.
84 static bool Register(JNIEnv* env); 89 static bool Register(JNIEnv* env);
85 #endif 90 #endif
86 91
87 // WebContentsDelegate 92 // WebContentsDelegate
93 virtual WebContents* OpenURLFromTab(WebContents* source,
94 const OpenURLParams& params) OVERRIDE;
88 virtual void LoadingStateChanged(WebContents* source) OVERRIDE; 95 virtual void LoadingStateChanged(WebContents* source) OVERRIDE;
89 #if defined(OS_ANDROID) 96 #if defined(OS_ANDROID)
90 virtual void LoadProgressChanged(double progress) OVERRIDE; 97 virtual void LoadProgressChanged(double progress) OVERRIDE;
91 #endif 98 #endif
99 virtual void CloseContents(WebContents* source) OVERRIDE;
92 virtual void WebContentsCreated(WebContents* source_contents, 100 virtual void WebContentsCreated(WebContents* source_contents,
93 int64 source_frame_id, 101 int64 source_frame_id,
94 const GURL& target_url, 102 const GURL& target_url,
95 WebContents* new_contents) OVERRIDE; 103 WebContents* new_contents) OVERRIDE;
96 virtual void DidNavigateMainFramePostCommit( 104 virtual void DidNavigateMainFramePostCommit(
97 WebContents* web_contents) OVERRIDE; 105 WebContents* web_contents) OVERRIDE;
98 virtual JavaScriptDialogCreator* GetJavaScriptDialogCreator() OVERRIDE; 106 virtual JavaScriptDialogCreator* GetJavaScriptDialogCreator() OVERRIDE;
99 #if defined(OS_MACOSX) 107 #if defined(OS_MACOSX)
100 virtual void HandleKeyboardEvent( 108 virtual void HandleKeyboardEvent(
101 const NativeWebKeyboardEvent& event) OVERRIDE; 109 const NativeWebKeyboardEvent& event) OVERRIDE;
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 int content_width_; 202 int content_width_;
195 int content_height_; 203 int content_height_;
196 #elif defined(OS_ANDROID) 204 #elif defined(OS_ANDROID)
197 base::android::ScopedJavaGlobalRef<jobject> java_object_; 205 base::android::ScopedJavaGlobalRef<jobject> java_object_;
198 #endif 206 #endif
199 207
200 // A container of all the open windows. We use a vector so we can keep track 208 // A container of all the open windows. We use a vector so we can keep track
201 // of ordering. 209 // of ordering.
202 static std::vector<Shell*> windows_; 210 static std::vector<Shell*> windows_;
203 211
212 static base::Callback<void(Shell*)> shell_created_callback_;
213
204 // True if the destructur of Shell should post a quit closure on the current 214 // True if the destructur of Shell should post a quit closure on the current
205 // message loop if the destructed Shell object was the last one. 215 // message loop if the destructed Shell object was the last one.
206 static bool quit_message_loop_; 216 static bool quit_message_loop_;
207 }; 217 };
208 218
209 } // namespace content 219 } // namespace content
210 220
211 #endif // CONTENT_SHELL_SHELL_H_ 221 #endif // CONTENT_SHELL_SHELL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698