OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 1713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1724 // Browser, BookmarkTabHelperDelegate implementation: | 1724 // Browser, BookmarkTabHelperDelegate implementation: |
1725 | 1725 |
1726 void Browser::URLStarredChanged(TabContents* source, bool starred) { | 1726 void Browser::URLStarredChanged(TabContents* source, bool starred) { |
1727 if (source == chrome::GetActiveTabContents(this)) | 1727 if (source == chrome::GetActiveTabContents(this)) |
1728 window_->SetStarredState(starred); | 1728 window_->SetStarredState(starred); |
1729 } | 1729 } |
1730 | 1730 |
1731 /////////////////////////////////////////////////////////////////////////////// | 1731 /////////////////////////////////////////////////////////////////////////////// |
1732 // Browser, ZoomObserver implementation: | 1732 // Browser, ZoomObserver implementation: |
1733 | 1733 |
1734 void Browser::OnZoomIconChanged(TabContents* source, | 1734 void Browser::OnZoomChanged(TabContents* source, bool can_show_bubble) { |
1735 ZoomController::ZoomIconState state) { | |
1736 if (source == chrome::GetActiveTabContents(this)) | |
1737 window_->SetZoomIconState(state); | |
1738 } | |
1739 | |
1740 void Browser::OnZoomChanged(TabContents* source, | |
1741 int zoom_percent, | |
1742 bool can_show_bubble) { | |
1743 if (source == chrome::GetActiveTabContents(this)) { | 1735 if (source == chrome::GetActiveTabContents(this)) { |
1744 window_->SetZoomIconTooltipPercent(zoom_percent); | |
1745 | |
1746 // Only show the zoom bubble for zoom changes in the active window. | 1736 // Only show the zoom bubble for zoom changes in the active window. |
1747 if (can_show_bubble && window_->IsActive()) | 1737 window_->ZoomChangedForActiveTab(can_show_bubble && window_->IsActive()); |
Kyle Horimoto
2012/07/24 20:08:11
Also, is there a better method name we can think o
Evan Stade
2012/07/24 20:12:49
I think it's fine because "active" is the term tha
| |
1748 window_->ShowZoomBubble(zoom_percent); | |
1749 } | 1738 } |
1750 } | 1739 } |
1751 | 1740 |
1752 /////////////////////////////////////////////////////////////////////////////// | 1741 /////////////////////////////////////////////////////////////////////////////// |
1753 // Browser, SelectFileDialog::Listener implementation: | 1742 // Browser, SelectFileDialog::Listener implementation: |
1754 | 1743 |
1755 void Browser::FileSelected(const FilePath& path, int index, void* params) { | 1744 void Browser::FileSelected(const FilePath& path, int index, void* params) { |
1756 profile_->set_last_selected_directory(path.DirName()); | 1745 profile_->set_last_selected_directory(path.DirName()); |
1757 GURL file_url = net::FilePathToFileURL(path); | 1746 GURL file_url = net::FilePathToFileURL(path); |
1758 | 1747 |
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2275 if (contents && !allow_js_access) { | 2264 if (contents && !allow_js_access) { |
2276 contents->web_contents()->GetController().LoadURL( | 2265 contents->web_contents()->GetController().LoadURL( |
2277 target_url, | 2266 target_url, |
2278 content::Referrer(), | 2267 content::Referrer(), |
2279 content::PAGE_TRANSITION_LINK, | 2268 content::PAGE_TRANSITION_LINK, |
2280 std::string()); // No extra headers. | 2269 std::string()); // No extra headers. |
2281 } | 2270 } |
2282 | 2271 |
2283 return contents != NULL; | 2272 return contents != NULL; |
2284 } | 2273 } |
OLD | NEW |