OLD | NEW |
| (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 #include "chrome/browser/instant/instant_ntp.h" | |
6 | |
7 #include "content/public/browser/navigation_entry.h" | |
8 #include "content/public/browser/web_contents.h" | |
9 | |
10 InstantNTP::InstantNTP(InstantPage::Delegate* delegate, | |
11 const std::string& instant_url) | |
12 : InstantPage(delegate), | |
13 loader_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), | |
14 instant_url_(instant_url) { | |
15 } | |
16 | |
17 InstantNTP::~InstantNTP() { | |
18 } | |
19 | |
20 void InstantNTP::InitContents(Profile* profile, | |
21 const content::WebContents* active_tab, | |
22 const base::Closure& on_stale_callback) { | |
23 loader_.Init(GURL(instant_url_), profile, active_tab, on_stale_callback); | |
24 SetContents(loader_.contents()); | |
25 loader_.Load(); | |
26 } | |
27 | |
28 scoped_ptr<content::WebContents> InstantNTP::ReleaseContents() { | |
29 SetContents(NULL); | |
30 return loader_.ReleaseContents(); | |
31 } | |
32 | |
33 void InstantNTP::OnSwappedContents() { | |
34 SetContents(loader_.contents()); | |
35 } | |
36 | |
37 void InstantNTP::OnFocus() { | |
38 NOTREACHED(); | |
39 } | |
40 | |
41 void InstantNTP::OnMouseDown() { | |
42 NOTREACHED(); | |
43 } | |
44 | |
45 void InstantNTP::OnMouseUp() { | |
46 NOTREACHED(); | |
47 } | |
48 | |
49 content::WebContents* InstantNTP::OpenURLFromTab( | |
50 content::WebContents* source, | |
51 const content::OpenURLParams& params) { | |
52 return NULL; | |
53 } | |
54 | |
55 bool InstantNTP::ShouldProcessRenderViewCreated() { | |
56 return true; | |
57 } | |
58 | |
59 bool InstantNTP::ShouldProcessRenderViewGone() { | |
60 return true; | |
61 } | |
OLD | NEW |