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 3329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3340 browser::NavigateParams params(this, new_wrapper); | 3340 browser::NavigateParams params(this, new_wrapper); |
3341 params.source_contents = | 3341 params.source_contents = |
3342 source ? tabstrip_model()->GetTabContentsAt( | 3342 source ? tabstrip_model()->GetTabContentsAt( |
3343 tabstrip_model()->GetWrapperIndex(source)) | 3343 tabstrip_model()->GetWrapperIndex(source)) |
3344 : NULL; | 3344 : NULL; |
3345 params.disposition = disposition; | 3345 params.disposition = disposition; |
3346 params.window_bounds = initial_pos; | 3346 params.window_bounds = initial_pos; |
3347 params.window_action = browser::NavigateParams::SHOW_WINDOW; | 3347 params.window_action = browser::NavigateParams::SHOW_WINDOW; |
3348 params.user_gesture = user_gesture; | 3348 params.user_gesture = user_gesture; |
3349 browser::Navigate(¶ms); | 3349 browser::Navigate(¶ms); |
3350 | |
3351 NotificationService::current()->Notify( | |
3352 content::NOTIFICATION_TAB_ADDED, | |
3353 Source<TabContentsDelegate>(this), | |
3354 Details<TabContents>(new_contents)); | |
3355 } | 3350 } |
3356 | 3351 |
3357 void Browser::ActivateContents(TabContents* contents) { | 3352 void Browser::ActivateContents(TabContents* contents) { |
3358 tab_handler_->GetTabStripModel()->ActivateTabAt( | 3353 tab_handler_->GetTabStripModel()->ActivateTabAt( |
3359 tab_handler_->GetTabStripModel()->GetWrapperIndex(contents), false); | 3354 tab_handler_->GetTabStripModel()->GetWrapperIndex(contents), false); |
3360 window_->Activate(); | 3355 window_->Activate(); |
3361 } | 3356 } |
3362 | 3357 |
3363 void Browser::DeactivateContents(TabContents* contents) { | 3358 void Browser::DeactivateContents(TabContents* contents) { |
3364 window_->Deactivate(); | 3359 window_->Deactivate(); |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3766 intent_id); | 3761 intent_id); |
3767 } | 3762 } |
3768 | 3763 |
3769 void Browser::ExitTabbedFullscreenModeIfNecessary() { | 3764 void Browser::ExitTabbedFullscreenModeIfNecessary() { |
3770 if (tab_caused_fullscreen_) | 3765 if (tab_caused_fullscreen_) |
3771 ToggleFullscreenMode(); | 3766 ToggleFullscreenMode(); |
3772 else | 3767 else |
3773 NotifyTabOfFullscreenExitIfNecessary(); | 3768 NotifyTabOfFullscreenExitIfNecessary(); |
3774 } | 3769 } |
3775 | 3770 |
| 3771 void Browser::UpdatePreferredSize(TabContents* source, |
| 3772 const gfx::Size& pref_size) { |
| 3773 window_->UpdatePreferredSize(source, pref_size); |
| 3774 } |
| 3775 |
3776 /////////////////////////////////////////////////////////////////////////////// | 3776 /////////////////////////////////////////////////////////////////////////////// |
3777 // Browser, TabContentsWrapperDelegate implementation: | 3777 // Browser, TabContentsWrapperDelegate implementation: |
3778 | 3778 |
3779 void Browser::OnDidGetApplicationInfo(TabContentsWrapper* source, | 3779 void Browser::OnDidGetApplicationInfo(TabContentsWrapper* source, |
3780 int32 page_id) { | 3780 int32 page_id) { |
3781 if (GetSelectedTabContentsWrapper() != source) | 3781 if (GetSelectedTabContentsWrapper() != source) |
3782 return; | 3782 return; |
3783 | 3783 |
3784 NavigationEntry* entry = source->controller().GetLastCommittedEntry(); | 3784 NavigationEntry* entry = source->controller().GetLastCommittedEntry(); |
3785 if (!entry || (entry->page_id() != page_id)) | 3785 if (!entry || (entry->page_id() != page_id)) |
(...skipping 1334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5120 } | 5120 } |
5121 | 5121 |
5122 void Browser::ShowSyncSetup() { | 5122 void Browser::ShowSyncSetup() { |
5123 ProfileSyncService* service = | 5123 ProfileSyncService* service = |
5124 profile()->GetOriginalProfile()->GetProfileSyncService(); | 5124 profile()->GetOriginalProfile()->GetProfileSyncService(); |
5125 if (service->HasSyncSetupCompleted()) | 5125 if (service->HasSyncSetupCompleted()) |
5126 ShowOptionsTab(chrome::kSyncSetupSubPage); | 5126 ShowOptionsTab(chrome::kSyncSetupSubPage); |
5127 else | 5127 else |
5128 service->ShowLoginDialog(); | 5128 service->ShowLoginDialog(); |
5129 } | 5129 } |
OLD | NEW |