OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 } | 572 } |
573 | 573 |
574 bool Browser::HasFindBarController() const { | 574 bool Browser::HasFindBarController() const { |
575 return find_bar_controller_.get() != NULL; | 575 return find_bar_controller_.get() != NULL; |
576 } | 576 } |
577 | 577 |
578 bool Browser::is_app() const { | 578 bool Browser::is_app() const { |
579 return !app_name_.empty(); | 579 return !app_name_.empty(); |
580 } | 580 } |
581 | 581 |
| 582 const Extension* Browser::GetPlatformApp() const { |
| 583 if (is_app()) { |
| 584 const std::string ext_id = web_app::GetExtensionIdFromApplicationName( |
| 585 app_name_); |
| 586 const Extension* app = |
| 587 profile_->GetExtensionService()->GetInstalledExtension(ext_id); |
| 588 if (app && app->is_platform_app()) |
| 589 return app; |
| 590 } |
| 591 return NULL; |
| 592 } |
| 593 |
582 bool Browser::is_devtools() const { | 594 bool Browser::is_devtools() const { |
583 return app_name_ == DevToolsWindow::kDevToolsApp; | 595 return app_name_ == DevToolsWindow::kDevToolsApp; |
584 } | 596 } |
585 | 597 |
586 /////////////////////////////////////////////////////////////////////////////// | 598 /////////////////////////////////////////////////////////////////////////////// |
587 // Browser, Creation Helpers: | 599 // Browser, Creation Helpers: |
588 | 600 |
589 // static | 601 // static |
590 void Browser::OpenEmptyWindow(Profile* profile) { | 602 void Browser::OpenEmptyWindow(Profile* profile) { |
591 Browser* browser = Browser::Create(profile); | 603 Browser* browser = Browser::Create(profile); |
(...skipping 4731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5323 window_->GetLocationBar()->ShowFirstRunBubble(bubble_type); | 5335 window_->GetLocationBar()->ShowFirstRunBubble(bubble_type); |
5324 } else { | 5336 } else { |
5325 GlobalErrorService* service = | 5337 GlobalErrorService* service = |
5326 GlobalErrorServiceFactory::GetForProfile(profile()); | 5338 GlobalErrorServiceFactory::GetForProfile(profile()); |
5327 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); | 5339 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); |
5328 if (error) { | 5340 if (error) { |
5329 error->ShowBubbleView(this); | 5341 error->ShowBubbleView(this); |
5330 } | 5342 } |
5331 } | 5343 } |
5332 } | 5344 } |
OLD | NEW |