| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/browser/shell.h" | 5 #include "content/shell/browser/shell.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 : ui::SimpleMenuModel(this), | 64 : ui::SimpleMenuModel(this), |
| 65 shell_(shell), | 65 shell_(shell), |
| 66 params_(params) { | 66 params_(params) { |
| 67 AddItem(COMMAND_OPEN_DEVTOOLS, base::ASCIIToUTF16("Inspect Element")); | 67 AddItem(COMMAND_OPEN_DEVTOOLS, base::ASCIIToUTF16("Inspect Element")); |
| 68 } | 68 } |
| 69 | 69 |
| 70 // ui::SimpleMenuModel::Delegate: | 70 // ui::SimpleMenuModel::Delegate: |
| 71 bool IsCommandIdChecked(int command_id) const override { return false; } | 71 bool IsCommandIdChecked(int command_id) const override { return false; } |
| 72 bool IsCommandIdEnabled(int command_id) const override { return true; } | 72 bool IsCommandIdEnabled(int command_id) const override { return true; } |
| 73 bool GetAcceleratorForCommandId(int command_id, | 73 bool GetAcceleratorForCommandId(int command_id, |
| 74 ui::Accelerator* accelerator) override { | 74 ui::Accelerator* accelerator) const override { |
| 75 return false; | 75 return false; |
| 76 } | 76 } |
| 77 void ExecuteCommand(int command_id, int event_flags) override { | 77 void ExecuteCommand(int command_id, int event_flags) override { |
| 78 switch (command_id) { | 78 switch (command_id) { |
| 79 case COMMAND_OPEN_DEVTOOLS: | 79 case COMMAND_OPEN_DEVTOOLS: |
| 80 shell_->ShowDevToolsForElementAt(params_.x, params_.y); | 80 shell_->ShowDevToolsForElementAt(params_.x, params_.y); |
| 81 break; | 81 break; |
| 82 }; | 82 }; |
| 83 } | 83 } |
| 84 | 84 |
| (...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 const content::ContextMenuParams& params) { | 529 const content::ContextMenuParams& params) { |
| 530 if (headless_) | 530 if (headless_) |
| 531 return true; | 531 return true; |
| 532 ShellWindowDelegateView* delegate_view = | 532 ShellWindowDelegateView* delegate_view = |
| 533 static_cast<ShellWindowDelegateView*>(window_widget_->widget_delegate()); | 533 static_cast<ShellWindowDelegateView*>(window_widget_->widget_delegate()); |
| 534 delegate_view->ShowWebViewContextMenu(params); | 534 delegate_view->ShowWebViewContextMenu(params); |
| 535 return true; | 535 return true; |
| 536 } | 536 } |
| 537 | 537 |
| 538 } // namespace content | 538 } // namespace content |
| OLD | NEW |