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

Side by Side Diff: chrome/browser/render_view_context_menu_controller.cc

Issue 18248: CommandLine API rework (Closed)
Patch Set: fixes Created 11 years, 11 months 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
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/render_view_context_menu_controller.h" 5 #include "chrome/browser/render_view_context_menu_controller.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/scoped_clipboard_writer.h" 9 #include "base/scoped_clipboard_writer.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 break; 468 break;
469 } 469 }
470 470
471 case IDS_CONTENT_CONTEXT_ADDSEARCHENGINE: // Not implemented. 471 case IDS_CONTENT_CONTEXT_ADDSEARCHENGINE: // Not implemented.
472 default: 472 default:
473 break; 473 break;
474 } 474 }
475 } 475 }
476 476
477 bool RenderViewContextMenuController::IsDevCommandEnabled(int id) const { 477 bool RenderViewContextMenuController::IsDevCommandEnabled(int id) const {
478 CommandLine command_line; 478 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
479 if (command_line.HasSwitch(switches::kAlwaysEnableDevTools)) 479 if (command_line.HasSwitch(switches::kAlwaysEnableDevTools))
480 return true; 480 return true;
481 481
482 NavigationEntry *active_entry = 482 NavigationEntry *active_entry =
483 source_web_contents_->controller()->GetActiveEntry(); 483 source_web_contents_->controller()->GetActiveEntry();
484 if (!active_entry) 484 if (!active_entry)
485 return false; 485 return false;
486 486
487 // Don't inspect HTML dialogs. 487 // Don't inspect HTML dialogs.
488 if (source_web_contents_->type() == TAB_CONTENTS_HTML_DIALOG) 488 if (source_web_contents_->type() == TAB_CONTENTS_HTML_DIALOG)
(...skipping 18 matching lines...) Expand all
507 if (id == IDS_CONTENT_CONTEXT_INSPECTELEMENT) { 507 if (id == IDS_CONTENT_CONTEXT_INSPECTELEMENT) {
508 PrefService* prefs = source_web_contents_->profile()->GetPrefs(); 508 PrefService* prefs = source_web_contents_->profile()->GetPrefs();
509 if (!prefs->GetBoolean(prefs::kWebKitJavascriptEnabled) || 509 if (!prefs->GetBoolean(prefs::kWebKitJavascriptEnabled) ||
510 command_line.HasSwitch(switches::kDisableJavaScript)) 510 command_line.HasSwitch(switches::kDisableJavaScript))
511 return false; 511 return false;
512 } 512 }
513 513
514 return true; 514 return true;
515 } 515 }
516 516
OLDNEW
« no previous file with comments | « chrome/browser/printing/printing_layout_uitest.cc ('k') | chrome/browser/render_view_host_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698