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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 disposition == NEW_BACKGROUND_TAB ? disposition : NEW_FOREGROUND_TAB; | 152 disposition == NEW_BACKGROUND_TAB ? disposition : NEW_FOREGROUND_TAB; |
153 | 153 |
154 navigate_params.window_bounds = initial_rect; | 154 navigate_params.window_bounds = initial_rect; |
155 navigate_params.user_gesture = user_gesture; | 155 navigate_params.user_gesture = user_gesture; |
156 navigate_params.extension_app_id = panel_->extension_id(); | 156 navigate_params.extension_app_id = panel_->extension_id(); |
157 chrome::Navigate(&navigate_params); | 157 chrome::Navigate(&navigate_params); |
158 } | 158 } |
159 | 159 |
160 void PanelHost::ActivateContents(content::WebContents* contents, | 160 void PanelHost::ActivateContents(content::WebContents* contents, |
161 bool user_gesture) { | 161 bool user_gesture) { |
162 panel_->Activate(); | 162 panel_->Activate(user_gesture); |
163 } | 163 } |
164 | 164 |
165 void PanelHost::DeactivateContents(content::WebContents* contents) { | 165 void PanelHost::DeactivateContents(content::WebContents* contents) { |
166 panel_->Deactivate(); | 166 panel_->Deactivate(); |
167 } | 167 } |
168 | 168 |
169 void PanelHost::LoadingStateChanged(content::WebContents* source, | 169 void PanelHost::LoadingStateChanged(content::WebContents* source, |
170 bool to_different_document) { | 170 bool to_different_document) { |
171 bool is_loading = source->IsLoading() && to_different_document; | 171 bool is_loading = source->IsLoading() && to_different_document; |
172 panel_->LoadingStateChanged(is_loading); | 172 panel_->LoadingStateChanged(is_loading); |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 } | 262 } |
263 | 263 |
264 void PanelHost::StopLoading() { | 264 void PanelHost::StopLoading() { |
265 content::RecordAction(UserMetricsAction("Stop")); | 265 content::RecordAction(UserMetricsAction("Stop")); |
266 web_contents_->Stop(); | 266 web_contents_->Stop(); |
267 } | 267 } |
268 | 268 |
269 void PanelHost::Zoom(content::PageZoom zoom) { | 269 void PanelHost::Zoom(content::PageZoom zoom) { |
270 ui_zoom::PageZoom::Zoom(web_contents_.get(), zoom); | 270 ui_zoom::PageZoom::Zoom(web_contents_.get(), zoom); |
271 } | 271 } |
OLD | NEW |