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/stringprintf.h" | 10 #include "base/stringprintf.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 29 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
30 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 30 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
31 #include "chrome/browser/web_applications/web_app.h" | 31 #include "chrome/browser/web_applications/web_app.h" |
32 #include "chrome/common/chrome_notification_types.h" | 32 #include "chrome/common/chrome_notification_types.h" |
33 #include "chrome/common/extensions/extension.h" | 33 #include "chrome/common/extensions/extension.h" |
34 #include "chrome/common/pref_names.h" | 34 #include "chrome/common/pref_names.h" |
35 #include "chrome/common/url_constants.h" | 35 #include "chrome/common/url_constants.h" |
36 #include "content/public/browser/browser_url_handler.h" | 36 #include "content/public/browser/browser_url_handler.h" |
37 #include "content/public/browser/notification_service.h" | 37 #include "content/public/browser/notification_service.h" |
38 #include "content/public/browser/render_view_host.h" | 38 #include "content/public/browser/render_view_host.h" |
39 #include "content/public/browser/render_view_host_delegate.h" | |
40 #include "content/public/browser/web_contents.h" | 39 #include "content/public/browser/web_contents.h" |
41 #include "net/http/http_util.h" | 40 #include "net/http/http_util.h" |
42 | 41 |
43 using content::GlobalRequestID; | 42 using content::GlobalRequestID; |
44 using content::WebContents; | 43 using content::WebContents; |
45 | 44 |
46 namespace { | 45 namespace { |
47 | 46 |
48 // Returns true if the specified Browser can open tabs. Not all Browsers support | 47 // Returns true if the specified Browser can open tabs. Not all Browsers support |
49 // multiple tabs, such as app frames and popups. This function returns false for | 48 // multiple tabs, such as app frames and popups. This function returns false for |
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 // TabStripModel::AddTabContents invokes HideContents if not foreground. | 534 // TabStripModel::AddTabContents invokes HideContents if not foreground. |
536 params->target_contents->web_contents()->WasHidden(); | 535 params->target_contents->web_contents()->WasHidden(); |
537 } | 536 } |
538 } else { | 537 } else { |
539 // ... otherwise if we're loading in the current tab, the target is the | 538 // ... otherwise if we're loading in the current tab, the target is the |
540 // same as the source. | 539 // same as the source. |
541 params->target_contents = params->source_contents; | 540 params->target_contents = params->source_contents; |
542 DCHECK(params->target_contents); | 541 DCHECK(params->target_contents); |
543 } | 542 } |
544 | 543 |
545 if (user_initiated) { | 544 if (user_initiated) |
546 params->target_contents->web_contents()->GetRenderViewHost()-> | 545 params->target_contents->web_contents()->UserGestureDone(); |
547 GetDelegate()->OnUserGesture(); | |
548 } | |
549 | 546 |
550 InitializeExtraHeaders(params, params->target_contents->profile(), | 547 InitializeExtraHeaders(params, params->target_contents->profile(), |
551 &extra_headers); | 548 &extra_headers); |
552 | 549 |
553 if (SwapInPrerender(params->target_contents, url)) | 550 if (SwapInPrerender(params->target_contents, url)) |
554 return; | 551 return; |
555 | 552 |
556 // Try to handle non-navigational URLs that popup dialogs and such, these | 553 // Try to handle non-navigational URLs that popup dialogs and such, these |
557 // should not actually navigate. | 554 // should not actually navigate. |
558 if (!HandleNonNavigationAboutURL(url)) { | 555 if (!HandleNonNavigationAboutURL(url)) { |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
677 return !(url.scheme() == chrome::kChromeUIScheme && | 674 return !(url.scheme() == chrome::kChromeUIScheme && |
678 (url.host() == chrome::kChromeUISettingsHost || | 675 (url.host() == chrome::kChromeUISettingsHost || |
679 url.host() == chrome::kChromeUISettingsFrameHost || | 676 url.host() == chrome::kChromeUISettingsFrameHost || |
680 url.host() == chrome::kChromeUIExtensionsHost || | 677 url.host() == chrome::kChromeUIExtensionsHost || |
681 url.host() == chrome::kChromeUIBookmarksHost || | 678 url.host() == chrome::kChromeUIBookmarksHost || |
682 url.host() == chrome::kChromeUISyncPromoHost || | 679 url.host() == chrome::kChromeUISyncPromoHost || |
683 url.host() == chrome::kChromeUIUberHost)); | 680 url.host() == chrome::kChromeUIUberHost)); |
684 } | 681 } |
685 | 682 |
686 } // namespace browser | 683 } // namespace browser |
OLD | NEW |