| 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/ui/browser_navigator.h" | 5 #include "chrome/browser/ui/browser_navigator.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/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "chrome/browser/ui/browser_instant_controller.h" | 22 #include "chrome/browser/ui/browser_instant_controller.h" |
| 23 #include "chrome/browser/ui/browser_window.h" | 23 #include "chrome/browser/ui/browser_window.h" |
| 24 #include "chrome/browser/ui/host_desktop.h" | 24 #include "chrome/browser/ui/host_desktop.h" |
| 25 #include "chrome/browser/ui/location_bar/location_bar.h" | 25 #include "chrome/browser/ui/location_bar/location_bar.h" |
| 26 #include "chrome/browser/ui/search/instant_search_prerenderer.h" | 26 #include "chrome/browser/ui/search/instant_search_prerenderer.h" |
| 27 #include "chrome/browser/ui/singleton_tabs.h" | 27 #include "chrome/browser/ui/singleton_tabs.h" |
| 28 #include "chrome/browser/ui/status_bubble.h" | 28 #include "chrome/browser/ui/status_bubble.h" |
| 29 #include "chrome/browser/ui/tab_helpers.h" | 29 #include "chrome/browser/ui/tab_helpers.h" |
| 30 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 30 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 31 #include "chrome/common/url_constants.h" | 31 #include "chrome/common/url_constants.h" |
| 32 #include "components/user_manager/user_id.h" |
| 32 #include "content/public/browser/browser_url_handler.h" | 33 #include "content/public/browser/browser_url_handler.h" |
| 33 #include "content/public/browser/navigation_entry.h" | 34 #include "content/public/browser/navigation_entry.h" |
| 34 #include "content/public/browser/notification_service.h" | 35 #include "content/public/browser/notification_service.h" |
| 35 #include "content/public/browser/render_view_host.h" | 36 #include "content/public/browser/render_view_host.h" |
| 36 #include "content/public/browser/web_contents.h" | 37 #include "content/public/browser/web_contents.h" |
| 37 | 38 |
| 38 #if defined(USE_ASH) | 39 #if defined(USE_ASH) |
| 39 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" | 40 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" |
| 40 #endif | 41 #endif |
| 41 | 42 |
| (...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 533 #if defined(USE_ASH) | 534 #if defined(USE_ASH) |
| 534 if (source_browser && source_browser != params->browser) { | 535 if (source_browser && source_browser != params->browser) { |
| 535 // When the newly created browser was spawned by a browser which visits | 536 // When the newly created browser was spawned by a browser which visits |
| 536 // another user's desktop, it should be shown on the same desktop as the | 537 // another user's desktop, it should be shown on the same desktop as the |
| 537 // originating one. (This is part of the desktop separation per profile). | 538 // originating one. (This is part of the desktop separation per profile). |
| 538 MultiUserWindowManager* manager = MultiUserWindowManager::GetInstance(); | 539 MultiUserWindowManager* manager = MultiUserWindowManager::GetInstance(); |
| 539 // Some unit tests have no manager instantiated. | 540 // Some unit tests have no manager instantiated. |
| 540 if (manager) { | 541 if (manager) { |
| 541 aura::Window* src_window = source_browser->window()->GetNativeWindow(); | 542 aura::Window* src_window = source_browser->window()->GetNativeWindow(); |
| 542 aura::Window* new_window = params->browser->window()->GetNativeWindow(); | 543 aura::Window* new_window = params->browser->window()->GetNativeWindow(); |
| 543 const std::string& src_user = | 544 const user_manager::UserID& src_user = |
| 544 manager->GetUserPresentingWindow(src_window); | 545 manager->GetUserPresentingWindow(src_window); |
| 545 if (src_user != manager->GetUserPresentingWindow(new_window)) { | 546 if (src_user != manager->GetUserPresentingWindow(new_window)) { |
| 546 // Once the window gets presented, it should be shown on the same | 547 // Once the window gets presented, it should be shown on the same |
| 547 // desktop as the desktop of the creating browser. Note that this | 548 // desktop as the desktop of the creating browser. Note that this |
| 548 // command will not show the window if it wasn't shown yet by the | 549 // command will not show the window if it wasn't shown yet by the |
| 549 // browser creation. | 550 // browser creation. |
| 550 manager->ShowWindowForUser(new_window, src_user); | 551 manager->ShowWindowForUser(new_window, src_user); |
| 551 } | 552 } |
| 552 } | 553 } |
| 553 } | 554 } |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 751 bool reverse_on_redirect = false; | 752 bool reverse_on_redirect = false; |
| 752 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( | 753 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( |
| 753 &rewritten_url, browser_context, &reverse_on_redirect); | 754 &rewritten_url, browser_context, &reverse_on_redirect); |
| 754 | 755 |
| 755 // Some URLs are mapped to uber subpages. Do not allow them in incognito. | 756 // Some URLs are mapped to uber subpages. Do not allow them in incognito. |
| 756 return !(rewritten_url.scheme() == content::kChromeUIScheme && | 757 return !(rewritten_url.scheme() == content::kChromeUIScheme && |
| 757 rewritten_url.host() == chrome::kChromeUIUberHost); | 758 rewritten_url.host() == chrome::kChromeUIUberHost); |
| 758 } | 759 } |
| 759 | 760 |
| 760 } // namespace chrome | 761 } // namespace chrome |
| OLD | NEW |