| 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 web_contents_->GetView()->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_->GetView()->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 ShellContentBrowserClient::Get()->browser_context(); |
| 215 GetContentClient()->browser())->browser_context(); | |
| 216 Shell::CreateNewWindow(browser_context, | 215 Shell::CreateNewWindow(browser_context, |
| 217 params_.link_url, | 216 params_.link_url, |
| 218 NULL, | 217 NULL, |
| 219 MSG_ROUTING_NONE, | 218 MSG_ROUTING_NONE, |
| 220 gfx::Size()); | 219 gfx::Size()); |
| 221 } | 220 } |
| 222 | 221 |
| 223 void ShellWebContentsViewDelegate::OnCutMenuActivated(GtkWidget* widget) { | 222 void ShellWebContentsViewDelegate::OnCutMenuActivated(GtkWidget* widget) { |
| 224 web_contents_->GetRenderViewHost()->Cut(); | 223 web_contents_->GetRenderViewHost()->Cut(); |
| 225 } | 224 } |
| 226 | 225 |
| 227 void ShellWebContentsViewDelegate::OnCopyMenuActivated(GtkWidget* widget) { | 226 void ShellWebContentsViewDelegate::OnCopyMenuActivated(GtkWidget* widget) { |
| 228 web_contents_->GetRenderViewHost()->Copy(); | 227 web_contents_->GetRenderViewHost()->Copy(); |
| 229 } | 228 } |
| 230 | 229 |
| 231 void ShellWebContentsViewDelegate::OnPasteMenuActivated(GtkWidget* widget) { | 230 void ShellWebContentsViewDelegate::OnPasteMenuActivated(GtkWidget* widget) { |
| 232 web_contents_->GetRenderViewHost()->Paste(); | 231 web_contents_->GetRenderViewHost()->Paste(); |
| 233 } | 232 } |
| 234 | 233 |
| 235 void ShellWebContentsViewDelegate::OnDeleteMenuActivated(GtkWidget* widget) { | 234 void ShellWebContentsViewDelegate::OnDeleteMenuActivated(GtkWidget* widget) { |
| 236 web_contents_->GetRenderViewHost()->Delete(); | 235 web_contents_->GetRenderViewHost()->Delete(); |
| 237 } | 236 } |
| 238 | 237 |
| 239 void ShellWebContentsViewDelegate::OnInspectMenuActivated(GtkWidget* widget) { | 238 void ShellWebContentsViewDelegate::OnInspectMenuActivated(GtkWidget* widget) { |
| 240 ShellDevToolsFrontend::Show(web_contents_); | 239 ShellDevToolsFrontend::Show(web_contents_); |
| 241 } | 240 } |
| 242 | 241 |
| 243 } // namespace content | 242 } // namespace content |
| OLD | NEW |