OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/panels/panel_host.h" | 5 #include "chrome/browser/ui/panels/panel_host.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "chrome/browser/chrome_page_zoom.h" | 10 #include "chrome/browser/chrome_page_zoom.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 | 40 |
41 PanelHost::~PanelHost() { | 41 PanelHost::~PanelHost() { |
42 } | 42 } |
43 | 43 |
44 void PanelHost::Init(const GURL& url) { | 44 void PanelHost::Init(const GURL& url) { |
45 if (url.is_empty()) | 45 if (url.is_empty()) |
46 return; | 46 return; |
47 | 47 |
48 web_contents_.reset(content::WebContents::Create( | 48 web_contents_.reset(content::WebContents::Create( |
49 profile_, content::SiteInstance::CreateForURL(profile_, url), | 49 profile_, content::SiteInstance::CreateForURL(profile_, url), |
50 MSG_ROUTING_NONE, NULL, NULL)); | 50 MSG_ROUTING_NONE, NULL)); |
51 chrome::SetViewType(web_contents_.get(), chrome::VIEW_TYPE_PANEL); | 51 chrome::SetViewType(web_contents_.get(), chrome::VIEW_TYPE_PANEL); |
52 web_contents_->SetDelegate(this); | 52 web_contents_->SetDelegate(this); |
53 content::WebContentsObserver::Observe(web_contents_.get()); | 53 content::WebContentsObserver::Observe(web_contents_.get()); |
54 | 54 |
55 favicon_tab_helper_.reset(new FaviconTabHelper(web_contents_.get())); | 55 favicon_tab_helper_.reset(new FaviconTabHelper(web_contents_.get())); |
56 | 56 |
57 web_contents_->GetController().LoadURL( | 57 web_contents_->GetController().LoadURL( |
58 url, content::Referrer(), content::PAGE_TRANSITION_LINK, std::string()); | 58 url, content::Referrer(), content::PAGE_TRANSITION_LINK, std::string()); |
59 } | 59 } |
60 | 60 |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 } | 185 } |
186 | 186 |
187 void PanelHost::StopLoading() { | 187 void PanelHost::StopLoading() { |
188 content::RecordAction(UserMetricsAction("Stop")); | 188 content::RecordAction(UserMetricsAction("Stop")); |
189 web_contents_->Stop(); | 189 web_contents_->Stop(); |
190 } | 190 } |
191 | 191 |
192 void PanelHost::Zoom(content::PageZoom zoom) { | 192 void PanelHost::Zoom(content::PageZoom zoom) { |
193 chrome_page_zoom::Zoom(web_contents_.get(), zoom); | 193 chrome_page_zoom::Zoom(web_contents_.get(), zoom); |
194 } | 194 } |
OLD | NEW |