Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(304)

Side by Side Diff: chrome/browser/tab_contents/render_view_context_menu.cc

Issue 8462018: Fix browser crash when viewing page info on certain popups. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 7
8 #include "chrome/browser/tab_contents/render_view_context_menu.h" 8 #include "chrome/browser/tab_contents/render_view_context_menu.h"
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 1026 matching lines...) Expand 10 before | Expand all | Expand 10 after
1037 case IDC_RELOAD: 1037 case IDC_RELOAD:
1038 return source_tab_contents_->delegate() && 1038 return source_tab_contents_->delegate() &&
1039 source_tab_contents_->delegate()->CanReloadContents( 1039 source_tab_contents_->delegate()->CanReloadContents(
1040 source_tab_contents_); 1040 source_tab_contents_);
1041 1041
1042 case IDC_VIEW_SOURCE: 1042 case IDC_VIEW_SOURCE:
1043 case IDC_CONTENT_CONTEXT_VIEWFRAMESOURCE: 1043 case IDC_CONTENT_CONTEXT_VIEWFRAMESOURCE:
1044 return source_tab_contents_->controller().CanViewSource(); 1044 return source_tab_contents_->controller().CanViewSource();
1045 1045
1046 case IDC_CONTENT_CONTEXT_INSPECTELEMENT: 1046 case IDC_CONTENT_CONTEXT_INSPECTELEMENT:
1047 // Viewing page info is not a developer command but is meaningful for the 1047 return IsDevCommandEnabled(id);
1048 // same set of pages which developer commands are meaningful for. 1048
1049 case IDC_CONTENT_CONTEXT_VIEWPAGEINFO: 1049 case IDC_CONTENT_CONTEXT_VIEWPAGEINFO:
1050 return IsDevCommandEnabled(id); 1050 return source_tab_contents_->controller().GetActiveEntry() != NULL;
1051 1051
1052 case IDC_CONTENT_CONTEXT_TRANSLATE: { 1052 case IDC_CONTENT_CONTEXT_TRANSLATE: {
1053 TabContentsWrapper* tab_contents_wrapper = 1053 TabContentsWrapper* tab_contents_wrapper =
1054 TabContentsWrapper::GetCurrentWrapperForContents( 1054 TabContentsWrapper::GetCurrentWrapperForContents(
1055 source_tab_contents_); 1055 source_tab_contents_);
1056 if (!tab_contents_wrapper) 1056 if (!tab_contents_wrapper)
1057 return false; 1057 return false;
1058 TranslateTabHelper* helper = tab_contents_wrapper->translate_tab_helper(); 1058 TranslateTabHelper* helper = tab_contents_wrapper->translate_tab_helper();
1059 std::string original_lang = 1059 std::string original_lang =
1060 helper->language_state().original_language(); 1060 helper->language_state().original_language();
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after
1861 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages), 1861 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages),
1862 g_browser_process->clipboard()); 1862 g_browser_process->clipboard());
1863 } 1863 }
1864 1864
1865 void RenderViewContextMenu::MediaPlayerActionAt( 1865 void RenderViewContextMenu::MediaPlayerActionAt(
1866 const gfx::Point& location, 1866 const gfx::Point& location,
1867 const WebMediaPlayerAction& action) { 1867 const WebMediaPlayerAction& action) {
1868 source_tab_contents_->render_view_host()-> 1868 source_tab_contents_->render_view_host()->
1869 ExecuteMediaPlayerActionAtLocation(location, action); 1869 ExecuteMediaPlayerActionAtLocation(location, action);
1870 } 1870 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698