Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Side by Side Diff: chrome/browser/ui/views/frame/browser_view.cc

Issue 10917026: Switch Extensions::TabHelper to use WebContents, WebContentsUserData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase only Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/views/frame/browser_view.h" 5 #include "chrome/browser/ui/views/frame/browser_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 1519 matching lines...) Expand 10 before | Expand all | Expand 10 after
1530 // For Ash only, app host windows do not show an icon, crbug.com/119411. 1530 // For Ash only, app host windows do not show an icon, crbug.com/119411.
1531 // Child windows (e.g. extension panels, popups) do show an icon. 1531 // Child windows (e.g. extension panels, popups) do show an icon.
1532 if (browser_->is_app() && browser_->app_type() == Browser::APP_TYPE_HOST) 1532 if (browser_->is_app() && browser_->app_type() == Browser::APP_TYPE_HOST)
1533 return false; 1533 return false;
1534 #endif 1534 #endif
1535 return browser_->SupportsWindowFeature(Browser::FEATURE_TITLEBAR); 1535 return browser_->SupportsWindowFeature(Browser::FEATURE_TITLEBAR);
1536 } 1536 }
1537 1537
1538 gfx::ImageSkia BrowserView::GetWindowAppIcon() { 1538 gfx::ImageSkia BrowserView::GetWindowAppIcon() {
1539 if (browser_->is_app()) { 1539 if (browser_->is_app()) {
1540 TabContents* contents = chrome::GetActiveTabContents(browser_.get()); 1540 WebContents* contents = chrome::GetActiveWebContents(browser_.get());
1541 if (contents && contents->extension_tab_helper()->GetExtensionAppIcon()) 1541 extensions::TabHelper* extensions_tab_helper =
1542 return *contents->extension_tab_helper()->GetExtensionAppIcon(); 1542 contents ? extensions::TabHelper::FromWebContents(contents) : NULL;
1543 if (extensions_tab_helper && extensions_tab_helper->GetExtensionAppIcon())
1544 return *extensions_tab_helper->GetExtensionAppIcon();
1543 } 1545 }
1544 1546
1545 return GetWindowIcon(); 1547 return GetWindowIcon();
1546 } 1548 }
1547 1549
1548 gfx::ImageSkia BrowserView::GetWindowIcon() { 1550 gfx::ImageSkia BrowserView::GetWindowIcon() {
1549 if (browser_->is_app()) 1551 if (browser_->is_app())
1550 return browser_->GetCurrentPageIcon().AsImageSkia(); 1552 return browser_->GetCurrentPageIcon().AsImageSkia();
1551 return gfx::ImageSkia(); 1553 return gfx::ImageSkia();
1552 } 1554 }
(...skipping 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after
2622 2624
2623 Browser* modal_browser = 2625 Browser* modal_browser =
2624 browser::FindBrowserWithWebContents(active_dialog->web_contents()); 2626 browser::FindBrowserWithWebContents(active_dialog->web_contents());
2625 if (modal_browser && (browser_ != modal_browser)) { 2627 if (modal_browser && (browser_ != modal_browser)) {
2626 modal_browser->window()->FlashFrame(true); 2628 modal_browser->window()->FlashFrame(true);
2627 modal_browser->window()->Activate(); 2629 modal_browser->window()->Activate();
2628 } 2630 }
2629 2631
2630 AppModalDialogQueue::GetInstance()->ActivateModalDialog(); 2632 AppModalDialogQueue::GetInstance()->ActivateModalDialog();
2631 } 2633 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/create_application_shortcut_view.cc ('k') | chrome/browser/ui/views/location_bar/location_bar_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698