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/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 // because the title is also updated when loading state changes. | 131 // because the title is also updated when loading state changes. |
132 if ((changed_flags & content::INVALIDATE_TYPE_TAB) || | 132 if ((changed_flags & content::INVALIDATE_TYPE_TAB) || |
133 ((changed_flags & content::INVALIDATE_TYPE_TITLE) && | 133 ((changed_flags & content::INVALIDATE_TYPE_TITLE) && |
134 !source->IsLoading())) | 134 !source->IsLoading())) |
135 panel_->UpdateTitleBar(); | 135 panel_->UpdateTitleBar(); |
136 } | 136 } |
137 | 137 |
138 void PanelHost::AddNewContents(content::WebContents* source, | 138 void PanelHost::AddNewContents(content::WebContents* source, |
139 content::WebContents* new_contents, | 139 content::WebContents* new_contents, |
140 WindowOpenDisposition disposition, | 140 WindowOpenDisposition disposition, |
141 const gfx::Rect& initial_pos, | 141 const gfx::Rect& initial_rect, |
142 bool user_gesture, | 142 bool user_gesture, |
143 bool* was_blocked) { | 143 bool* was_blocked) { |
144 chrome::NavigateParams navigate_params(profile_, new_contents->GetURL(), | 144 chrome::NavigateParams navigate_params(profile_, new_contents->GetURL(), |
145 ui::PAGE_TRANSITION_LINK); | 145 ui::PAGE_TRANSITION_LINK); |
146 navigate_params.target_contents = new_contents; | 146 navigate_params.target_contents = new_contents; |
147 | 147 |
148 // Force all links to open in a new tab, even if they were trying to open a | 148 // Force all links to open in a new tab, even if they were trying to open a |
149 // window. | 149 // window. |
150 navigate_params.disposition = | 150 navigate_params.disposition = |
151 disposition == NEW_BACKGROUND_TAB ? disposition : NEW_FOREGROUND_TAB; | 151 disposition == NEW_BACKGROUND_TAB ? disposition : NEW_FOREGROUND_TAB; |
152 | 152 |
153 navigate_params.window_bounds = initial_pos; | 153 navigate_params.window_bounds = initial_rect; |
154 navigate_params.user_gesture = user_gesture; | 154 navigate_params.user_gesture = user_gesture; |
155 navigate_params.extension_app_id = panel_->extension_id(); | 155 navigate_params.extension_app_id = panel_->extension_id(); |
156 chrome::Navigate(&navigate_params); | 156 chrome::Navigate(&navigate_params); |
157 } | 157 } |
158 | 158 |
159 void PanelHost::ActivateContents(content::WebContents* contents) { | 159 void PanelHost::ActivateContents(content::WebContents* contents) { |
160 panel_->Activate(); | 160 panel_->Activate(); |
161 } | 161 } |
162 | 162 |
163 void PanelHost::DeactivateContents(content::WebContents* contents) { | 163 void PanelHost::DeactivateContents(content::WebContents* contents) { |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 } | 264 } |
265 | 265 |
266 void PanelHost::StopLoading() { | 266 void PanelHost::StopLoading() { |
267 content::RecordAction(UserMetricsAction("Stop")); | 267 content::RecordAction(UserMetricsAction("Stop")); |
268 web_contents_->Stop(); | 268 web_contents_->Stop(); |
269 } | 269 } |
270 | 270 |
271 void PanelHost::Zoom(content::PageZoom zoom) { | 271 void PanelHost::Zoom(content::PageZoom zoom) { |
272 ui_zoom::PageZoom::Zoom(web_contents_.get(), zoom); | 272 ui_zoom::PageZoom::Zoom(web_contents_.get(), zoom); |
273 } | 273 } |
OLD | NEW |