OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/browser.h" | 5 #include "chrome/browser/browser.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <shellapi.h> | 8 #include <shellapi.h> |
9 #include <windows.h> | 9 #include <windows.h> |
10 #endif // OS_WIN | 10 #endif // OS_WIN |
(...skipping 2718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2729 } | 2729 } |
2730 | 2730 |
2731 bool Browser::TakeFocus(bool reverse) { | 2731 bool Browser::TakeFocus(bool reverse) { |
2732 NotificationService::current()->Notify( | 2732 NotificationService::current()->Notify( |
2733 NotificationType::FOCUS_RETURNED_TO_BROWSER, | 2733 NotificationType::FOCUS_RETURNED_TO_BROWSER, |
2734 Source<Browser>(this), | 2734 Source<Browser>(this), |
2735 NotificationService::NoDetails()); | 2735 NotificationService::NoDetails()); |
2736 return false; | 2736 return false; |
2737 } | 2737 } |
2738 | 2738 |
| 2739 void Browser::Activate() { |
| 2740 window_->Activate(); |
| 2741 } |
| 2742 |
| 2743 void Browser::Deactivate() { |
| 2744 window_->Deactivate(); |
| 2745 } |
| 2746 |
2739 bool Browser::IsApplication() const { | 2747 bool Browser::IsApplication() const { |
2740 return (type_ & TYPE_APP) != 0; | 2748 return (type_ & TYPE_APP) != 0; |
2741 } | 2749 } |
2742 | 2750 |
2743 void Browser::ConvertContentsToApplication(TabContents* contents) { | 2751 void Browser::ConvertContentsToApplication(TabContents* contents) { |
2744 const GURL& url = contents->controller().GetActiveEntry()->url(); | 2752 const GURL& url = contents->controller().GetActiveEntry()->url(); |
2745 std::wstring app_name = web_app::GenerateApplicationNameFromURL(url); | 2753 std::wstring app_name = web_app::GenerateApplicationNameFromURL(url); |
2746 RegisterAppPrefs(app_name); | 2754 RegisterAppPrefs(app_name); |
2747 | 2755 |
2748 DetachContents(contents); | 2756 DetachContents(contents); |
(...skipping 1325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4074 } | 4082 } |
4075 | 4083 |
4076 bool Browser::IsPinned(TabContents* source) { | 4084 bool Browser::IsPinned(TabContents* source) { |
4077 int index = tabstrip_model_.GetIndexOfTabContents(source); | 4085 int index = tabstrip_model_.GetIndexOfTabContents(source); |
4078 if (index == TabStripModel::kNoTab) { | 4086 if (index == TabStripModel::kNoTab) { |
4079 NOTREACHED() << "IsPinned called for tab not in our strip"; | 4087 NOTREACHED() << "IsPinned called for tab not in our strip"; |
4080 return false; | 4088 return false; |
4081 } | 4089 } |
4082 return tabstrip_model_.IsTabPinned(index); | 4090 return tabstrip_model_.IsTabPinned(index); |
4083 } | 4091 } |
OLD | NEW |