| 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 1814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1825 // Browser, SearchEngineTabHelperDelegate implementation: | 1825 // Browser, SearchEngineTabHelperDelegate implementation: |
| 1826 | 1826 |
| 1827 void Browser::ConfirmAddSearchProvider(TemplateURL* template_url, | 1827 void Browser::ConfirmAddSearchProvider(TemplateURL* template_url, |
| 1828 Profile* profile) { | 1828 Profile* profile) { |
| 1829 window()->ConfirmAddSearchProvider(template_url, profile); | 1829 window()->ConfirmAddSearchProvider(template_url, profile); |
| 1830 } | 1830 } |
| 1831 | 1831 |
| 1832 /////////////////////////////////////////////////////////////////////////////// | 1832 /////////////////////////////////////////////////////////////////////////////// |
| 1833 // Browser, ConstrainedWindowTabHelperDelegate implementation: | 1833 // Browser, ConstrainedWindowTabHelperDelegate implementation: |
| 1834 | 1834 |
| 1835 void Browser::SetTabContentBlocked(content::WebContents* web_contents, | 1835 void Browser::SetWebContentsBlocked(content::WebContents* web_contents, |
| 1836 bool blocked) { | 1836 bool blocked) { |
| 1837 int index = tab_strip_model_->GetIndexOfWebContents(web_contents); | 1837 int index = tab_strip_model_->GetIndexOfWebContents(web_contents); |
| 1838 if (index == TabStripModel::kNoTab) { | 1838 if (index == TabStripModel::kNoTab) { |
| 1839 NOTREACHED(); | 1839 NOTREACHED(); |
| 1840 return; | 1840 return; |
| 1841 } | 1841 } |
| 1842 tab_strip_model_->SetTabBlocked(index, blocked); | 1842 tab_strip_model_->SetTabBlocked(index, blocked); |
| 1843 if (!blocked && tab_strip_model_->GetActiveWebContents() == web_contents) | 1843 if (!blocked && tab_strip_model_->GetActiveWebContents() == web_contents) |
| 1844 web_contents->Focus(); | 1844 web_contents->Focus(); |
| 1845 } | 1845 } |
| 1846 | 1846 |
| 1847 bool Browser::GetConstrainedWindowTopCenter(gfx::Point* point) { | 1847 bool Browser::GetDialogTopCenter(gfx::Point* point) { |
| 1848 int y = 0; | 1848 int y = 0; |
| 1849 if (window_->GetConstrainedWindowTopY(&y)) { | 1849 if (window_->GetConstrainedWindowTopY(&y)) { |
| 1850 *point = gfx::Point(window_->GetBounds().width() / 2, y); | 1850 *point = gfx::Point(window_->GetBounds().width() / 2, y); |
| 1851 return true; | 1851 return true; |
| 1852 } | 1852 } |
| 1853 | 1853 |
| 1854 return false; | 1854 return false; |
| 1855 } | 1855 } |
| 1856 | 1856 |
| 1857 /////////////////////////////////////////////////////////////////////////////// | 1857 /////////////////////////////////////////////////////////////////////////////// |
| (...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2441 if (contents && !allow_js_access) { | 2441 if (contents && !allow_js_access) { |
| 2442 contents->web_contents()->GetController().LoadURL( | 2442 contents->web_contents()->GetController().LoadURL( |
| 2443 target_url, | 2443 target_url, |
| 2444 content::Referrer(), | 2444 content::Referrer(), |
| 2445 content::PAGE_TRANSITION_LINK, | 2445 content::PAGE_TRANSITION_LINK, |
| 2446 std::string()); // No extra headers. | 2446 std::string()); // No extra headers. |
| 2447 } | 2447 } |
| 2448 | 2448 |
| 2449 return contents != NULL; | 2449 return contents != NULL; |
| 2450 } | 2450 } |
| OLD | NEW |