Home | History | Annotate | Download | only in testshell
      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
      3 // found in the LICENSE file.
      4 
      5 #ifndef CHROME_ANDROID_TESTSHELL_TESTSHELL_TAB_H_
      6 #define CHROME_ANDROID_TESTSHELL_TESTSHELL_TAB_H_
      7 
      8 #include <jni.h>
      9 
     10 #include "base/compiler_specific.h"
     11 #include "base/memory/scoped_ptr.h"
     12 #include "chrome/browser/android/tab_android.h"
     13 
     14 namespace browser_sync {
     15 class SyncedTabDelegate;
     16 }
     17 
     18 namespace chrome {
     19 struct NavigateParams;
     20 }
     21 
     22 namespace chrome {
     23 namespace android {
     24 class ChromeWebContentsDelegateAndroid;
     25 }
     26 }
     27 
     28 namespace content {
     29 class WebContents;
     30 }
     31 
     32 namespace ui {
     33 class WindowAndroid;
     34 }
     35 
     36 class TestShellTab : public TabAndroid {
     37  public:
     38   TestShellTab(JNIEnv* env, jobject obj);
     39   void Destroy(JNIEnv* env, jobject obj);
     40 
     41   // --------------------------------------------------------------------------
     42   // TabAndroid Methods
     43   // --------------------------------------------------------------------------
     44   virtual void OnReceivedHttpAuthRequest(jobject auth_handler,
     45                                          const string16& host,
     46                                          const string16& realm) OVERRIDE;
     47 
     48   virtual void AddShortcutToBookmark(const GURL& url,
     49                                      const string16& title,
     50                                      const SkBitmap& skbitmap,
     51                                      int r_value,
     52                                      int g_value,
     53                                      int b_value) OVERRIDE;
     54   virtual void EditBookmark(int64 node_id,
     55                             const base::string16& node_title,
     56                             bool is_folder,
     57                             bool is_partner_bookmark) OVERRIDE;
     58 
     59   virtual bool ShouldWelcomePageLinkToTermsOfService() OVERRIDE;
     60   virtual void OnNewTabPageReady() OVERRIDE;
     61 
     62   virtual void HandlePopupNavigation(chrome::NavigateParams* params) OVERRIDE;
     63 
     64   // Register the Tab's native methods through JNI.
     65   static bool RegisterTestShellTab(JNIEnv* env);
     66 
     67   // --------------------------------------------------------------------------
     68   // Methods called from Java via JNI
     69   // --------------------------------------------------------------------------
     70   base::android::ScopedJavaLocalRef<jstring> FixupUrl(JNIEnv* env,
     71                                                       jobject obj,
     72                                                       jstring url);
     73 
     74  protected:
     75   virtual ~TestShellTab();
     76 
     77  private:
     78   DISALLOW_COPY_AND_ASSIGN(TestShellTab);
     79 };
     80 
     81 #endif  // CHROME_ANDROID_TESTSHELL_TESTSHELL_TAB_H_
     82