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

Side by Side Diff: content/browser/android/content_video_view.h

Issue 2353063005: Refactor ContentViewClient (1/6) (Closed)
Patch Set: cast to activity 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 (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_BROWSER_ANDROID_CONTENT_VIDEO_VIEW_H_ 5 #ifndef CONTENT_BROWSER_ANDROID_CONTENT_VIDEO_VIEW_H_
6 #define CONTENT_BROWSER_ANDROID_CONTENT_VIDEO_VIEW_H_ 6 #define CONTENT_BROWSER_ANDROID_CONTENT_VIDEO_VIEW_H_
7 7
8 #include <jni.h> 8 #include <jni.h>
9 9
10 #include "base/android/jni_weak_ref.h" 10 #include "base/android/jni_weak_ref.h"
(...skipping 28 matching lines...) Expand all
39 virtual void DidExitFullscreen(bool release_media_player) = 0; 39 virtual void DidExitFullscreen(bool release_media_player) = 0;
40 40
41 protected: 41 protected:
42 ~Client() {} 42 ~Client() {}
43 43
44 DISALLOW_COPY_AND_ASSIGN(Client); 44 DISALLOW_COPY_AND_ASSIGN(Client);
45 }; 45 };
46 46
47 explicit ContentVideoView(Client* client, 47 explicit ContentVideoView(Client* client,
48 ContentViewCore* content_view_core, 48 ContentViewCore* content_view_core,
49 const base::android::JavaRef<jobject>& embedder,
49 const gfx::Size& video_natural_size); 50 const gfx::Size& video_natural_size);
50 ~ContentVideoView(); 51 ~ContentVideoView();
51 52
52 // To open another video on existing ContentVideoView. 53 // To open another video on existing ContentVideoView.
53 void OpenVideo(); 54 void OpenVideo();
54 55
55 // Display an error dialog to the user. 56 // Display an error dialog to the user.
56 void OnMediaPlayerError(int error_type); 57 void OnMediaPlayerError(int error_type);
57 58
58 // Update the video size. 59 // Update the video size.
(...skipping 24 matching lines...) Expand all
83 bool is_orientation_portrait); 84 bool is_orientation_portrait);
84 void RecordExitFullscreenPlayback( 85 void RecordExitFullscreenPlayback(
85 JNIEnv*, 86 JNIEnv*,
86 const base::android::JavaParamRef<jobject>&, 87 const base::android::JavaParamRef<jobject>&,
87 bool is_portrait_video, 88 bool is_portrait_video,
88 long playback_duration_in_milliseconds_before_orientation_change, 89 long playback_duration_in_milliseconds_before_orientation_change,
89 long playback_duration_in_milliseconds_after_orientation_change); 90 long playback_duration_in_milliseconds_after_orientation_change);
90 91
91 private: 92 private:
92 // Creates the corresponding ContentVideoView Java object. 93 // Creates the corresponding ContentVideoView Java object.
93 JavaObjectWeakGlobalRef CreateJavaObject(ContentViewCore* content_view_core, 94 JavaObjectWeakGlobalRef CreateJavaObject(
94 const gfx::Size& video_natural_size); 95 ContentViewCore* content_view_core,
96 const base::android::JavaRef<jobject>& j_content_video_view_embedder,
97 const gfx::Size& video_natural_size);
95 98
96 Client* client_; 99 Client* client_;
97 100
98 // Weak reference to corresponding Java object. 101 // Weak reference to corresponding Java object.
99 JavaObjectWeakGlobalRef j_content_video_view_; 102 JavaObjectWeakGlobalRef j_content_video_view_;
100 103
101 // Weak pointer for posting tasks. 104 // Weak pointer for posting tasks.
102 base::WeakPtrFactory<ContentVideoView> weak_factory_; 105 base::WeakPtrFactory<ContentVideoView> weak_factory_;
103 106
104 DISALLOW_COPY_AND_ASSIGN(ContentVideoView); 107 DISALLOW_COPY_AND_ASSIGN(ContentVideoView);
105 }; 108 };
106 109
107 } // namespace content 110 } // namespace content
108 111
109 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIDEO_VIEW_H_ 112 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIDEO_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698