| 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 if ((changed_flags & content::INVALIDATE_TYPE_TAB) || | 106 if ((changed_flags & content::INVALIDATE_TYPE_TAB) || |
| 107 ((changed_flags & content::INVALIDATE_TYPE_TITLE) && | 107 ((changed_flags & content::INVALIDATE_TYPE_TITLE) && |
| 108 !source->IsLoading())) | 108 !source->IsLoading())) |
| 109 panel_->UpdateTitleBar(); | 109 panel_->UpdateTitleBar(); |
| 110 } | 110 } |
| 111 | 111 |
| 112 void PanelHost::AddNewContents(content::WebContents* source, | 112 void PanelHost::AddNewContents(content::WebContents* source, |
| 113 content::WebContents* new_contents, | 113 content::WebContents* new_contents, |
| 114 WindowOpenDisposition disposition, | 114 WindowOpenDisposition disposition, |
| 115 const gfx::Rect& initial_pos, | 115 const gfx::Rect& initial_pos, |
| 116 bool user_gesture) { | 116 bool user_gesture, |
| 117 bool* was_blocked) { |
| 117 chrome::NavigateParams navigate_params(profile_, new_contents->GetURL(), | 118 chrome::NavigateParams navigate_params(profile_, new_contents->GetURL(), |
| 118 content::PAGE_TRANSITION_LINK); | 119 content::PAGE_TRANSITION_LINK); |
| 119 // Create a TabContents because the NavigateParams takes a TabContents, | 120 // Create a TabContents because the NavigateParams takes a TabContents, |
| 120 // not a WebContents, for the target_contents. | 121 // not a WebContents, for the target_contents. |
| 121 TabContents* new_tab_contents = TabContents::FromWebContents(new_contents); | 122 TabContents* new_tab_contents = TabContents::FromWebContents(new_contents); |
| 122 if (!new_tab_contents) | 123 if (!new_tab_contents) |
| 123 new_tab_contents = TabContents::Factory::CreateTabContents(new_contents); | 124 new_tab_contents = TabContents::Factory::CreateTabContents(new_contents); |
| 124 navigate_params.target_contents = new_tab_contents; | 125 navigate_params.target_contents = new_tab_contents; |
| 125 | 126 |
| 126 // Force all links to open in a new tab, even if they were trying to open a | 127 // Force all links to open in a new tab, even if they were trying to open a |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 } | 247 } |
| 247 | 248 |
| 248 void PanelHost::StopLoading() { | 249 void PanelHost::StopLoading() { |
| 249 content::RecordAction(UserMetricsAction("Stop")); | 250 content::RecordAction(UserMetricsAction("Stop")); |
| 250 web_contents_->Stop(); | 251 web_contents_->Stop(); |
| 251 } | 252 } |
| 252 | 253 |
| 253 void PanelHost::Zoom(content::PageZoom zoom) { | 254 void PanelHost::Zoom(content::PageZoom zoom) { |
| 254 chrome_page_zoom::Zoom(web_contents_.get(), zoom); | 255 chrome_page_zoom::Zoom(web_contents_.get(), zoom); |
| 255 } | 256 } |
| OLD | NEW |