| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/views/tab_contents/render_view_context_menu_views.h" | 5 #include "chrome/browser/views/tab_contents/render_view_context_menu_views.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/keyboard_codes.h" | 9 #include "base/keyboard_codes.h" |
| 10 #include "chrome/app/chrome_dll_resource.h" | 10 #include "chrome/app/chrome_dll_resource.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 void RenderViewContextMenuViews::RunMenuAt(int x, int y) { | 28 void RenderViewContextMenuViews::RunMenuAt(int x, int y) { |
| 29 menu_->RunContextMenuAt(gfx::Point(x, y)); | 29 menu_->RunContextMenuAt(gfx::Point(x, y)); |
| 30 } | 30 } |
| 31 | 31 |
| 32 #if defined(OS_WIN) | 32 #if defined(OS_WIN) |
| 33 void RenderViewContextMenuViews::SetExternal() { | 33 void RenderViewContextMenuViews::SetExternal() { |
| 34 external_ = true; | 34 external_ = true; |
| 35 } | 35 } |
| 36 #endif | 36 #endif |
| 37 | 37 |
| 38 void RenderViewContextMenuViews::UpdateMenuItemStates() { |
| 39 menu_->UpdateStates(); |
| 40 } |
| 41 |
| 38 //////////////////////////////////////////////////////////////////////////////// | 42 //////////////////////////////////////////////////////////////////////////////// |
| 39 // RenderViewContextMenuViews, protected: | 43 // RenderViewContextMenuViews, protected: |
| 40 | 44 |
| 41 void RenderViewContextMenuViews::PlatformInit() { | 45 void RenderViewContextMenuViews::PlatformInit() { |
| 42 menu_.reset(new views::Menu2(&menu_model_)); | 46 menu_.reset(new views::Menu2(&menu_model_)); |
| 43 | 47 |
| 44 #if defined(OS_WIN) | 48 #if defined(OS_WIN) |
| 45 if (external_) { | 49 if (external_) { |
| 46 // The external tab container needs to be notified by command | 50 // The external tab container needs to be notified by command |
| 47 // and not by index. So we are turning off the MNS_NOTIFYBYPOS | 51 // and not by index. So we are turning off the MNS_NOTIFYBYPOS |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 return true; | 90 return true; |
| 87 | 91 |
| 88 case IDC_CONTENT_CONTEXT_SELECTALL: | 92 case IDC_CONTENT_CONTEXT_SELECTALL: |
| 89 *accel = views::Accelerator(base::VKEY_A, false, true, false); | 93 *accel = views::Accelerator(base::VKEY_A, false, true, false); |
| 90 return true; | 94 return true; |
| 91 | 95 |
| 92 default: | 96 default: |
| 93 return false; | 97 return false; |
| 94 } | 98 } |
| 95 } | 99 } |
| OLD | NEW |