OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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.h" | 5 #include "chrome/browser/ui/browser.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #endif // OS_WIN | 10 #endif // OS_WIN |
(...skipping 3032 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3043 browser->LoadingStateChanged(detached_contents->tab_contents()); | 3043 browser->LoadingStateChanged(detached_contents->tab_contents()); |
3044 return browser; | 3044 return browser; |
3045 } | 3045 } |
3046 | 3046 |
3047 int Browser::GetDragActions() const { | 3047 int Browser::GetDragActions() const { |
3048 return TabStripModelDelegate::TAB_TEAROFF_ACTION | (tab_count() > 1 ? | 3048 return TabStripModelDelegate::TAB_TEAROFF_ACTION | (tab_count() > 1 ? |
3049 TabStripModelDelegate::TAB_MOVE_ACTION : 0); | 3049 TabStripModelDelegate::TAB_MOVE_ACTION : 0); |
3050 } | 3050 } |
3051 | 3051 |
3052 TabContentsWrapper* Browser::CreateTabContentsForURL( | 3052 TabContentsWrapper* Browser::CreateTabContentsForURL( |
3053 const GURL& url, const GURL& referrer, Profile* profile, | 3053 const GURL& url, const content::Referrer& referrer, Profile* profile, |
3054 content::PageTransition transition, bool defer_load, | 3054 content::PageTransition transition, bool defer_load, |
3055 SiteInstance* instance) const { | 3055 SiteInstance* instance) const { |
3056 TabContentsWrapper* contents = TabContentsFactory(profile, instance, | 3056 TabContentsWrapper* contents = TabContentsFactory(profile, instance, |
3057 MSG_ROUTING_NONE, | 3057 MSG_ROUTING_NONE, |
3058 GetSelectedTabContents(), NULL); | 3058 GetSelectedTabContents(), NULL); |
3059 if (!defer_load) { | 3059 if (!defer_load) { |
3060 // Load the initial URL before adding the new tab contents to the tab strip | 3060 // Load the initial URL before adding the new tab contents to the tab strip |
3061 // so that the tab contents has navigation state. | 3061 // so that the tab contents has navigation state. |
3062 contents->controller().LoadURL( | 3062 contents->controller().LoadURL(url, referrer, transition, std::string()); |
3063 url, | |
3064 content::Referrer(referrer, WebKit::WebReferrerPolicyDefault), | |
3065 transition, | |
3066 std::string()); | |
3067 } | 3063 } |
3068 | 3064 |
3069 return contents; | 3065 return contents; |
3070 } | 3066 } |
3071 | 3067 |
3072 bool Browser::CanDuplicateContentsAt(int index) { | 3068 bool Browser::CanDuplicateContentsAt(int index) { |
3073 NavigationController& nc = GetTabContentsAt(index)->controller(); | 3069 NavigationController& nc = GetTabContentsAt(index)->controller(); |
3074 return nc.tab_contents() && nc.GetLastCommittedEntry(); | 3070 return nc.tab_contents() && nc.GetLastCommittedEntry(); |
3075 } | 3071 } |
3076 | 3072 |
(...skipping 2249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5326 window_->GetLocationBar()->ShowFirstRunBubble(bubble_type); | 5322 window_->GetLocationBar()->ShowFirstRunBubble(bubble_type); |
5327 } else { | 5323 } else { |
5328 GlobalErrorService* service = | 5324 GlobalErrorService* service = |
5329 GlobalErrorServiceFactory::GetForProfile(profile()); | 5325 GlobalErrorServiceFactory::GetForProfile(profile()); |
5330 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); | 5326 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); |
5331 if (error) { | 5327 if (error) { |
5332 error->ShowBubbleView(this); | 5328 error->ShowBubbleView(this); |
5333 } | 5329 } |
5334 } | 5330 } |
5335 } | 5331 } |
OLD | NEW |