From eb20993dfc50d111c22a1c732ae91ea63a1d46a5 Mon Sep 17 00:00:00 2001 From: Kristian Monsen Date: Tue, 21 Jun 2011 20:22:16 +0100 Subject: Merge Chromium at r11.0.696.0: Adding Android tab_contents.h and tab_contents_observer.h These were completly forked anyway. These files were moved to a new top level chromium directory, content. We are only using these two files from that directory. Putting these two in android/content and not importing all other files from content. Change-Id: I38a10232100a9ea14911c2818794291040301da7 --- .../content/browser/tab_contents/tab_contents.h | 40 ++++++++++++++++++++++ .../browser/tab_contents/tab_contents_observer.h | 34 ++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 android/content/browser/tab_contents/tab_contents.h create mode 100644 android/content/browser/tab_contents/tab_contents_observer.h (limited to 'android') diff --git a/android/content/browser/tab_contents/tab_contents.h b/android/content/browser/tab_contents/tab_contents.h new file mode 100644 index 0000000..009cbc8 --- /dev/null +++ b/android/content/browser/tab_contents/tab_contents.h @@ -0,0 +1,40 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef ANDROID_CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ +#define ANDROID_CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ +#pragma once + +#include "android/autofill/profile_android.h" +#include "base/scoped_ptr.h" +#include "chrome/browser/profiles/profile.h" +#include "chrome/browser/autofill/autofill_host.h" + +// Autofill does not need the entire TabContents class, just +// access to the RenderViewHost and Profile. Later it would +// be nice to create a small class that contains just this +// data for AutoFill. Then Android won't care about this +// file which as it stands does not compile for us. +class RenderViewHost; +class URLRequestContextGetter; + +class TabContents { +public: + TabContents() + : profile_(ProfileImplAndroid::CreateProfile(FilePath())) + , autofill_host_(NULL) + { + } + + Profile* profile() { return profile_.get(); } + void SetProfileRequestContext(URLRequestContextGetter* context) { static_cast(profile_.get())->SetRequestContext(context); } + AutoFillHost* autofill_host() { return autofill_host_; } + void SetAutoFillHost(AutoFillHost* autofill_host) { autofill_host_ = autofill_host; } + +private: + scoped_ptr profile_; + AutoFillHost* autofill_host_; +}; + +#endif // ANDROID_CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ diff --git a/android/content/browser/tab_contents/tab_contents_observer.h b/android/content/browser/tab_contents/tab_contents_observer.h new file mode 100644 index 0000000..b4de4fb --- /dev/null +++ b/android/content/browser/tab_contents/tab_contents_observer.h @@ -0,0 +1,34 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef ANDROID_CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_OBSERVER_H_ +#define ANDROID_CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_OBSERVER_H_ + +// Android specific implementation + +#include "content/browser/tab_contents/tab_contents.h" + +// An observer API implemented by classes which are interested in various page +// load events from TabContents. They also get a chance to filter IPC messages. +class TabContentsObserver { + public: + + protected: + TabContentsObserver(TabContents* tab_contents) { + tab_contents_ = tab_contents; + } + + virtual ~TabContentsObserver() {} + + TabContents* tab_contents() { return tab_contents_; } + + private: + friend class TabContents; + + TabContents* tab_contents_; + + DISALLOW_COPY_AND_ASSIGN(TabContentsObserver); +}; + +#endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_OBSERVER_H_ -- cgit v1.1