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

Side by Side Diff: chrome/browser/instant/instant_web_contents_container.h

Issue 12386019: Instant: Use only one hidden WebContents per profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2013 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_BROWSER_INSTANT_INSTANT_WEB_CONTENTS_CONTAINER_H_
6 #define CHROME_BROWSER_INSTANT_INSTANT_WEB_CONTENTS_CONTAINER_H_
7
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "chrome/browser/instant/instant_page.h"
12 #include "chrome/browser/ui/tab_contents/core_tab_helper_delegate.h"
13 #include "content/public/browser/web_contents_delegate.h"
14
15 class InstantService;
16
17 namespace content {
18 class WebContents;
19 }
20
21 // InstantWebContentsContainer owns a WebContents that's shown as an Instant
samarth 2013/03/01 17:59:53 I'm finding the relationship between InstantLoader
sreeram 2013/03/07 18:18:46 As discussed offline, I've kept the current struct
samarth 2013/03/11 19:03:24 Sorry, I'm looking at this again and this still do
22 // overlay. It can't be instantiated per se, but exists by way of its derived
23 // classes (InstantLoader and InstantOverlay). It implements WebContentsDelegate
24 // methods that are common to the derived classes. It also owns an InstantPage
25 // object that it uses to talk the SearchBox API with its contents.
26 class InstantWebContentsContainer : public CoreTabHelperDelegate,
27 public content::WebContentsDelegate {
28 public:
29 content::WebContents* contents() const { return contents_.get(); }
30
31 protected:
32 InstantWebContentsContainer(InstantPage::Delegate* delegate,
33 InstantService* service);
34 virtual ~InstantWebContentsContainer();
35
36 // Overridden from CoreTabHelperDelegate:
37 virtual void SwapTabContents(content::WebContents* old_contents,
38 content::WebContents* new_contents) OVERRIDE;
39
40 // Overriden from content::WebContentsDelegate:
41 virtual content::WebContents* OpenURLFromTab(
42 content::WebContents* source,
43 const content::OpenURLParams& params) OVERRIDE;
44 virtual bool ShouldFocusPageAfterCrash() OVERRIDE;
45 virtual bool CanDownload(content::RenderViewHost* render_view_host,
46 int request_id,
47 const std::string& request_method) OVERRIDE;
48 virtual bool OnGoToEntryOffset(int offset) OVERRIDE;
49
50 virtual void SetUpContents();
51 virtual void TearDownContents();
52
53 scoped_ptr<content::WebContents> contents_;
54 InstantPage page_;
55
56 DISALLOW_COPY_AND_ASSIGN(InstantWebContentsContainer);
57 };
58
59 #endif // CHROME_BROWSER_INSTANT_INSTANT_WEB_CONTENTS_CONTAINER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698