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

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

Issue 2431753002: Mus experiment in content shell on Android.
Patch Set: Addressed comments, fixed browser tests and deps. Created 4 years, 2 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef CONTENT_SHELL_BROWSER_SHELL_H_ 4 #ifndef CONTENT_SHELL_BROWSER_SHELL_H_
5 #define CONTENT_SHELL_BROWSER_SHELL_H_ 5 #define CONTENT_SHELL_BROWSER_SHELL_H_
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/callback_forward.h" 12 #include "base/callback_forward.h"
13 #include "base/strings/string_piece.h" 13 #include "base/strings/string_piece.h"
14 #include "build/build_config.h" 14 #include "build/build_config.h"
15 #include "content/public/browser/web_contents_delegate.h" 15 #include "content/public/browser/web_contents_delegate.h"
16 #include "content/public/browser/web_contents_observer.h" 16 #include "content/public/browser/web_contents_observer.h"
17 #include "ipc/ipc_channel.h" 17 #include "ipc/ipc_channel.h"
18 #include "ui/gfx/geometry/size.h" 18 #include "ui/gfx/geometry/size.h"
19 #include "ui/gfx/native_widget_types.h" 19 #include "ui/gfx/native_widget_types.h"
20 20
21 #if defined(OS_ANDROID) 21 #if defined(OS_ANDROID)
22 #include "base/android/scoped_java_ref.h" 22 #include "base/android/scoped_java_ref.h"
23 #include "services/ui/demo/mus_demo.h" // nogncheck
23 #elif defined(USE_AURA) 24 #elif defined(USE_AURA)
24 #if defined(OS_CHROMEOS) 25 #if defined(OS_CHROMEOS)
25 26
26 namespace display { 27 namespace display {
27 class Screen; 28 class Screen;
28 } 29 }
29 30
30 namespace wm { 31 namespace wm {
31 class WMTestHelper; 32 class WMTestHelper;
32 } 33 }
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 WebContents* web_contents() const { return web_contents_.get(); } 107 WebContents* web_contents() const { return web_contents_.get(); }
107 gfx::NativeWindow window() { return window_; } 108 gfx::NativeWindow window() { return window_; }
108 109
109 #if defined(OS_MACOSX) 110 #if defined(OS_MACOSX)
110 // Public to be called by an ObjC bridge object. 111 // Public to be called by an ObjC bridge object.
111 void ActionPerformed(int control); 112 void ActionPerformed(int control);
112 void URLEntered(const std::string& url_string); 113 void URLEntered(const std::string& url_string);
113 #elif defined(OS_ANDROID) 114 #elif defined(OS_ANDROID)
114 // Registers the Android Java to native methods. 115 // Registers the Android Java to native methods.
115 static bool Register(JNIEnv* env); 116 static bool Register(JNIEnv* env);
117 void StartMusDemo(JNIEnv* env,
118 const base::android::JavaParamRef<jobject>& caller);
116 #endif 119 #endif
117 120
118 // WebContentsDelegate 121 // WebContentsDelegate
119 WebContents* OpenURLFromTab(WebContents* source, 122 WebContents* OpenURLFromTab(WebContents* source,
120 const OpenURLParams& params) override; 123 const OpenURLParams& params) override;
121 void AddNewContents(WebContents* source, 124 void AddNewContents(WebContents* source,
122 WebContents* new_contents, 125 WebContents* new_contents,
123 WindowOpenDisposition disposition, 126 WindowOpenDisposition disposition,
124 const gfx::Rect& initial_rect, 127 const gfx::Rect& initial_rect,
125 bool user_gesture, 128 bool user_gesture,
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 243
241 gfx::NativeWindow window_; 244 gfx::NativeWindow window_;
242 #if defined(OS_MACOSX) 245 #if defined(OS_MACOSX)
243 NSTextField* url_edit_view_; 246 NSTextField* url_edit_view_;
244 #endif 247 #endif
245 248
246 gfx::Size content_size_; 249 gfx::Size content_size_;
247 250
248 #if defined(OS_ANDROID) 251 #if defined(OS_ANDROID)
249 base::android::ScopedJavaGlobalRef<jobject> java_object_; 252 base::android::ScopedJavaGlobalRef<jobject> java_object_;
253 std::unique_ptr<ui::demo::MusDemo> mus_demo_;
250 #elif defined(USE_AURA) 254 #elif defined(USE_AURA)
251 #if defined(OS_CHROMEOS) 255 #if defined(OS_CHROMEOS)
252 static wm::WMTestHelper* wm_test_helper_; 256 static wm::WMTestHelper* wm_test_helper_;
253 static display::Screen* test_screen_; 257 static display::Screen* test_screen_;
254 #endif 258 #endif
255 #if defined(TOOLKIT_VIEWS) 259 #if defined(TOOLKIT_VIEWS)
256 static views::ViewsDelegate* views_delegate_; 260 static views::ViewsDelegate* views_delegate_;
257 261
258 views::Widget* window_widget_; 262 views::Widget* window_widget_;
259 #endif // defined(TOOLKIT_VIEWS) 263 #endif // defined(TOOLKIT_VIEWS)
260 static ShellPlatformDataAura* platform_; 264 static ShellPlatformDataAura* platform_;
261 #endif // defined(USE_AURA) 265 #endif // defined(USE_AURA)
262 266
263 bool headless_; 267 bool headless_;
264 268
265 // A container of all the open windows. We use a vector so we can keep track 269 // A container of all the open windows. We use a vector so we can keep track
266 // of ordering. 270 // of ordering.
267 static std::vector<Shell*> windows_; 271 static std::vector<Shell*> windows_;
268 272
269 static base::Callback<void(Shell*)> shell_created_callback_; 273 static base::Callback<void(Shell*)> shell_created_callback_;
270 274
271 // True if the destructur of Shell should post a quit closure on the current 275 // True if the destructur of Shell should post a quit closure on the current
272 // message loop if the destructed Shell object was the last one. 276 // message loop if the destructed Shell object was the last one.
273 static bool quit_message_loop_; 277 static bool quit_message_loop_;
274 }; 278 };
275 279
276 } // namespace content 280 } // namespace content
277 281
278 #endif // CONTENT_SHELL_BROWSER_SHELL_H_ 282 #endif // CONTENT_SHELL_BROWSER_SHELL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698