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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 PanelHost::~PanelHost() { | 45 PanelHost::~PanelHost() { |
46 } | 46 } |
47 | 47 |
48 void PanelHost::Init(const GURL& url) { | 48 void PanelHost::Init(const GURL& url) { |
49 if (url.is_empty()) | 49 if (url.is_empty()) |
50 return; | 50 return; |
51 | 51 |
52 content::WebContents::CreateParams create_params( | 52 content::WebContents::CreateParams create_params( |
53 profile_, content::SiteInstance::CreateForURL(profile_, url)); | 53 profile_, content::SiteInstance::CreateForURL(profile_, url)); |
54 web_contents_.reset(content::WebContents::Create(create_params)); | 54 web_contents_.reset(content::WebContents::Create(create_params)); |
55 chrome::SetViewType(web_contents_.get(), chrome::VIEW_TYPE_PANEL); | 55 chrome::SetViewType(web_contents_.get(), extensions::VIEW_TYPE_PANEL); |
56 web_contents_->SetDelegate(this); | 56 web_contents_->SetDelegate(this); |
57 content::WebContentsObserver::Observe(web_contents_.get()); | 57 content::WebContentsObserver::Observe(web_contents_.get()); |
58 | 58 |
59 // Needed to give the web contents a Tab ID. Extension APIs | 59 // Needed to give the web contents a Tab ID. Extension APIs |
60 // expect web contents to have a Tab ID. | 60 // expect web contents to have a Tab ID. |
61 SessionTabHelper::CreateForWebContents(web_contents_.get()); | 61 SessionTabHelper::CreateForWebContents(web_contents_.get()); |
62 SessionTabHelper::FromWebContents(web_contents_.get())->SetWindowID( | 62 SessionTabHelper::FromWebContents(web_contents_.get())->SetWindowID( |
63 panel_->session_id()); | 63 panel_->session_id()); |
64 | 64 |
65 FaviconTabHelper::CreateForWebContents(web_contents_.get()); | 65 FaviconTabHelper::CreateForWebContents(web_contents_.get()); |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 } | 249 } |
250 | 250 |
251 void PanelHost::StopLoading() { | 251 void PanelHost::StopLoading() { |
252 content::RecordAction(UserMetricsAction("Stop")); | 252 content::RecordAction(UserMetricsAction("Stop")); |
253 web_contents_->Stop(); | 253 web_contents_->Stop(); |
254 } | 254 } |
255 | 255 |
256 void PanelHost::Zoom(content::PageZoom zoom) { | 256 void PanelHost::Zoom(content::PageZoom zoom) { |
257 chrome_page_zoom::Zoom(web_contents_.get(), zoom); | 257 chrome_page_zoom::Zoom(web_contents_.get(), zoom); |
258 } | 258 } |
OLD | NEW |