| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/browser/extension_host.h" | 5 #include "extensions/browser/extension_host.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/metrics/field_trial.h" | 8 #include "base/metrics/field_trial.h" |
| 9 #include "base/metrics/histogram_macros.h" | 9 #include "base/metrics/histogram_macros.h" |
| 10 #include "base/profiler/scoped_tracker.h" | 10 #include "base/profiler/scoped_tracker.h" |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 bool user_gesture, | 420 bool user_gesture, |
| 421 bool* was_blocked) { | 421 bool* was_blocked) { |
| 422 // First, if the creating extension view was associated with a tab contents, | 422 // First, if the creating extension view was associated with a tab contents, |
| 423 // use that tab content's delegate. We must be careful here that the | 423 // use that tab content's delegate. We must be careful here that the |
| 424 // associated tab contents has the same profile as the new tab contents. In | 424 // associated tab contents has the same profile as the new tab contents. In |
| 425 // the case of extensions in 'spanning' incognito mode, they can mismatch. | 425 // the case of extensions in 'spanning' incognito mode, they can mismatch. |
| 426 // We don't want to end up putting a normal tab into an incognito window, or | 426 // We don't want to end up putting a normal tab into an incognito window, or |
| 427 // vice versa. | 427 // vice versa. |
| 428 // Note that we don't do this for popup windows, because we need to associate | 428 // Note that we don't do this for popup windows, because we need to associate |
| 429 // those with their extension_app_id. | 429 // those with their extension_app_id. |
| 430 if (disposition != NEW_POPUP) { | 430 if (disposition != WindowOpenDisposition::NEW_POPUP) { |
| 431 WebContents* associated_contents = GetAssociatedWebContents(); | 431 WebContents* associated_contents = GetAssociatedWebContents(); |
| 432 if (associated_contents && | 432 if (associated_contents && |
| 433 associated_contents->GetBrowserContext() == | 433 associated_contents->GetBrowserContext() == |
| 434 new_contents->GetBrowserContext()) { | 434 new_contents->GetBrowserContext()) { |
| 435 WebContentsDelegate* delegate = associated_contents->GetDelegate(); | 435 WebContentsDelegate* delegate = associated_contents->GetDelegate(); |
| 436 if (delegate) { | 436 if (delegate) { |
| 437 delegate->AddNewContents( | 437 delegate->AddNewContents( |
| 438 associated_contents, new_contents, disposition, initial_rect, | 438 associated_contents, new_contents, disposition, initial_rect, |
| 439 user_gesture, was_blocked); | 439 user_gesture, was_blocked); |
| 440 return; | 440 return; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 } | 486 } |
| 487 } else if (extension_host_type_ == VIEW_TYPE_EXTENSION_POPUP) { | 487 } else if (extension_host_type_ == VIEW_TYPE_EXTENSION_POPUP) { |
| 488 UMA_HISTOGRAM_MEDIUM_TIMES("Extensions.PopupLoadTime2", | 488 UMA_HISTOGRAM_MEDIUM_TIMES("Extensions.PopupLoadTime2", |
| 489 load_start_->Elapsed()); | 489 load_start_->Elapsed()); |
| 490 UMA_HISTOGRAM_MEDIUM_TIMES("Extensions.PopupCreateTime", | 490 UMA_HISTOGRAM_MEDIUM_TIMES("Extensions.PopupCreateTime", |
| 491 create_start_.Elapsed()); | 491 create_start_.Elapsed()); |
| 492 } | 492 } |
| 493 } | 493 } |
| 494 | 494 |
| 495 } // namespace extensions | 495 } // namespace extensions |
| OLD | NEW |