| 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 | 4 |
| 5 #include "chrome/browser/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 #include "chrome/browser/ssl/ssl_cert_reporter.h" | 84 #include "chrome/browser/ssl/ssl_cert_reporter.h" |
| 85 #include "chrome/browser/ssl/ssl_client_certificate_selector.h" | 85 #include "chrome/browser/ssl/ssl_client_certificate_selector.h" |
| 86 #include "chrome/browser/ssl/ssl_error_handler.h" | 86 #include "chrome/browser/ssl/ssl_error_handler.h" |
| 87 #include "chrome/browser/subresource_filter/chrome_subresource_filter_client.h" | 87 #include "chrome/browser/subresource_filter/chrome_subresource_filter_client.h" |
| 88 #include "chrome/browser/sync_file_system/local/sync_file_system_backend.h" | 88 #include "chrome/browser/sync_file_system/local/sync_file_system_backend.h" |
| 89 #include "chrome/browser/tab_contents/tab_util.h" | 89 #include "chrome/browser/tab_contents/tab_util.h" |
| 90 #include "chrome/browser/tracing/chrome_tracing_delegate.h" | 90 #include "chrome/browser/tracing/chrome_tracing_delegate.h" |
| 91 #include "chrome/browser/translate/chrome_translate_client.h" | 91 #include "chrome/browser/translate/chrome_translate_client.h" |
| 92 #include "chrome/browser/ui/blocked_content/blocked_window_params.h" | 92 #include "chrome/browser/ui/blocked_content/blocked_window_params.h" |
| 93 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" | 93 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" |
| 94 #include "chrome/browser/ui/browser_finder.h" |
| 94 #include "chrome/browser/ui/browser_navigator.h" | 95 #include "chrome/browser/ui/browser_navigator.h" |
| 95 #include "chrome/browser/ui/browser_navigator_params.h" | 96 #include "chrome/browser/ui/browser_navigator_params.h" |
| 97 #include "chrome/browser/ui/browser_window.h" |
| 96 #include "chrome/browser/ui/chrome_select_file_policy.h" | 98 #include "chrome/browser/ui/chrome_select_file_policy.h" |
| 97 #include "chrome/browser/ui/sync/sync_promo_ui.h" | 99 #include "chrome/browser/ui/sync/sync_promo_ui.h" |
| 98 #include "chrome/browser/ui/tab_contents/chrome_web_contents_view_delegate.h" | 100 #include "chrome/browser/ui/tab_contents/chrome_web_contents_view_delegate.h" |
| 99 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" | 101 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" |
| 100 #include "chrome/browser/ui/webui/log_web_ui_url.h" | 102 #include "chrome/browser/ui/webui/log_web_ui_url.h" |
| 101 #include "chrome/browser/usb/usb_tab_helper.h" | 103 #include "chrome/browser/usb/usb_tab_helper.h" |
| 102 #include "chrome/common/channel_info.h" | 104 #include "chrome/common/channel_info.h" |
| 103 #include "chrome/common/chrome_constants.h" | 105 #include "chrome/common/chrome_constants.h" |
| 104 #include "chrome/common/chrome_features.h" | 106 #include "chrome/common/chrome_features.h" |
| 105 #include "chrome/common/chrome_paths.h" | 107 #include "chrome/common/chrome_paths.h" |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 | 534 |
| 533 // service_manager::Service: | 535 // service_manager::Service: |
| 534 void OnBindInterface(const service_manager::BindSourceInfo& remote_info, | 536 void OnBindInterface(const service_manager::BindSourceInfo& remote_info, |
| 535 const std::string& name, | 537 const std::string& name, |
| 536 mojo::ScopedMessagePipeHandle handle) override { | 538 mojo::ScopedMessagePipeHandle handle) override { |
| 537 interfaces_.BindInterface(remote_info, name, std::move(handle)); | 539 interfaces_.BindInterface(remote_info, name, std::move(handle)); |
| 538 } | 540 } |
| 539 | 541 |
| 540 // mash::mojom::Launchable: | 542 // mash::mojom::Launchable: |
| 541 void Launch(uint32_t what, mash::mojom::LaunchMode how) override { | 543 void Launch(uint32_t what, mash::mojom::LaunchMode how) override { |
| 542 if (how != mash::mojom::LaunchMode::MAKE_NEW) { | 544 bool is_incognito; |
| 543 LOG(ERROR) << "Unable to handle Launch request with how = " << how; | |
| 544 return; | |
| 545 } | |
| 546 switch (what) { | 545 switch (what) { |
| 547 case mash::mojom::kWindow: | 546 case mash::mojom::kWindow: |
| 548 CreateNewWindowImpl(false /* is_incognito */); | 547 is_incognito = false; |
| 549 break; | 548 break; |
| 550 case mash::mojom::kIncognitoWindow: | 549 case mash::mojom::kIncognitoWindow: |
| 551 CreateNewWindowImpl(true /* is_incognito */); | 550 is_incognito = true; |
| 552 break; | 551 break; |
| 553 default: | 552 default: |
| 554 NOTREACHED(); | 553 NOTREACHED(); |
| 555 } | 554 } |
| 555 |
| 556 bool reuse = how != mash::mojom::LaunchMode::MAKE_NEW; |
| 557 if (reuse) { |
| 558 Profile* profile = ProfileManager::GetActiveUserProfile(); |
| 559 Browser* browser = chrome::FindTabbedBrowser( |
| 560 is_incognito ? profile->GetOffTheRecordProfile() : profile, false); |
| 561 if (browser) { |
| 562 browser->window()->Show(); |
| 563 return; |
| 564 } |
| 565 } |
| 566 |
| 567 CreateNewWindowImpl(is_incognito); |
| 556 } | 568 } |
| 557 | 569 |
| 558 void Create(const service_manager::BindSourceInfo& source_info, | 570 void Create(const service_manager::BindSourceInfo& source_info, |
| 559 mash::mojom::LaunchableRequest request) { | 571 mash::mojom::LaunchableRequest request) { |
| 560 bindings_.AddBinding(this, std::move(request)); | 572 bindings_.AddBinding(this, std::move(request)); |
| 561 } | 573 } |
| 562 | 574 |
| 563 service_manager::BinderRegistry interfaces_; | 575 service_manager::BinderRegistry interfaces_; |
| 564 mojo::BindingSet<mash::mojom::Launchable> bindings_; | 576 mojo::BindingSet<mash::mojom::Launchable> bindings_; |
| 565 | 577 |
| (...skipping 3014 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3580 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { | 3592 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { |
| 3581 return variations::GetVariationParamValue( | 3593 return variations::GetVariationParamValue( |
| 3582 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; | 3594 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; |
| 3583 } | 3595 } |
| 3584 | 3596 |
| 3585 // static | 3597 // static |
| 3586 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( | 3598 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( |
| 3587 const storage::QuotaSettings* settings) { | 3599 const storage::QuotaSettings* settings) { |
| 3588 g_default_quota_settings = settings; | 3600 g_default_quota_settings = settings; |
| 3589 } | 3601 } |
| OLD | NEW |