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 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 return app_name_ == DevToolsWindow::kDevToolsApp; | 527 return app_name_ == DevToolsWindow::kDevToolsApp; |
528 } | 528 } |
529 | 529 |
530 /////////////////////////////////////////////////////////////////////////////// | 530 /////////////////////////////////////////////////////////////////////////////// |
531 // Browser, State Storage and Retrieval for UI: | 531 // Browser, State Storage and Retrieval for UI: |
532 | 532 |
533 SkBitmap Browser::GetCurrentPageIcon() const { | 533 SkBitmap Browser::GetCurrentPageIcon() const { |
534 TabContents* contents = chrome::GetActiveTabContents(this); | 534 TabContents* contents = chrome::GetActiveTabContents(this); |
535 // |contents| can be NULL since GetCurrentPageIcon() is called by the window | 535 // |contents| can be NULL since GetCurrentPageIcon() is called by the window |
536 // during the window's creation (before tabs have been added). | 536 // during the window's creation (before tabs have been added). |
537 return contents ? contents->favicon_tab_helper()->GetFavicon() : SkBitmap(); | 537 // TODO: Let this return a gfx::Image. |
| 538 return contents ? |
| 539 contents->favicon_tab_helper()->GetFavicon().AsBitmap() : SkBitmap(); |
538 } | 540 } |
539 | 541 |
540 string16 Browser::GetWindowTitleForCurrentTab() const { | 542 string16 Browser::GetWindowTitleForCurrentTab() const { |
541 WebContents* contents = chrome::GetActiveWebContents(this); | 543 WebContents* contents = chrome::GetActiveWebContents(this); |
542 string16 title; | 544 string16 title; |
543 | 545 |
544 // |contents| can be NULL because GetWindowTitleForCurrentTab is called by the | 546 // |contents| can be NULL because GetWindowTitleForCurrentTab is called by the |
545 // window during the window's creation (before tabs have been added). | 547 // window during the window's creation (before tabs have been added). |
546 if (contents) { | 548 if (contents) { |
547 title = contents->GetTitle(); | 549 title = contents->GetTitle(); |
(...skipping 1742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2290 if (contents && !allow_js_access) { | 2292 if (contents && !allow_js_access) { |
2291 contents->web_contents()->GetController().LoadURL( | 2293 contents->web_contents()->GetController().LoadURL( |
2292 target_url, | 2294 target_url, |
2293 content::Referrer(), | 2295 content::Referrer(), |
2294 content::PAGE_TRANSITION_LINK, | 2296 content::PAGE_TRANSITION_LINK, |
2295 std::string()); // No extra headers. | 2297 std::string()); // No extra headers. |
2296 } | 2298 } |
2297 | 2299 |
2298 return contents != NULL; | 2300 return contents != NULL; |
2299 } | 2301 } |
OLD | NEW |