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 3395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3406 ui::Animation::ShouldRenderRichAnimation()) { | 3406 ui::Animation::ShouldRenderRichAnimation()) { |
3407 DownloadStartedAnimation::Show(shelf_tab); | 3407 DownloadStartedAnimation::Show(shelf_tab); |
3408 } | 3408 } |
3409 #endif | 3409 #endif |
3410 | 3410 |
3411 // If the download occurs in a new tab, close it. | 3411 // If the download occurs in a new tab, close it. |
3412 if (source->controller().IsInitialNavigation() && tab_count() > 1) | 3412 if (source->controller().IsInitialNavigation() && tab_count() > 1) |
3413 CloseContents(source); | 3413 CloseContents(source); |
3414 } | 3414 } |
3415 | 3415 |
3416 void Browser::ShowPageInfo(Profile* profile, | 3416 void Browser::ShowPageInfo(content::BrowserContext* browser_context, |
3417 const GURL& url, | 3417 const GURL& url, |
3418 const NavigationEntry::SSLStatus& ssl, | 3418 const NavigationEntry::SSLStatus& ssl, |
3419 bool show_history) { | 3419 bool show_history) { |
| 3420 Profile* profile = Profile::FromBrowserContext(browser_context); |
3420 window()->ShowPageInfo(profile, url, ssl, show_history); | 3421 window()->ShowPageInfo(profile, url, ssl, show_history); |
3421 } | 3422 } |
3422 | 3423 |
3423 void Browser::ViewSourceForTab(TabContents* source, const GURL& page_url) { | 3424 void Browser::ViewSourceForTab(TabContents* source, const GURL& page_url) { |
3424 DCHECK(source); | 3425 DCHECK(source); |
3425 int index = tabstrip_model()->GetWrapperIndex(source); | 3426 int index = tabstrip_model()->GetWrapperIndex(source); |
3426 TabContentsWrapper* wrapper = tabstrip_model()->GetTabContentsAt(index); | 3427 TabContentsWrapper* wrapper = tabstrip_model()->GetTabContentsAt(index); |
3427 ViewSource(wrapper); | 3428 ViewSource(wrapper); |
3428 } | 3429 } |
3429 | 3430 |
(...skipping 1372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4802 window_->BookmarkBarStateChanged(animate_type); | 4803 window_->BookmarkBarStateChanged(animate_type); |
4803 } | 4804 } |
4804 | 4805 |
4805 void Browser::ShowSyncSetup() { | 4806 void Browser::ShowSyncSetup() { |
4806 ProfileSyncService* service = profile()->GetProfileSyncService(); | 4807 ProfileSyncService* service = profile()->GetProfileSyncService(); |
4807 if (service->HasSyncSetupCompleted()) | 4808 if (service->HasSyncSetupCompleted()) |
4808 ShowOptionsTab(chrome::kSyncSetupSubPage); | 4809 ShowOptionsTab(chrome::kSyncSetupSubPage); |
4809 else | 4810 else |
4810 profile()->GetProfileSyncService()->ShowLoginDialog(); | 4811 profile()->GetProfileSyncService()->ShowLoginDialog(); |
4811 } | 4812 } |
OLD | NEW |