diff options
author | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-23 20:09:21 +0000 |
---|---|---|
committer | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-23 20:09:21 +0000 |
commit | 4747caf2e94287e3bc0974a619cbb5b03c799de3 (patch) | |
tree | 94186d3c6331b98aa759d3d504222151c00c0ca8 | |
parent | bd3f4b3da8395a6f2fde983f425f3accad36f6ab (diff) | |
download | chromium_src-4747caf2e94287e3bc0974a619cbb5b03c799de3.zip chromium_src-4747caf2e94287e3bc0974a619cbb5b03c799de3.tar.gz chromium_src-4747caf2e94287e3bc0974a619cbb5b03c799de3.tar.bz2 |
Remove the check for inspector files since they're in resources.pak now.
In r79038, I moved the inspector files into resources.pak so we no longer
need to check to see if inspector is available (it should always be
there).
Also fix chrome --diagnostics to check for resources.pak rather
than the resources/Inspector dir.
BUG=77167
TEST=Delete resources/inspector from disk, start chrome and right click on a
page. Inspect Element should be there and work.
Review URL: http://codereview.chromium.org/6726027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79170 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/browser_main.cc | 4 | ||||
-rw-r--r-- | chrome/browser/browser_process.h | 9 | ||||
-rw-r--r-- | chrome/browser/browser_process_impl.cc | 26 | ||||
-rw-r--r-- | chrome/browser/browser_process_impl.h | 9 | ||||
-rw-r--r-- | chrome/browser/diagnostics/diagnostics_model.cc | 6 | ||||
-rw-r--r-- | chrome/browser/diagnostics/recon_diagnostics.cc | 6 | ||||
-rw-r--r-- | chrome/browser/diagnostics/recon_diagnostics.h | 2 | ||||
-rw-r--r-- | chrome/browser/tab_contents/render_view_context_menu.cc | 14 | ||||
-rw-r--r-- | chrome/browser/ui/toolbar/wrench_menu_model.cc | 6 | ||||
-rw-r--r-- | chrome/test/testing_browser_process.cc | 4 | ||||
-rw-r--r-- | chrome/test/testing_browser_process.h | 2 |
11 files changed, 16 insertions, 72 deletions
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc index aea776a..369a987 100644 --- a/chrome/browser/browser_main.cc +++ b/chrome/browser/browser_main.cc @@ -1682,10 +1682,6 @@ int BrowserMain(const MainFunctionParams& parameters) { RecordBreakpadStatusUMA(metrics); about_flags::RecordUMAStatistics(local_state); - // Stat the directory with the inspector's files so that we can know if we - // should display the entry in the context menu or not. - browser_process->CheckForInspectorFiles(); - #if defined(OS_CHROMEOS) metrics->StartExternalMetrics(); #endif diff --git a/chrome/browser/browser_process.h b/chrome/browser/browser_process.h index 4257c98..99d3664 100644 --- a/chrome/browser/browser_process.h +++ b/chrome/browser/browser_process.h @@ -195,10 +195,6 @@ class BrowserProcess { // the IO thread. virtual bool plugin_finder_disabled() const = 0; - // Trigger an asynchronous check to see if we have the inspector's files on - // disk. - virtual void CheckForInspectorFiles() = 0; - #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) // This will start a timer that, if Chrome is in persistent mode, will check // whether an update is available, and if that's the case, restart the @@ -210,11 +206,6 @@ class BrowserProcess { virtual void StartAutoupdateTimer() = 0; #endif - // Return true iff we found the inspector files on disk. It's possible to - // call this function before we have a definite answer from the disk. In that - // case, we default to returning true. - virtual bool have_inspector_files() const = 0; - virtual ChromeNetLog* net_log() = 0; #if defined(IPC_MESSAGE_LOG_ENABLED) diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc index 06739bc..a40e280 100644 --- a/chrome/browser/browser_process_impl.cc +++ b/chrome/browser/browser_process_impl.cc @@ -118,8 +118,7 @@ BrowserProcessImpl::BrowserProcessImpl(const CommandLine& command_line) module_ref_count_(0), did_start_(false), checked_for_new_frames_(false), - using_new_frames_(false), - have_inspector_files_(true) { + using_new_frames_(false) { g_browser_process = this; clipboard_.reset(new ui::Clipboard); main_notification_service_.reset(new NotificationService); @@ -613,12 +612,6 @@ bool BrowserProcessImpl::plugin_finder_disabled() const { return *plugin_finder_disabled_pref_; } -void BrowserProcessImpl::CheckForInspectorFiles() { - file_thread()->message_loop()->PostTask - (FROM_HERE, - NewRunnableMethod(this, &BrowserProcessImpl::DoInspectorFilesCheck)); -} - void BrowserProcessImpl::Observe(NotificationType type, const NotificationSource& source, const NotificationDetails& details) { @@ -659,10 +652,6 @@ void BrowserProcessImpl::StartAutoupdateTimer() { } #endif -bool BrowserProcessImpl::have_inspector_files() const { - return have_inspector_files_; -} - ChromeNetLog* BrowserProcessImpl::net_log() { return net_log_.get(); } @@ -996,19 +985,6 @@ void BrowserProcessImpl::SetIPCLoggingEnabledForChildProcesses(bool enabled) { #endif // IPC_MESSAGE_LOG_ENABLED -void BrowserProcessImpl::DoInspectorFilesCheck() { - // Runs on FILE thread. - DCHECK(file_thread_->message_loop() == MessageLoop::current()); - bool result = false; - - FilePath inspector_dir; - if (PathService::Get(chrome::DIR_INSPECTOR, &inspector_dir)) { - result = file_util::PathExists(inspector_dir); - } - - have_inspector_files_ = result; -} - // Mac is currently not supported. #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) diff --git a/chrome/browser/browser_process_impl.h b/chrome/browser/browser_process_impl.h index 286df53..c28d3d3 100644 --- a/chrome/browser/browser_process_impl.h +++ b/chrome/browser/browser_process_impl.h @@ -95,7 +95,6 @@ class BrowserProcessImpl : public BrowserProcess, virtual safe_browsing::ClientSideDetectionService* safe_browsing_detection_service(); virtual bool plugin_finder_disabled() const; - virtual void CheckForInspectorFiles(); // NotificationObserver methods virtual void Observe(NotificationType type, @@ -106,8 +105,6 @@ class BrowserProcessImpl : public BrowserProcess, virtual void StartAutoupdateTimer(); #endif - virtual bool have_inspector_files() const; - virtual ChromeNetLog* net_log(); #if defined(IPC_MESSAGE_LOG_ENABLED) @@ -256,12 +253,6 @@ class BrowserProcessImpl : public BrowserProcess, // An event that notifies when we are shutting-down. scoped_ptr<base::WaitableEvent> shutdown_event_; - // Runs on the file thread and stats the inspector's directory, filling in - // have_inspector_files_ with the result. - void DoInspectorFilesCheck(); - // Our best estimate about the existence of the inspector directory. - bool have_inspector_files_; - // Ensures that the observers of plugin/print disable/enable state // notifications are properly added and removed. PrefChangeRegistrar pref_change_registrar_; diff --git a/chrome/browser/diagnostics/diagnostics_model.cc b/chrome/browser/diagnostics/diagnostics_model.cc index 209e342..b3ff24d 100644 --- a/chrome/browser/diagnostics/diagnostics_model.cc +++ b/chrome/browser/diagnostics/diagnostics_model.cc @@ -89,7 +89,7 @@ class DiagnosticsModelWin : public DiagnosticsModelImpl { tests_.push_back(MakeUserDirTest()); tests_.push_back(MakeLocalStateFileTest()); tests_.push_back(MakeDictonaryDirTest()); - tests_.push_back(MakeInspectorDirTest()); + tests_.push_back(MakeResourcesFileTest()); tests_.push_back(MakeDiskSpaceTest()); tests_.push_back(MakePreferencesTest()); tests_.push_back(MakeLocalStateTest()); @@ -115,7 +115,7 @@ class DiagnosticsModelMac : public DiagnosticsModelImpl { tests_.push_back(MakeUserDirTest()); tests_.push_back(MakeLocalStateFileTest()); tests_.push_back(MakeDictonaryDirTest()); - tests_.push_back(MakeInspectorDirTest()); + tests_.push_back(MakeResourcesFileTest()); tests_.push_back(MakeDiskSpaceTest()); tests_.push_back(MakePreferencesTest()); tests_.push_back(MakeLocalStateTest()); @@ -142,7 +142,7 @@ class DiagnosticsModelPosix : public DiagnosticsModelImpl { tests_.push_back(MakeUserDirTest()); tests_.push_back(MakeLocalStateFileTest()); tests_.push_back(MakeDictonaryDirTest()); - tests_.push_back(MakeInspectorDirTest()); + tests_.push_back(MakeResourcesFileTest()); tests_.push_back(MakeDiskSpaceTest()); tests_.push_back(MakePreferencesTest()); tests_.push_back(MakeLocalStateTest()); diff --git a/chrome/browser/diagnostics/recon_diagnostics.cc b/chrome/browser/diagnostics/recon_diagnostics.cc index 218e85f..60e4bae 100644 --- a/chrome/browser/diagnostics/recon_diagnostics.cc +++ b/chrome/browser/diagnostics/recon_diagnostics.cc @@ -214,8 +214,8 @@ const TestPathInfo kPathsToTest[] = { false, false, true, 500 * kOneKilo}, {"Dictionaries Directory", chrome::DIR_APP_DICTIONARIES, true, true, false, 0}, - {"Inspector Directory", chrome::DIR_INSPECTOR, - true, false, false, 0} + {"Resources file", chrome::FILE_RESOURCES_PACK, + false, false, false, 0} }; // Check that the user's data directory exists and the paths are writable. @@ -386,7 +386,7 @@ DiagnosticTest* MakeDictonaryDirTest() { return new PathTest(kPathsToTest[2]); } -DiagnosticTest* MakeInspectorDirTest() { +DiagnosticTest* MakeResourcesFileTest() { return new PathTest(kPathsToTest[3]); } diff --git a/chrome/browser/diagnostics/recon_diagnostics.h b/chrome/browser/diagnostics/recon_diagnostics.h index 8a20d4d..02b5db3 100644 --- a/chrome/browser/diagnostics/recon_diagnostics.h +++ b/chrome/browser/diagnostics/recon_diagnostics.h @@ -15,7 +15,7 @@ DiagnosticTest* MakeVersionTest(); DiagnosticTest* MakeUserDirTest(); DiagnosticTest* MakeLocalStateFileTest(); DiagnosticTest* MakeDictonaryDirTest(); -DiagnosticTest* MakeInspectorDirTest(); +DiagnosticTest* MakeResourcesFileTest(); DiagnosticTest* MakeDiskSpaceTest(); DiagnosticTest* MakePreferencesTest(); DiagnosticTest* MakeBookMarksTest(); diff --git a/chrome/browser/tab_contents/render_view_context_menu.cc b/chrome/browser/tab_contents/render_view_context_menu.cc index 4a5929d..5e26d8c 100644 --- a/chrome/browser/tab_contents/render_view_context_menu.cc +++ b/chrome/browser/tab_contents/render_view_context_menu.cc @@ -530,14 +530,12 @@ bool RenderViewContextMenu::AppendCustomItems() { } void RenderViewContextMenu::AppendDeveloperItems() { - if (g_browser_process->have_inspector_files()) { - // In the DevTools popup menu, "developer items" is normally the only - // section, so omit the separator there. - if (menu_model_.GetItemCount() > 0) - menu_model_.AddSeparator(); - menu_model_.AddItemWithStringId(IDC_CONTENT_CONTEXT_INSPECTELEMENT, - IDS_CONTENT_CONTEXT_INSPECTELEMENT); - } + // In the DevTools popup menu, "developer items" is normally the only + // section, so omit the separator there. + if (menu_model_.GetItemCount() > 0) + menu_model_.AddSeparator(); + menu_model_.AddItemWithStringId(IDC_CONTENT_CONTEXT_INSPECTELEMENT, + IDS_CONTENT_CONTEXT_INSPECTELEMENT); } void RenderViewContextMenu::AppendLinkItems() { diff --git a/chrome/browser/ui/toolbar/wrench_menu_model.cc b/chrome/browser/ui/toolbar/wrench_menu_model.cc index c7232b5..6c6f747 100644 --- a/chrome/browser/ui/toolbar/wrench_menu_model.cc +++ b/chrome/browser/ui/toolbar/wrench_menu_model.cc @@ -181,10 +181,8 @@ void ToolsMenuModel::Build(Browser* browser) { AddSubMenuWithStringId(IDC_ENCODING_MENU, IDS_ENCODING_MENU, encoding_menu_model_.get()); AddItemWithStringId(IDC_VIEW_SOURCE, IDS_VIEW_SOURCE); - if (g_browser_process->have_inspector_files()) { - AddItemWithStringId(IDC_DEV_TOOLS, IDS_DEV_TOOLS); - AddItemWithStringId(IDC_DEV_TOOLS_CONSOLE, IDS_DEV_TOOLS_CONSOLE); - } + AddItemWithStringId(IDC_DEV_TOOLS, IDS_DEV_TOOLS); + AddItemWithStringId(IDC_DEV_TOOLS_CONSOLE, IDS_DEV_TOOLS_CONSOLE); #if defined(ENABLE_PROFILING) && !defined(NO_TCMALLOC) AddSeparator(); diff --git a/chrome/test/testing_browser_process.cc b/chrome/test/testing_browser_process.cc index 72b9976..5546417 100644 --- a/chrome/test/testing_browser_process.cc +++ b/chrome/test/testing_browser_process.cc @@ -210,10 +210,6 @@ bool TestingBrowserProcess::plugin_finder_disabled() const { return false; } -bool TestingBrowserProcess::have_inspector_files() const { - return true; -} - ChromeNetLog* TestingBrowserProcess::net_log() { return NULL; } diff --git a/chrome/test/testing_browser_process.h b/chrome/test/testing_browser_process.h index a6aee39..6a3d215 100644 --- a/chrome/test/testing_browser_process.h +++ b/chrome/test/testing_browser_process.h @@ -133,8 +133,6 @@ class TestingBrowserProcess : public BrowserProcess { virtual void StartAutoupdateTimer() {} #endif - virtual bool have_inspector_files() const; - virtual ChromeNetLog* net_log(); #if defined(IPC_MESSAGE_LOG_ENABLED) |