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 1711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1722 | 1722 |
1723 /////////////////////////////////////////////////////////////////////////////// | 1723 /////////////////////////////////////////////////////////////////////////////// |
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, MetroPinTabHelperDelegate implementation: |
| 1733 |
| 1734 void Browser::IsPinnedChanged(content::WebContents* source, bool is_pinned) { |
| 1735 #if defined(OS_WIN) |
| 1736 if (source == chrome::GetActiveWebContents(this)) |
| 1737 window_->SetMetroPinnedState(is_pinned); |
| 1738 #endif |
| 1739 } |
| 1740 |
| 1741 /////////////////////////////////////////////////////////////////////////////// |
1732 // Browser, ZoomObserver implementation: | 1742 // Browser, ZoomObserver implementation: |
1733 | 1743 |
1734 void Browser::OnZoomIconChanged(TabContents* source, | 1744 void Browser::OnZoomIconChanged(TabContents* source, |
1735 ZoomController::ZoomIconState state) { | 1745 ZoomController::ZoomIconState state) { |
1736 if (source == chrome::GetActiveTabContents(this)) | 1746 if (source == chrome::GetActiveTabContents(this)) |
1737 window_->SetZoomIconState(state); | 1747 window_->SetZoomIconState(state); |
1738 } | 1748 } |
1739 | 1749 |
1740 void Browser::OnZoomChanged(TabContents* source, | 1750 void Browser::OnZoomChanged(TabContents* source, |
1741 int zoom_percent, | 1751 int zoom_percent, |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2084 // WebContents... | 2094 // WebContents... |
2085 tab->web_contents()->SetDelegate(delegate); | 2095 tab->web_contents()->SetDelegate(delegate); |
2086 | 2096 |
2087 // ...and all the helpers. | 2097 // ...and all the helpers. |
2088 tab->blocked_content_tab_helper()->set_delegate(delegate); | 2098 tab->blocked_content_tab_helper()->set_delegate(delegate); |
2089 tab->bookmark_tab_helper()->set_delegate(delegate); | 2099 tab->bookmark_tab_helper()->set_delegate(delegate); |
2090 tab->zoom_controller()->set_observer(delegate); | 2100 tab->zoom_controller()->set_observer(delegate); |
2091 tab->constrained_window_tab_helper()->set_delegate(delegate); | 2101 tab->constrained_window_tab_helper()->set_delegate(delegate); |
2092 tab->core_tab_helper()->set_delegate(delegate); | 2102 tab->core_tab_helper()->set_delegate(delegate); |
2093 tab->search_engine_tab_helper()->set_delegate(delegate); | 2103 tab->search_engine_tab_helper()->set_delegate(delegate); |
| 2104 tab->metro_pin_tab_helper()->set_delegate(delegate); |
2094 } | 2105 } |
2095 | 2106 |
2096 void Browser::CloseFrame() { | 2107 void Browser::CloseFrame() { |
2097 window_->Close(); | 2108 window_->Close(); |
2098 } | 2109 } |
2099 | 2110 |
2100 void Browser::TabDetachedAtImpl(TabContents* contents, int index, | 2111 void Browser::TabDetachedAtImpl(TabContents* contents, int index, |
2101 DetachType type) { | 2112 DetachType type) { |
2102 if (type == DETACH_TYPE_DETACH) { | 2113 if (type == DETACH_TYPE_DETACH) { |
2103 // Save the current location bar state, but only if the tab being detached | 2114 // Save the current location bar state, but only if the tab being detached |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2275 if (contents && !allow_js_access) { | 2286 if (contents && !allow_js_access) { |
2276 contents->web_contents()->GetController().LoadURL( | 2287 contents->web_contents()->GetController().LoadURL( |
2277 target_url, | 2288 target_url, |
2278 content::Referrer(), | 2289 content::Referrer(), |
2279 content::PAGE_TRANSITION_LINK, | 2290 content::PAGE_TRANSITION_LINK, |
2280 std::string()); // No extra headers. | 2291 std::string()); // No extra headers. |
2281 } | 2292 } |
2282 | 2293 |
2283 return contents != NULL; | 2294 return contents != NULL; |
2284 } | 2295 } |
OLD | NEW |