Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <set> | 6 #include <set> |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "chrome/browser/tab_contents/render_view_context_menu.h" | 9 #include "chrome/browser/tab_contents/render_view_context_menu.h" |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 23 #include "chrome/browser/debugger/devtools_window.h" | 23 #include "chrome/browser/debugger/devtools_window.h" |
| 24 #include "chrome/browser/download/download_service.h" | 24 #include "chrome/browser/download/download_service.h" |
| 25 #include "chrome/browser/download/download_service_factory.h" | 25 #include "chrome/browser/download/download_service_factory.h" |
| 26 #include "chrome/browser/extensions/extension_event_router.h" | 26 #include "chrome/browser/extensions/extension_event_router.h" |
| 27 #include "chrome/browser/extensions/extension_service.h" | 27 #include "chrome/browser/extensions/extension_service.h" |
| 28 #include "chrome/browser/google/google_util.h" | 28 #include "chrome/browser/google/google_util.h" |
| 29 #include "chrome/browser/net/browser_url_util.h" | 29 #include "chrome/browser/net/browser_url_util.h" |
| 30 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 30 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
| 31 #include "chrome/browser/prefs/pref_member.h" | 31 #include "chrome/browser/prefs/pref_member.h" |
| 32 #include "chrome/browser/prefs/pref_service.h" | 32 #include "chrome/browser/prefs/pref_service.h" |
| 33 #include "chrome/browser/printing/print_preview_context_menu_observer.h" | |
| 33 #include "chrome/browser/printing/print_preview_tab_controller.h" | 34 #include "chrome/browser/printing/print_preview_tab_controller.h" |
| 34 #include "chrome/browser/printing/print_view_manager.h" | 35 #include "chrome/browser/printing/print_view_manager.h" |
| 35 #include "chrome/browser/profiles/profile.h" | 36 #include "chrome/browser/profiles/profile.h" |
| 36 #include "chrome/browser/profiles/profile_io_data.h" | 37 #include "chrome/browser/profiles/profile_io_data.h" |
| 37 #include "chrome/browser/search_engines/template_url.h" | 38 #include "chrome/browser/search_engines/template_url.h" |
| 38 #include "chrome/browser/search_engines/template_url_service.h" | 39 #include "chrome/browser/search_engines/template_url_service.h" |
| 39 #include "chrome/browser/search_engines/template_url_service_factory.h" | 40 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 40 #include "chrome/browser/spellchecker/spellcheck_host.h" | 41 #include "chrome/browser/spellchecker/spellcheck_host.h" |
| 41 #include "chrome/browser/spellchecker/spellcheck_host_metrics.h" | 42 #include "chrome/browser/spellchecker/spellcheck_host_metrics.h" |
| 42 #include "chrome/browser/tab_contents/spellchecker_submenu_observer.h" | 43 #include "chrome/browser/tab_contents/spellchecker_submenu_observer.h" |
| (...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 590 else if (has_selection) | 591 else if (has_selection) |
| 591 AppendCopyItem(); | 592 AppendCopyItem(); |
| 592 | 593 |
| 593 if (has_selection) | 594 if (has_selection) |
| 594 AppendSearchProvider(); | 595 AppendSearchProvider(); |
| 595 | 596 |
| 596 if (!IsDevToolsURL(params_.page_url)) | 597 if (!IsDevToolsURL(params_.page_url)) |
| 597 AppendAllExtensionItems(); | 598 AppendAllExtensionItems(); |
| 598 | 599 |
| 599 AppendDeveloperItems(); | 600 AppendDeveloperItems(); |
| 601 | |
| 602 if (!print_preview_menu_observer_.get()) { | |
|
vandebo (ex-Chrome)
2011/12/10 02:18:22
I don't see the definition for this, am I missing
Lei Zhang
2011/12/10 02:31:33
Forgot to upload the .h file.
| |
| 603 TabContentsWrapper* wrapper = | |
| 604 TabContentsWrapper::GetCurrentWrapperForContents(source_tab_contents_); | |
| 605 print_preview_menu_observer_.reset( | |
| 606 new PrintPreviewContextMenuObserver(wrapper)); | |
| 607 } | |
| 608 observers_.AddObserver(print_preview_menu_observer_.get()); | |
| 600 } | 609 } |
| 601 | 610 |
| 602 void RenderViewContextMenu::LookUpInDictionary() { | 611 void RenderViewContextMenu::LookUpInDictionary() { |
| 603 // Used only in the Mac port. | 612 // Used only in the Mac port. |
| 604 NOTREACHED(); | 613 NOTREACHED(); |
| 605 } | 614 } |
| 606 | 615 |
| 607 void RenderViewContextMenu::AddMenuItem(int command_id, | 616 void RenderViewContextMenu::AddMenuItem(int command_id, |
| 608 const string16& title) { | 617 const string16& title) { |
| 609 menu_model_.AddItem(command_id, title); | 618 menu_model_.AddItem(command_id, title); |
| (...skipping 1218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1828 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages), | 1837 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages), |
| 1829 g_browser_process->clipboard()); | 1838 g_browser_process->clipboard()); |
| 1830 } | 1839 } |
| 1831 | 1840 |
| 1832 void RenderViewContextMenu::MediaPlayerActionAt( | 1841 void RenderViewContextMenu::MediaPlayerActionAt( |
| 1833 const gfx::Point& location, | 1842 const gfx::Point& location, |
| 1834 const WebMediaPlayerAction& action) { | 1843 const WebMediaPlayerAction& action) { |
| 1835 source_tab_contents_->render_view_host()-> | 1844 source_tab_contents_->render_view_host()-> |
| 1836 ExecuteMediaPlayerActionAtLocation(location, action); | 1845 ExecuteMediaPlayerActionAtLocation(location, action); |
| 1837 } | 1846 } |
| OLD | NEW |