Home | History | Annotate | Download | only in tab_contents
      1 // Copyright (c) 2011 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 ANDROID_CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_
      6 #define ANDROID_CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_
      7 #pragma once
      8 
      9 #include "android/autofill/profile_android.h"
     10 #include "base/scoped_ptr.h"
     11 #include "chrome/browser/profiles/profile.h"
     12 #include "chrome/browser/autofill/autofill_host.h"
     13 
     14 // Autofill does not need the entire TabContents class, just
     15 // access to the RenderViewHost and Profile. Later it would
     16 // be nice to create a small class that contains just this
     17 // data for AutoFill. Then Android won't care about this
     18 // file which as it stands does not compile for us.
     19 class RenderViewHost;
     20 class URLRequestContextGetter;
     21 
     22 class TabContents {
     23 public:
     24   TabContents()
     25     : profile_(ProfileImplAndroid::CreateProfile(FilePath()))
     26     , autofill_host_(NULL)
     27   {
     28   }
     29 
     30   Profile* profile() { return profile_.get(); }
     31   void SetProfileRequestContext(net::URLRequestContextGetter* context) { static_cast<ProfileImplAndroid*>(profile_.get())->SetRequestContext(context); }
     32   AutoFillHost* autofill_host() { return autofill_host_; }
     33   void SetAutoFillHost(AutoFillHost* autofill_host) { autofill_host_ = autofill_host; }
     34 
     35 private:
     36   scoped_ptr<Profile> profile_;
     37   AutoFillHost* autofill_host_;
     38 };
     39 
     40 #endif // ANDROID_CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_
     41