| 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 1504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1515 void Browser::DidNavigateToPendingEntry(WebContents* web_contents) { | 1515 void Browser::DidNavigateToPendingEntry(WebContents* web_contents) { |
| 1516 if (web_contents == tab_strip_model_->GetActiveWebContents()) | 1516 if (web_contents == tab_strip_model_->GetActiveWebContents()) |
| 1517 UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TAB_STATE); | 1517 UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TAB_STATE); |
| 1518 } | 1518 } |
| 1519 | 1519 |
| 1520 content::JavaScriptDialogManager* Browser::GetJavaScriptDialogManager() { | 1520 content::JavaScriptDialogManager* Browser::GetJavaScriptDialogManager() { |
| 1521 return GetJavaScriptDialogManagerInstance(); | 1521 return GetJavaScriptDialogManagerInstance(); |
| 1522 } | 1522 } |
| 1523 | 1523 |
| 1524 content::ColorChooser* Browser::OpenColorChooser(WebContents* web_contents, | 1524 content::ColorChooser* Browser::OpenColorChooser(WebContents* web_contents, |
| 1525 int color_chooser_id, | 1525 SkColor initial_color) { |
| 1526 SkColor color) { | 1526 return content::ColorChooser::Open(web_contents, initial_color); |
| 1527 #if defined(OS_WIN) | |
| 1528 // On Windows, only create a color chooser if one doesn't exist, because we | |
| 1529 // can't close the old color chooser dialog. | |
| 1530 if (!color_chooser_.get()) | |
| 1531 color_chooser_.reset(content::ColorChooser::Create(color_chooser_id, | |
| 1532 web_contents, | |
| 1533 color)); | |
| 1534 #else | |
| 1535 if (color_chooser_.get()) | |
| 1536 color_chooser_->End(); | |
| 1537 color_chooser_.reset(content::ColorChooser::Create(color_chooser_id, | |
| 1538 web_contents, | |
| 1539 color)); | |
| 1540 #endif | |
| 1541 return color_chooser_.get(); | |
| 1542 } | |
| 1543 | |
| 1544 void Browser::DidEndColorChooser() { | |
| 1545 color_chooser_.reset(); | |
| 1546 } | 1527 } |
| 1547 | 1528 |
| 1548 void Browser::RunFileChooser(WebContents* web_contents, | 1529 void Browser::RunFileChooser(WebContents* web_contents, |
| 1549 const content::FileChooserParams& params) { | 1530 const content::FileChooserParams& params) { |
| 1550 FileSelectHelper::RunFileChooser(web_contents, params); | 1531 FileSelectHelper::RunFileChooser(web_contents, params); |
| 1551 } | 1532 } |
| 1552 | 1533 |
| 1553 void Browser::EnumerateDirectory(WebContents* web_contents, | 1534 void Browser::EnumerateDirectory(WebContents* web_contents, |
| 1554 int request_id, | 1535 int request_id, |
| 1555 const base::FilePath& path) { | 1536 const base::FilePath& path) { |
| (...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2253 if (contents && !allow_js_access) { | 2234 if (contents && !allow_js_access) { |
| 2254 contents->web_contents()->GetController().LoadURL( | 2235 contents->web_contents()->GetController().LoadURL( |
| 2255 target_url, | 2236 target_url, |
| 2256 content::Referrer(), | 2237 content::Referrer(), |
| 2257 content::PAGE_TRANSITION_LINK, | 2238 content::PAGE_TRANSITION_LINK, |
| 2258 std::string()); // No extra headers. | 2239 std::string()); // No extra headers. |
| 2259 } | 2240 } |
| 2260 | 2241 |
| 2261 return contents != NULL; | 2242 return contents != NULL; |
| 2262 } | 2243 } |
| OLD | NEW |