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

Side by Side Diff: blimp/client/session/blimp_client_session_android.cc

Issue 1575493004: Blimp: add some hard-coded actions on client startup. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « no previous file | blimp/net/blimp_message_demultiplexer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "blimp/client/session/blimp_client_session_android.h" 5 #include "blimp/client/session/blimp_client_session_android.h"
6 6
7 #include "blimp/client/session/navigation_feature.h"
8 #include "blimp/client/session/tab_control_feature.h"
9 #include "blimp/net/input_message_generator.h"
7 #include "jni/BlimpClientSession_jni.h" 10 #include "jni/BlimpClientSession_jni.h"
8 11
9 namespace blimp { 12 namespace blimp {
13 namespace {
14
15 // TODO(kmarshall): Replace with homepage URL from profile, config, etc.
16 const char kInitialUrl[] = "http://www.google.com/";
17
18 const int kDummyTabId = 0;
19
20 } // namespace
10 21
11 static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& jobj) { 22 static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& jobj) {
12 return reinterpret_cast<intptr_t>(new BlimpClientSessionAndroid(env, jobj)); 23 return reinterpret_cast<intptr_t>(new BlimpClientSessionAndroid(env, jobj));
13 } 24 }
14 25
15 // static 26 // static
16 bool BlimpClientSessionAndroid::RegisterJni(JNIEnv* env) { 27 bool BlimpClientSessionAndroid::RegisterJni(JNIEnv* env) {
17 return RegisterNativesImpl(env); 28 return RegisterNativesImpl(env);
18 } 29 }
19 30
20 // static 31 // static
21 BlimpClientSessionAndroid* BlimpClientSessionAndroid::FromJavaObject( 32 BlimpClientSessionAndroid* BlimpClientSessionAndroid::FromJavaObject(
22 JNIEnv* env, 33 JNIEnv* env,
23 jobject jobj) { 34 jobject jobj) {
24 return reinterpret_cast<BlimpClientSessionAndroid*>( 35 return reinterpret_cast<BlimpClientSessionAndroid*>(
25 Java_BlimpClientSession_getNativePtr(env, jobj)); 36 Java_BlimpClientSession_getNativePtr(env, jobj));
26 } 37 }
27 38
28 BlimpClientSessionAndroid::BlimpClientSessionAndroid( 39 BlimpClientSessionAndroid::BlimpClientSessionAndroid(
29 JNIEnv* env, 40 JNIEnv* env,
30 const base::android::JavaParamRef<jobject>& jobj) 41 const base::android::JavaParamRef<jobject>& jobj)
31 : BlimpClientSession() { 42 : BlimpClientSession() {
32 java_obj_.Reset(env, jobj); 43 java_obj_.Reset(env, jobj);
44
45 // Prototype hard-coded hack messages, to be sent immediately after a
46 // connection is established on first run.
47 // TODO(dtrainor): Remove this when we are reading homepages and persisted
48 // tab data from a user profile.
49 GetTabControlFeature()->CreateTab(kDummyTabId);
David Trainor- moved to gerrit 2016/01/11 17:46:09 Right after the following line in BlimpRendererAct
Kevin M 2016/01/12 01:41:07 Done, though I kept the CreateTab() call. I think
50 GetNavigationFeature()->NavigateToUrlText(kDummyTabId, kInitialUrl);
33 } 51 }
34 52
35 BlimpClientSessionAndroid::~BlimpClientSessionAndroid() {} 53 BlimpClientSessionAndroid::~BlimpClientSessionAndroid() {}
36 54
37 void BlimpClientSessionAndroid::Destroy(JNIEnv* env, 55 void BlimpClientSessionAndroid::Destroy(JNIEnv* env,
38 const JavaParamRef<jobject>& jobj) { 56 const JavaParamRef<jobject>& jobj) {
39 delete this; 57 delete this;
40 } 58 }
41 59
42 } // namespace blimp 60 } // namespace blimp
OLDNEW
« no previous file with comments | « no previous file | blimp/net/blimp_message_demultiplexer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698