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 3141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3152 browser::NavigateParams params(this, new_wrapper); | 3152 browser::NavigateParams params(this, new_wrapper); |
3153 params.source_contents = | 3153 params.source_contents = |
3154 source ? tabstrip_model()->GetTabContentsAt( | 3154 source ? tabstrip_model()->GetTabContentsAt( |
3155 tabstrip_model()->GetWrapperIndex(source)) | 3155 tabstrip_model()->GetWrapperIndex(source)) |
3156 : NULL; | 3156 : NULL; |
3157 params.disposition = disposition; | 3157 params.disposition = disposition; |
3158 params.window_bounds = initial_pos; | 3158 params.window_bounds = initial_pos; |
3159 params.window_action = browser::NavigateParams::SHOW_WINDOW; | 3159 params.window_action = browser::NavigateParams::SHOW_WINDOW; |
3160 params.user_gesture = user_gesture; | 3160 params.user_gesture = user_gesture; |
3161 browser::Navigate(¶ms); | 3161 browser::Navigate(¶ms); |
3162 | |
3163 NotificationService::current()->Notify( | |
3164 content::NOTIFICATION_TAB_ADDED, | |
3165 Source<TabContentsDelegate>(this), | |
3166 Details<TabContents>(new_contents)); | |
3167 } | 3162 } |
3168 | 3163 |
3169 void Browser::ActivateContents(TabContents* contents) { | 3164 void Browser::ActivateContents(TabContents* contents) { |
3170 tab_handler_->GetTabStripModel()->ActivateTabAt( | 3165 tab_handler_->GetTabStripModel()->ActivateTabAt( |
3171 tab_handler_->GetTabStripModel()->GetWrapperIndex(contents), false); | 3166 tab_handler_->GetTabStripModel()->GetWrapperIndex(contents), false); |
3172 window_->Activate(); | 3167 window_->Activate(); |
3173 } | 3168 } |
3174 | 3169 |
3175 void Browser::DeactivateContents(TabContents* contents) { | 3170 void Browser::DeactivateContents(TabContents* contents) { |
3176 window_->Deactivate(); | 3171 window_->Deactivate(); |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3515 | 3510 |
3516 void Browser::DidNavigateToPendingEntry(TabContents* tab) { | 3511 void Browser::DidNavigateToPendingEntry(TabContents* tab) { |
3517 if (tab == GetSelectedTabContents()) | 3512 if (tab == GetSelectedTabContents()) |
3518 UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TAB_STATE); | 3513 UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TAB_STATE); |
3519 } | 3514 } |
3520 | 3515 |
3521 content::JavaScriptDialogCreator* Browser::GetJavaScriptDialogCreator() { | 3516 content::JavaScriptDialogCreator* Browser::GetJavaScriptDialogCreator() { |
3522 return GetJavaScriptDialogCreatorInstance(); | 3517 return GetJavaScriptDialogCreatorInstance(); |
3523 } | 3518 } |
3524 | 3519 |
| 3520 void Browser::UpdatePreferredSize(TabContents* source, |
| 3521 const gfx::Size& pref_size) { |
| 3522 window_->UpdatePreferredSize(source, pref_size); |
| 3523 } |
| 3524 |
3525 /////////////////////////////////////////////////////////////////////////////// | 3525 /////////////////////////////////////////////////////////////////////////////// |
3526 // Browser, TabContentsWrapperDelegate implementation: | 3526 // Browser, TabContentsWrapperDelegate implementation: |
3527 | 3527 |
3528 void Browser::OnDidGetApplicationInfo(TabContentsWrapper* source, | 3528 void Browser::OnDidGetApplicationInfo(TabContentsWrapper* source, |
3529 int32 page_id) { | 3529 int32 page_id) { |
3530 if (GetSelectedTabContentsWrapper() != source) | 3530 if (GetSelectedTabContentsWrapper() != source) |
3531 return; | 3531 return; |
3532 | 3532 |
3533 NavigationEntry* entry = source->controller().GetLastCommittedEntry(); | 3533 NavigationEntry* entry = source->controller().GetLastCommittedEntry(); |
3534 if (!entry || (entry->page_id() != page_id)) | 3534 if (!entry || (entry->page_id() != page_id)) |
(...skipping 1319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4854 } | 4854 } |
4855 | 4855 |
4856 void Browser::ShowSyncSetup() { | 4856 void Browser::ShowSyncSetup() { |
4857 ProfileSyncService* service = | 4857 ProfileSyncService* service = |
4858 profile()->GetOriginalProfile()->GetProfileSyncService(); | 4858 profile()->GetOriginalProfile()->GetProfileSyncService(); |
4859 if (service->HasSyncSetupCompleted()) | 4859 if (service->HasSyncSetupCompleted()) |
4860 ShowOptionsTab(chrome::kSyncSetupSubPage); | 4860 ShowOptionsTab(chrome::kSyncSetupSubPage); |
4861 else | 4861 else |
4862 service->ShowLoginDialog(); | 4862 service->ShowLoginDialog(); |
4863 } | 4863 } |
OLD | NEW |