summaryrefslogtreecommitdiffstats
path: root/android
diff options
context:
space:
mode:
authorKristian Monsen <kristianm@google.com>2011-06-21 20:22:16 +0100
committerKristian Monsen <kristianm@google.com>2011-06-30 13:29:13 +0100
commiteb20993dfc50d111c22a1c732ae91ea63a1d46a5 (patch)
tree7a1838a5957152de5f89ae4adbc07a0e77ebc34e /android
parent80a33eee125c56b3ee00067d47aad2a7dbab3023 (diff)
downloadexternal_chromium-eb20993dfc50d111c22a1c732ae91ea63a1d46a5.zip
external_chromium-eb20993dfc50d111c22a1c732ae91ea63a1d46a5.tar.gz
external_chromium-eb20993dfc50d111c22a1c732ae91ea63a1d46a5.tar.bz2
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
Diffstat (limited to 'android')
-rw-r--r--android/content/browser/tab_contents/tab_contents.h40
-rw-r--r--android/content/browser/tab_contents/tab_contents_observer.h34
2 files changed, 74 insertions, 0 deletions
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<ProfileImplAndroid*>(profile_.get())->SetRequestContext(context); }
+ AutoFillHost* autofill_host() { return autofill_host_; }
+ void SetAutoFillHost(AutoFillHost* autofill_host) { autofill_host_ = autofill_host; }
+
+private:
+ scoped_ptr<Profile> 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_