| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 // defined(OS_WIN) | 10 #endif // defined(OS_WIN) |
| (...skipping 898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 909 | 909 |
| 910 // Update the location bar. This is synchronous. We specifically don't | 910 // Update the location bar. This is synchronous. We specifically don't |
| 911 // update the load state since the load hasn't started yet and updating it | 911 // update the load state since the load hasn't started yet and updating it |
| 912 // will put it out of sync with the actual state like whether we're | 912 // will put it out of sync with the actual state like whether we're |
| 913 // displaying a favicon, which controls the throbber. If we updated it here, | 913 // displaying a favicon, which controls the throbber. If we updated it here, |
| 914 // the throbber will show the default favicon for a split second when | 914 // the throbber will show the default favicon for a split second when |
| 915 // navigating away from the new tab page. | 915 // navigating away from the new tab page. |
| 916 ScheduleUIUpdate(contents, content::INVALIDATE_TYPE_URL); | 916 ScheduleUIUpdate(contents, content::INVALIDATE_TYPE_URL); |
| 917 | 917 |
| 918 if (contents_is_selected) | 918 if (contents_is_selected) |
| 919 contents->Focus(); | 919 contents->GetView()->Focus(); |
| 920 } | 920 } |
| 921 | 921 |
| 922 /////////////////////////////////////////////////////////////////////////////// | 922 /////////////////////////////////////////////////////////////////////////////// |
| 923 // Browser, PageNavigator implementation: | 923 // Browser, PageNavigator implementation: |
| 924 | 924 |
| 925 WebContents* Browser::OpenURL(const OpenURLParams& params) { | 925 WebContents* Browser::OpenURL(const OpenURLParams& params) { |
| 926 return OpenURLFromTab(NULL, params); | 926 return OpenURLFromTab(NULL, params); |
| 927 } | 927 } |
| 928 | 928 |
| 929 /////////////////////////////////////////////////////////////////////////////// | 929 /////////////////////////////////////////////////////////////////////////////// |
| (...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1651 | 1651 |
| 1652 void Browser::SetWebContentsBlocked(content::WebContents* web_contents, | 1652 void Browser::SetWebContentsBlocked(content::WebContents* web_contents, |
| 1653 bool blocked) { | 1653 bool blocked) { |
| 1654 int index = tab_strip_model_->GetIndexOfWebContents(web_contents); | 1654 int index = tab_strip_model_->GetIndexOfWebContents(web_contents); |
| 1655 if (index == TabStripModel::kNoTab) { | 1655 if (index == TabStripModel::kNoTab) { |
| 1656 NOTREACHED(); | 1656 NOTREACHED(); |
| 1657 return; | 1657 return; |
| 1658 } | 1658 } |
| 1659 tab_strip_model_->SetTabBlocked(index, blocked); | 1659 tab_strip_model_->SetTabBlocked(index, blocked); |
| 1660 if (!blocked && tab_strip_model_->GetActiveWebContents() == web_contents) | 1660 if (!blocked && tab_strip_model_->GetActiveWebContents() == web_contents) |
| 1661 web_contents->Focus(); | 1661 web_contents->GetView()->Focus(); |
| 1662 } | 1662 } |
| 1663 | 1663 |
| 1664 bool Browser::GetDialogTopCenter(gfx::Point* point) { | 1664 bool Browser::GetDialogTopCenter(gfx::Point* point) { |
| 1665 int y = 0; | 1665 int y = 0; |
| 1666 if (window_->GetConstrainedWindowTopY(&y)) { | 1666 if (window_->GetConstrainedWindowTopY(&y)) { |
| 1667 *point = gfx::Point(window_->GetBounds().width() / 2, y); | 1667 *point = gfx::Point(window_->GetBounds().width() / 2, y); |
| 1668 return true; | 1668 return true; |
| 1669 } | 1669 } |
| 1670 | 1670 |
| 1671 return false; | 1671 return false; |
| (...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2249 if (contents && !allow_js_access) { | 2249 if (contents && !allow_js_access) { |
| 2250 contents->web_contents()->GetController().LoadURL( | 2250 contents->web_contents()->GetController().LoadURL( |
| 2251 target_url, | 2251 target_url, |
| 2252 content::Referrer(), | 2252 content::Referrer(), |
| 2253 content::PAGE_TRANSITION_LINK, | 2253 content::PAGE_TRANSITION_LINK, |
| 2254 std::string()); // No extra headers. | 2254 std::string()); // No extra headers. |
| 2255 } | 2255 } |
| 2256 | 2256 |
| 2257 return contents != NULL; | 2257 return contents != NULL; |
| 2258 } | 2258 } |
| OLD | NEW |