| 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 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 return !app_name_.empty(); | 547 return !app_name_.empty(); |
| 548 } | 548 } |
| 549 | 549 |
| 550 bool Browser::is_devtools() const { | 550 bool Browser::is_devtools() const { |
| 551 return app_name_ == DevToolsWindow::kDevToolsApp; | 551 return app_name_ == DevToolsWindow::kDevToolsApp; |
| 552 } | 552 } |
| 553 | 553 |
| 554 /////////////////////////////////////////////////////////////////////////////// | 554 /////////////////////////////////////////////////////////////////////////////// |
| 555 // Browser, State Storage and Retrieval for UI: | 555 // Browser, State Storage and Retrieval for UI: |
| 556 | 556 |
| 557 SkBitmap Browser::GetCurrentPageIcon() const { | 557 gfx::Image Browser::GetCurrentPageIcon() const { |
| 558 TabContents* contents = chrome::GetActiveTabContents(this); | 558 TabContents* contents = chrome::GetActiveTabContents(this); |
| 559 // |contents| can be NULL since GetCurrentPageIcon() is called by the window | 559 // |contents| can be NULL since GetCurrentPageIcon() is called by the window |
| 560 // during the window's creation (before tabs have been added). | 560 // during the window's creation (before tabs have been added). |
| 561 // TODO: Let this return a gfx::Image. | |
| 562 return contents ? | 561 return contents ? |
| 563 contents->favicon_tab_helper()->GetFavicon().AsBitmap() : SkBitmap(); | 562 contents->favicon_tab_helper()->GetFavicon() : gfx::Image(); |
| 564 } | 563 } |
| 565 | 564 |
| 566 string16 Browser::GetWindowTitleForCurrentTab() const { | 565 string16 Browser::GetWindowTitleForCurrentTab() const { |
| 567 WebContents* contents = chrome::GetActiveWebContents(this); | 566 WebContents* contents = chrome::GetActiveWebContents(this); |
| 568 string16 title; | 567 string16 title; |
| 569 | 568 |
| 570 // |contents| can be NULL because GetWindowTitleForCurrentTab is called by the | 569 // |contents| can be NULL because GetWindowTitleForCurrentTab is called by the |
| 571 // window during the window's creation (before tabs have been added). | 570 // window during the window's creation (before tabs have been added). |
| 572 if (contents) { | 571 if (contents) { |
| 573 title = contents->GetTitle(); | 572 title = contents->GetTitle(); |
| (...skipping 1745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2319 if (contents && !allow_js_access) { | 2318 if (contents && !allow_js_access) { |
| 2320 contents->web_contents()->GetController().LoadURL( | 2319 contents->web_contents()->GetController().LoadURL( |
| 2321 target_url, | 2320 target_url, |
| 2322 content::Referrer(), | 2321 content::Referrer(), |
| 2323 content::PAGE_TRANSITION_LINK, | 2322 content::PAGE_TRANSITION_LINK, |
| 2324 std::string()); // No extra headers. | 2323 std::string()); // No extra headers. |
| 2325 } | 2324 } |
| 2326 | 2325 |
| 2327 return contents != NULL; | 2326 return contents != NULL; |
| 2328 } | 2327 } |
| OLD | NEW |