| 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 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 574 } | 574 } |
| 575 | 575 |
| 576 bool Browser::HasFindBarController() const { | 576 bool Browser::HasFindBarController() const { |
| 577 return find_bar_controller_.get() != NULL; | 577 return find_bar_controller_.get() != NULL; |
| 578 } | 578 } |
| 579 | 579 |
| 580 bool Browser::is_app() const { | 580 bool Browser::is_app() const { |
| 581 return !app_name_.empty(); | 581 return !app_name_.empty(); |
| 582 } | 582 } |
| 583 | 583 |
| 584 const Extension* Browser::GetPlatformApp() const { |
| 585 if (is_app()) { |
| 586 const std::string ext_id = web_app::GetExtensionIdFromApplicationName( |
| 587 app_name_); |
| 588 const Extension* app = |
| 589 profile_->GetExtensionService()->GetInstalledExtension(ext_id); |
| 590 if (app && app->is_platform_app()) |
| 591 return app; |
| 592 } |
| 593 return NULL; |
| 594 } |
| 595 |
| 584 bool Browser::is_devtools() const { | 596 bool Browser::is_devtools() const { |
| 585 return app_name_ == DevToolsWindow::kDevToolsApp; | 597 return app_name_ == DevToolsWindow::kDevToolsApp; |
| 586 } | 598 } |
| 587 | 599 |
| 588 /////////////////////////////////////////////////////////////////////////////// | 600 /////////////////////////////////////////////////////////////////////////////// |
| 589 // Browser, Creation Helpers: | 601 // Browser, Creation Helpers: |
| 590 | 602 |
| 591 // static | 603 // static |
| 592 void Browser::OpenEmptyWindow(Profile* profile) { | 604 void Browser::OpenEmptyWindow(Profile* profile) { |
| 593 Browser* browser = Browser::Create(profile); | 605 Browser* browser = Browser::Create(profile); |
| (...skipping 4739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5333 window_->GetLocationBar()->ShowFirstRunBubble(bubble_type); | 5345 window_->GetLocationBar()->ShowFirstRunBubble(bubble_type); |
| 5334 } else { | 5346 } else { |
| 5335 GlobalErrorService* service = | 5347 GlobalErrorService* service = |
| 5336 GlobalErrorServiceFactory::GetForProfile(profile()); | 5348 GlobalErrorServiceFactory::GetForProfile(profile()); |
| 5337 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); | 5349 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); |
| 5338 if (error) { | 5350 if (error) { |
| 5339 error->ShowBubbleView(this); | 5351 error->ShowBubbleView(this); |
| 5340 } | 5352 } |
| 5341 } | 5353 } |
| 5342 } | 5354 } |
| OLD | NEW |