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

Side by Side Diff: chrome/browser/devtools/devtools_window.cc

Issue 147963003: DevTools: Avoid browser crash on undock after frontend self reloading. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 4
5 #include "chrome/browser/devtools/devtools_window.h" 5 #include "chrome/browser/devtools/devtools_window.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
(...skipping 1463 matching lines...) Expand 10 before | Expand all | Expand 10 after
1474 if (inspected_window) 1474 if (inspected_window)
1475 inspected_window->UpdateToolbar(NULL); 1475 inspected_window->UpdateToolbar(NULL);
1476 } 1476 }
1477 1477
1478 content::WebContents* DevToolsWindow::GetInspectedWebContents() { 1478 content::WebContents* DevToolsWindow::GetInspectedWebContents() {
1479 return inspected_contents_observer_ ? 1479 return inspected_contents_observer_ ?
1480 inspected_contents_observer_->web_contents() : NULL; 1480 inspected_contents_observer_->web_contents() : NULL;
1481 } 1481 }
1482 1482
1483 void DevToolsWindow::DocumentOnLoadCompletedInMainFrame() { 1483 void DevToolsWindow::DocumentOnLoadCompletedInMainFrame() {
1484 // Load is completed when both kIsDockedSet and kOnLoadFired happened. 1484 // We could be in kLoadCompleted state already if frontend reloads itself.
1485 // Here we set kOnLoadFired. 1485 if (load_state_ != kLoadCompleted) {
1486 load_state_ = load_state_ == kIsDockedSet ? kLoadCompleted : kOnLoadFired; 1486 // Load is completed when both kIsDockedSet and kOnLoadFired happened.
1487 // Here we set kOnLoadFired.
1488 load_state_ = load_state_ == kIsDockedSet ? kLoadCompleted : kOnLoadFired;
1489 }
1487 if (load_state_ == kLoadCompleted) 1490 if (load_state_ == kLoadCompleted)
1488 LoadCompleted(); 1491 LoadCompleted();
1489 } 1492 }
1490 1493
1491 void DevToolsWindow::LoadCompleted() { 1494 void DevToolsWindow::LoadCompleted() {
1492 Show(action_on_load_); 1495 Show(action_on_load_);
1493 action_on_load_ = DevToolsToggleAction::NoOp(); 1496 action_on_load_ = DevToolsToggleAction::NoOp();
1494 UpdateTheme(); 1497 UpdateTheme();
1495 AddDevToolsExtensionsToClient(); 1498 AddDevToolsExtensionsToClient();
1496 } 1499 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698