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 "chrome/browser/extensions/extensions_ui.h" | 5 #include "chrome/browser/extensions/extensions_ui.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 #include "chrome/browser/tab_contents/background_contents.h" | 28 #include "chrome/browser/tab_contents/background_contents.h" |
29 #include "chrome/browser/ui/browser_list.h" | 29 #include "chrome/browser/ui/browser_list.h" |
30 #include "chrome/browser/ui/webui/extension_icon_source.h" | 30 #include "chrome/browser/ui/webui/extension_icon_source.h" |
31 #include "chrome/common/extensions/extension.h" | 31 #include "chrome/common/extensions/extension.h" |
32 #include "chrome/common/extensions/extension_icon_set.h" | 32 #include "chrome/common/extensions/extension_icon_set.h" |
33 #include "chrome/common/extensions/url_pattern.h" | 33 #include "chrome/common/extensions/url_pattern.h" |
34 #include "chrome/common/extensions/user_script.h" | 34 #include "chrome/common/extensions/user_script.h" |
35 #include "chrome/common/jstemplate_builder.h" | 35 #include "chrome/common/jstemplate_builder.h" |
36 #include "chrome/common/pref_names.h" | 36 #include "chrome/common/pref_names.h" |
37 #include "chrome/common/url_constants.h" | 37 #include "chrome/common/url_constants.h" |
38 #include "content/browser/debugger/devtools_manager.h" | 38 #include "content/browser/debugger/devtools_window.h" |
39 #include "content/browser/debugger/devtools_toggle_action.h" | |
40 #include "content/browser/renderer_host/render_process_host.h" | 39 #include "content/browser/renderer_host/render_process_host.h" |
41 #include "content/browser/renderer_host/render_view_host.h" | 40 #include "content/browser/renderer_host/render_view_host.h" |
42 #include "content/browser/renderer_host/render_widget_host.h" | 41 #include "content/browser/renderer_host/render_widget_host.h" |
43 #include "content/browser/tab_contents/tab_contents.h" | 42 #include "content/browser/tab_contents/tab_contents.h" |
44 #include "content/browser/tab_contents/tab_contents_view.h" | 43 #include "content/browser/tab_contents/tab_contents_view.h" |
45 #include "content/common/notification_service.h" | 44 #include "content/common/notification_service.h" |
46 #include "content/common/notification_type.h" | 45 #include "content/common/notification_type.h" |
47 #include "googleurl/src/gurl.h" | 46 #include "googleurl/src/gurl.h" |
48 #include "grit/browser_resources.h" | 47 #include "grit/browser_resources.h" |
49 #include "grit/chromium_strings.h" | 48 #include "grit/chromium_strings.h" |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 CHECK(args->GetString(1, &render_view_id_str)); | 343 CHECK(args->GetString(1, &render_view_id_str)); |
345 CHECK(base::StringToInt(render_process_id_str, &render_process_id)); | 344 CHECK(base::StringToInt(render_process_id_str, &render_process_id)); |
346 CHECK(base::StringToInt(render_view_id_str, &render_view_id)); | 345 CHECK(base::StringToInt(render_view_id_str, &render_view_id)); |
347 RenderViewHost* host = RenderViewHost::FromID(render_process_id, | 346 RenderViewHost* host = RenderViewHost::FromID(render_process_id, |
348 render_view_id); | 347 render_view_id); |
349 if (!host) { | 348 if (!host) { |
350 // This can happen if the host has gone away since the page was displayed. | 349 // This can happen if the host has gone away since the page was displayed. |
351 return; | 350 return; |
352 } | 351 } |
353 | 352 |
354 DevToolsManager::GetInstance()->OpenDevToolsWindow(host); | 353 DevToolsWindow::OpenDevToolsWindow(host); |
355 } | 354 } |
356 | 355 |
357 void ExtensionsDOMHandler::HandleReloadMessage(const ListValue* args) { | 356 void ExtensionsDOMHandler::HandleReloadMessage(const ListValue* args) { |
358 std::string extension_id = UTF16ToASCII(ExtractStringValue(args)); | 357 std::string extension_id = UTF16ToASCII(ExtractStringValue(args)); |
359 CHECK(!extension_id.empty()); | 358 CHECK(!extension_id.empty()); |
360 extension_service_->ReloadExtension(extension_id); | 359 extension_service_->ReloadExtension(extension_id); |
361 } | 360 } |
362 | 361 |
363 void ExtensionsDOMHandler::HandleEnableMessage(const ListValue* args) { | 362 void ExtensionsDOMHandler::HandleEnableMessage(const ListValue* args) { |
364 CHECK(args->GetSize() == 2); | 363 CHECK(args->GetSize() == 2); |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
835 return ResourceBundle::GetSharedInstance(). | 834 return ResourceBundle::GetSharedInstance(). |
836 LoadDataResourceBytes(IDR_PLUGIN); | 835 LoadDataResourceBytes(IDR_PLUGIN); |
837 } | 836 } |
838 | 837 |
839 // static | 838 // static |
840 void ExtensionsUI::RegisterUserPrefs(PrefService* prefs) { | 839 void ExtensionsUI::RegisterUserPrefs(PrefService* prefs) { |
841 prefs->RegisterBooleanPref(prefs::kExtensionsUIDeveloperMode, | 840 prefs->RegisterBooleanPref(prefs::kExtensionsUIDeveloperMode, |
842 false, | 841 false, |
843 PrefService::SYNCABLE_PREF); | 842 PrefService::SYNCABLE_PREF); |
844 } | 843 } |
OLD | NEW |