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 5103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5114 } | 5114 } |
5115 | 5115 |
5116 // Centralized method for creating a TabContents, configuring and installing | 5116 // Centralized method for creating a TabContents, configuring and installing |
5117 // all its supporting objects and observers. | 5117 // all its supporting objects and observers. |
5118 TabContentsWrapper* Browser::TabContentsFactory( | 5118 TabContentsWrapper* Browser::TabContentsFactory( |
5119 Profile* profile, | 5119 Profile* profile, |
5120 SiteInstance* site_instance, | 5120 SiteInstance* site_instance, |
5121 int routing_id, | 5121 int routing_id, |
5122 const TabContents* base_tab_contents, | 5122 const TabContents* base_tab_contents, |
5123 SessionStorageNamespace* session_storage_namespace) { | 5123 SessionStorageNamespace* session_storage_namespace) { |
5124 TabContents* new_contents = new TabContents(profile, site_instance, | 5124 TabContents* new_contents = new TabContents( |
5125 routing_id, base_tab_contents, | 5125 profile, site_instance, routing_id, base_tab_contents ? |
5126 session_storage_namespace); | 5126 base_tab_contents->content_frame() : NULL, session_storage_namespace); |
5127 TabContentsWrapper* wrapper = new TabContentsWrapper(new_contents); | 5127 TabContentsWrapper* wrapper = new TabContentsWrapper(new_contents); |
5128 return wrapper; | 5128 return wrapper; |
5129 } | 5129 } |
5130 | 5130 |
5131 bool Browser::OpenInstant(WindowOpenDisposition disposition) { | 5131 bool Browser::OpenInstant(WindowOpenDisposition disposition) { |
5132 if (!instant() || !instant()->PrepareForCommit() || | 5132 if (!instant() || !instant()->PrepareForCommit() || |
5133 disposition == NEW_BACKGROUND_TAB) { | 5133 disposition == NEW_BACKGROUND_TAB) { |
5134 // NEW_BACKGROUND_TAB results in leaving the omnibox open, so we don't | 5134 // NEW_BACKGROUND_TAB results in leaving the omnibox open, so we don't |
5135 // attempt to use the instant preview. | 5135 // attempt to use the instant preview. |
5136 return false; | 5136 return false; |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5345 window_->GetLocationBar()->ShowFirstRunBubble(bubble_type); | 5345 window_->GetLocationBar()->ShowFirstRunBubble(bubble_type); |
5346 } else { | 5346 } else { |
5347 GlobalErrorService* service = | 5347 GlobalErrorService* service = |
5348 GlobalErrorServiceFactory::GetForProfile(profile()); | 5348 GlobalErrorServiceFactory::GetForProfile(profile()); |
5349 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); | 5349 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); |
5350 if (error) { | 5350 if (error) { |
5351 error->ShowBubbleView(this); | 5351 error->ShowBubbleView(this); |
5352 } | 5352 } |
5353 } | 5353 } |
5354 } | 5354 } |
OLD | NEW |