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

Side by Side Diff: content/shell/browser/shell_android.cc

Issue 2416403002: Reland of Android: support multiple displays on C++ side (Closed)
Patch Set: Update native side only after jni init Created 4 years, 1 month 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 4
5 #include "content/shell/browser/shell.h" 5 #include "content/shell/browser/shell.h"
6 6
7 #include <jni.h> 7 #include <jni.h>
8 8
9 #include "base/android/jni_string.h" 9 #include "base/android/jni_string.h"
10 #include "base/android/scoped_java_ref.h" 10 #include "base/android/scoped_java_ref.h"
11 #include "base/command_line.h" 11 #include "base/command_line.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/strings/string_piece.h" 13 #include "base/strings/string_piece.h"
14 #include "content/public/browser/web_contents.h" 14 #include "content/public/browser/web_contents.h"
15 #include "content/public/common/content_switches.h" 15 #include "content/public/common/content_switches.h"
16 #include "content/shell/android/shell_manager.h" 16 #include "content/shell/android/shell_manager.h"
17 #include "jni/Shell_jni.h" 17 #include "jni/Shell_jni.h"
18 #include "ui/android/screen_android.h"
19 #include "ui/display/screen.h"
18 20
19 using base::android::AttachCurrentThread; 21 using base::android::AttachCurrentThread;
20 using base::android::ConvertUTF8ToJavaString; 22 using base::android::ConvertUTF8ToJavaString;
21 using base::android::JavaParamRef; 23 using base::android::JavaParamRef;
22 using base::android::ScopedJavaLocalRef; 24 using base::android::ScopedJavaLocalRef;
23 25
24 namespace content { 26 namespace content {
25 27
26 void Shell::PlatformInitialize(const gfx::Size& default_window_size) { 28 void Shell::PlatformInitialize(const gfx::Size& default_window_size) {
29 display::Screen::SetScreenInstance(ui::CreateScreenAndroid());
27 } 30 }
28 31
29 void Shell::PlatformExit() { 32 void Shell::PlatformExit() {
30 } 33 }
31 34
32 void Shell::PlatformCleanUp() { 35 void Shell::PlatformCleanUp() {
33 JNIEnv* env = AttachCurrentThread(); 36 JNIEnv* env = AttachCurrentThread();
34 if (java_object_.is_null()) 37 if (java_object_.is_null())
35 return; 38 return;
36 Java_Shell_onNativeDestroyed(env, java_object_); 39 Java_Shell_onNativeDestroyed(env, java_object_);
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 109
107 // static 110 // static
108 void CloseShell(JNIEnv* env, 111 void CloseShell(JNIEnv* env,
109 const JavaParamRef<jclass>& clazz, 112 const JavaParamRef<jclass>& clazz,
110 jlong shellPtr) { 113 jlong shellPtr) {
111 Shell* shell = reinterpret_cast<Shell*>(shellPtr); 114 Shell* shell = reinterpret_cast<Shell*>(shellPtr);
112 shell->Close(); 115 shell->Close();
113 } 116 }
114 117
115 } // namespace content 118 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698