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

Unified Diff: chrome/browser/debugger/devtools_window.cc

Issue 11519012: Ensure that the Inspect Element operation when performed on Windows 8 Metro ASH opens a docked dev … (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/debugger/devtools_window.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/debugger/devtools_window.cc
===================================================================
--- chrome/browser/debugger/devtools_window.cc (revision 172359)
+++ chrome/browser/debugger/devtools_window.cc (working copy)
@@ -25,6 +25,7 @@
#include "chrome/browser/themes/theme_service_factory.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_list.h"
+#include "chrome/browser/ui/browser_list_impl.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/chrome_notification_types.h"
@@ -403,8 +404,33 @@
if (!inspected_web_contents_)
return false;
- for (BrowserList::const_iterator it = BrowserList::begin();
- it != BrowserList::end(); ++it) {
+ bool found = FindInspectedBrowserAndTabIndexFromBrowserList(
+ chrome::BrowserListImpl::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE),
+ browser,
+ tab);
+ // On Windows 8 we can have the desktop environment and the ASH environment
+ // active concurrently. If we fail to find the inspected web contents in the
+ // native browser list, then we should look in the ASH browser list.
+#if defined(OS_WIN) && defined(USE_AURA)
+ if (!found) {
+ found = FindInspectedBrowserAndTabIndexFromBrowserList(
+ chrome::BrowserListImpl::GetInstance(chrome::HOST_DESKTOP_TYPE_ASH),
+ browser,
+ tab);
+ }
+#endif
+ return found;
+}
+
+bool DevToolsWindow::FindInspectedBrowserAndTabIndexFromBrowserList(
+ chrome::BrowserListImpl* browser_list,
+ Browser** browser,
+ int* tab) {
+ if (!inspected_web_contents_)
+ return false;
+
+ for (chrome::BrowserListImpl::const_iterator it = browser_list->begin();
+ it != browser_list->end(); ++it) {
int tab_index = (*it)->tab_strip_model()->GetIndexOfWebContents(
inspected_web_contents_);
if (tab_index != TabStripModel::kNoTab) {
« no previous file with comments | « chrome/browser/debugger/devtools_window.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698