OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "chrome/browser/devtools/devtools_window.h" | 4 #include "chrome/browser/devtools/devtools_window.h" |
5 | 5 |
6 #include <algorithm> | 6 #include <algorithm> |
7 | 7 |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 #include "content/public/browser/web_contents.h" | 59 #include "content/public/browser/web_contents.h" |
60 #include "content/public/browser/web_contents_observer.h" | 60 #include "content/public/browser/web_contents_observer.h" |
61 #include "content/public/browser/web_contents_view.h" | 61 #include "content/public/browser/web_contents_view.h" |
62 #include "content/public/common/bindings_policy.h" | 62 #include "content/public/common/bindings_policy.h" |
63 #include "content/public/common/content_client.h" | 63 #include "content/public/common/content_client.h" |
64 #include "content/public/common/page_transition_types.h" | 64 #include "content/public/common/page_transition_types.h" |
65 #include "content/public/common/url_constants.h" | 65 #include "content/public/common/url_constants.h" |
66 #include "grit/generated_resources.h" | 66 #include "grit/generated_resources.h" |
67 #include "ui/base/l10n/l10n_util.h" | 67 #include "ui/base/l10n/l10n_util.h" |
68 | 68 |
| 69 #if defined(OS_WIN) |
| 70 #include "chrome/browser/ui/touch_web_contents_observer_win.h" |
| 71 #endif |
| 72 |
69 using base::DictionaryValue; | 73 using base::DictionaryValue; |
70 using content::BrowserThread; | 74 using content::BrowserThread; |
71 using content::DevToolsAgentHost; | 75 using content::DevToolsAgentHost; |
72 | 76 |
73 | 77 |
74 // DevToolsConfirmInfoBarDelegate --------------------------------------------- | 78 // DevToolsConfirmInfoBarDelegate --------------------------------------------- |
75 | 79 |
76 class DevToolsConfirmInfoBarDelegate : public ConfirmInfoBarDelegate { | 80 class DevToolsConfirmInfoBarDelegate : public ConfirmInfoBarDelegate { |
77 public: | 81 public: |
78 // If |infobar_service| is NULL, runs |callback| with a single argument with | 82 // If |infobar_service| is NULL, runs |callback| with a single argument with |
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
692 content::Source<ThemeService>( | 696 content::Source<ThemeService>( |
693 ThemeServiceFactory::GetForProfile(profile_))); | 697 ThemeServiceFactory::GetForProfile(profile_))); |
694 | 698 |
695 // There is no inspected_rvh in case of shared workers. | 699 // There is no inspected_rvh in case of shared workers. |
696 if (inspected_rvh) | 700 if (inspected_rvh) |
697 inspected_contents_observer_.reset(new InspectedWebContentsObserver( | 701 inspected_contents_observer_.reset(new InspectedWebContentsObserver( |
698 content::WebContents::FromRenderViewHost(inspected_rvh))); | 702 content::WebContents::FromRenderViewHost(inspected_rvh))); |
699 | 703 |
700 embedder_message_dispatcher_.reset( | 704 embedder_message_dispatcher_.reset( |
701 new DevToolsEmbedderMessageDispatcher(this)); | 705 new DevToolsEmbedderMessageDispatcher(this)); |
| 706 |
| 707 #if defined(OS_WIN) |
| 708 TouchWebContentsObserver::CreateForWebContents(web_contents_); |
| 709 #endif |
702 } | 710 } |
703 | 711 |
704 // static | 712 // static |
705 DevToolsWindow* DevToolsWindow::Create( | 713 DevToolsWindow* DevToolsWindow::Create( |
706 Profile* profile, | 714 Profile* profile, |
707 const GURL& frontend_url, | 715 const GURL& frontend_url, |
708 content::RenderViewHost* inspected_rvh, | 716 content::RenderViewHost* inspected_rvh, |
709 DevToolsDockSide dock_side, | 717 DevToolsDockSide dock_side, |
710 bool shared_worker_frontend, | 718 bool shared_worker_frontend, |
711 bool external_frontend) { | 719 bool external_frontend) { |
(...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1501 return inspected_contents_observer_ ? | 1509 return inspected_contents_observer_ ? |
1502 inspected_contents_observer_->web_contents() : NULL; | 1510 inspected_contents_observer_->web_contents() : NULL; |
1503 } | 1511 } |
1504 | 1512 |
1505 void DevToolsWindow::DocumentOnLoadCompletedInMainFrame() { | 1513 void DevToolsWindow::DocumentOnLoadCompletedInMainFrame() { |
1506 is_loaded_ = true; | 1514 is_loaded_ = true; |
1507 UpdateTheme(); | 1515 UpdateTheme(); |
1508 DoAction(); | 1516 DoAction(); |
1509 AddDevToolsExtensionsToClient(); | 1517 AddDevToolsExtensionsToClient(); |
1510 } | 1518 } |
OLD | NEW |