OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/browser.h" | 5 #include "chrome/browser/browser.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <shellapi.h> | 8 #include <shellapi.h> |
9 #include <windows.h> | 9 #include <windows.h> |
10 #endif // OS_WIN | 10 #endif // OS_WIN |
(...skipping 2339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2350 model->GetParentForNewNodes(), details, | 2350 model->GetParentForNewNodes(), details, |
2351 BookmarkEditor::SHOW_TREE); | 2351 BookmarkEditor::SHOW_TREE); |
2352 } | 2352 } |
2353 | 2353 |
2354 bool Browser::CanCloseTab() const { | 2354 bool Browser::CanCloseTab() const { |
2355 TabCloseableStateWatcher* watcher = | 2355 TabCloseableStateWatcher* watcher = |
2356 g_browser_process->tab_closeable_state_watcher(); | 2356 g_browser_process->tab_closeable_state_watcher(); |
2357 return !watcher || watcher->CanCloseTab(this); | 2357 return !watcher || watcher->CanCloseTab(this); |
2358 } | 2358 } |
2359 | 2359 |
2360 bool Browser::UseVerticalTabs() const { | |
2361 return use_vertical_tabs_.GetValue(); | |
2362 } | |
2363 | |
2364 void Browser::ToggleUseVerticalTabs() { | 2360 void Browser::ToggleUseVerticalTabs() { |
2365 use_vertical_tabs_.SetValue(!UseVerticalTabs()); | 2361 use_vertical_tabs_.SetValue(!UseVerticalTabs()); |
2366 UseVerticalTabsChanged(); | 2362 UseVerticalTabsChanged(); |
2367 } | 2363 } |
2368 | 2364 |
2369 void Browser::SetToolbarVisibility(bool visible) { | 2365 void Browser::SetToolbarVisibility(bool visible) { |
2370 window()->SetToolbarCollapsedMode(!visible); | 2366 window()->SetToolbarCollapsedMode(!visible); |
2371 } | 2367 } |
2372 | 2368 |
2373 /////////////////////////////////////////////////////////////////////////////// | 2369 /////////////////////////////////////////////////////////////////////////////// |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2689 GetStatusBubble()->SetURL( | 2685 GetStatusBubble()->SetURL( |
2690 url, UTF8ToWide(prefs->GetString(prefs::kAcceptLanguages))); | 2686 url, UTF8ToWide(prefs->GetString(prefs::kAcceptLanguages))); |
2691 } | 2687 } |
2692 } | 2688 } |
2693 | 2689 |
2694 void Browser::UpdateDownloadShelfVisibility(bool visible) { | 2690 void Browser::UpdateDownloadShelfVisibility(bool visible) { |
2695 if (GetStatusBubble()) | 2691 if (GetStatusBubble()) |
2696 GetStatusBubble()->UpdateDownloadShelfVisibility(visible); | 2692 GetStatusBubble()->UpdateDownloadShelfVisibility(visible); |
2697 } | 2693 } |
2698 | 2694 |
| 2695 bool Browser::UseVerticalTabs() const { |
| 2696 return use_vertical_tabs_.GetValue(); |
| 2697 } |
| 2698 |
2699 void Browser::ContentsZoomChange(bool zoom_in) { | 2699 void Browser::ContentsZoomChange(bool zoom_in) { |
2700 ExecuteCommand(zoom_in ? IDC_ZOOM_PLUS : IDC_ZOOM_MINUS); | 2700 ExecuteCommand(zoom_in ? IDC_ZOOM_PLUS : IDC_ZOOM_MINUS); |
2701 } | 2701 } |
2702 | 2702 |
2703 void Browser::OnContentSettingsChange(TabContents* source) { | 2703 void Browser::OnContentSettingsChange(TabContents* source) { |
2704 if (source == GetSelectedTabContents()) | 2704 if (source == GetSelectedTabContents()) |
2705 window_->GetLocationBar()->UpdateContentSettingsIcons(); | 2705 window_->GetLocationBar()->UpdateContentSettingsIcons(); |
2706 } | 2706 } |
2707 | 2707 |
2708 void Browser::SetTabContentBlocked(TabContents* contents, bool blocked) { | 2708 void Browser::SetTabContentBlocked(TabContents* contents, bool blocked) { |
(...skipping 1327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4036 } | 4036 } |
4037 | 4037 |
4038 bool Browser::IsPinned(TabContents* source) { | 4038 bool Browser::IsPinned(TabContents* source) { |
4039 int index = tabstrip_model_.GetIndexOfTabContents(source); | 4039 int index = tabstrip_model_.GetIndexOfTabContents(source); |
4040 if (index == TabStripModel::kNoTab) { | 4040 if (index == TabStripModel::kNoTab) { |
4041 NOTREACHED() << "IsPinned called for tab not in our strip"; | 4041 NOTREACHED() << "IsPinned called for tab not in our strip"; |
4042 return false; | 4042 return false; |
4043 } | 4043 } |
4044 return tabstrip_model_.IsTabPinned(index); | 4044 return tabstrip_model_.IsTabPinned(index); |
4045 } | 4045 } |
OLD | NEW |