| 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 "content/shell/shell_web_contents_view_delegate.h" | 5 #include "content/shell/shell_web_contents_view_delegate.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "content/public/browser/render_process_host.h" | 8 #include "content/public/browser/render_process_host.h" |
| 9 #include "content/public/browser/render_view_host.h" | 9 #include "content/public/browser/render_view_host.h" |
| 10 #include "content/public/browser/render_widget_host_view.h" | 10 #include "content/public/browser/render_widget_host_view.h" |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 | 189 |
| 190 gboolean ShellWebContentsViewDelegate::OnNativeViewFocusEvent( | 190 gboolean ShellWebContentsViewDelegate::OnNativeViewFocusEvent( |
| 191 GtkWidget* widget, | 191 GtkWidget* widget, |
| 192 GtkDirectionType type, | 192 GtkDirectionType type, |
| 193 gboolean* return_value) { | 193 gboolean* return_value) { |
| 194 return false; | 194 return false; |
| 195 } | 195 } |
| 196 | 196 |
| 197 void ShellWebContentsViewDelegate::OnBackMenuActivated(GtkWidget* widget) { | 197 void ShellWebContentsViewDelegate::OnBackMenuActivated(GtkWidget* widget) { |
| 198 web_contents_->GetController().GoToOffset(-1); | 198 web_contents_->GetController().GoToOffset(-1); |
| 199 web_contents_->Focus(); | 199 web_contents_->GetView()->Focus(); |
| 200 } | 200 } |
| 201 | 201 |
| 202 void ShellWebContentsViewDelegate::OnForwardMenuActivated(GtkWidget* widget) { | 202 void ShellWebContentsViewDelegate::OnForwardMenuActivated(GtkWidget* widget) { |
| 203 web_contents_->GetController().GoToOffset(1); | 203 web_contents_->GetController().GoToOffset(1); |
| 204 web_contents_->Focus(); | 204 web_contents_->GetView()->Focus(); |
| 205 } | 205 } |
| 206 | 206 |
| 207 void ShellWebContentsViewDelegate::OnReloadMenuActivated(GtkWidget* widget) { | 207 void ShellWebContentsViewDelegate::OnReloadMenuActivated(GtkWidget* widget) { |
| 208 web_contents_->GetController().Reload(false); | 208 web_contents_->GetController().Reload(false); |
| 209 web_contents_->Focus(); | 209 web_contents_->GetView()->Focus(); |
| 210 } | 210 } |
| 211 | 211 |
| 212 void ShellWebContentsViewDelegate::OnOpenURLMenuActivated(GtkWidget* widget) { | 212 void ShellWebContentsViewDelegate::OnOpenURLMenuActivated(GtkWidget* widget) { |
| 213 ShellBrowserContext* browser_context = | 213 ShellBrowserContext* browser_context = |
| 214 static_cast<ShellContentBrowserClient*>( | 214 static_cast<ShellContentBrowserClient*>( |
| 215 GetContentClient()->browser())->browser_context(); | 215 GetContentClient()->browser())->browser_context(); |
| 216 Shell::CreateNewWindow(browser_context, | 216 Shell::CreateNewWindow(browser_context, |
| 217 params_.link_url, | 217 params_.link_url, |
| 218 NULL, | 218 NULL, |
| 219 MSG_ROUTING_NONE, | 219 MSG_ROUTING_NONE, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 234 | 234 |
| 235 void ShellWebContentsViewDelegate::OnDeleteMenuActivated(GtkWidget* widget) { | 235 void ShellWebContentsViewDelegate::OnDeleteMenuActivated(GtkWidget* widget) { |
| 236 web_contents_->GetRenderViewHost()->Delete(); | 236 web_contents_->GetRenderViewHost()->Delete(); |
| 237 } | 237 } |
| 238 | 238 |
| 239 void ShellWebContentsViewDelegate::OnInspectMenuActivated(GtkWidget* widget) { | 239 void ShellWebContentsViewDelegate::OnInspectMenuActivated(GtkWidget* widget) { |
| 240 ShellDevToolsFrontend::Show(web_contents_); | 240 ShellDevToolsFrontend::Show(web_contents_); |
| 241 } | 241 } |
| 242 | 242 |
| 243 } // namespace content | 243 } // namespace content |
| OLD | NEW |