| 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/extensions/tab_helper.h" | 5 #include "chrome/browser/extensions/tab_helper.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 bool TabHelper::CanCreateApplicationShortcuts() const { | 137 bool TabHelper::CanCreateApplicationShortcuts() const { |
| 138 #if defined(OS_MACOSX) | 138 #if defined(OS_MACOSX) |
| 139 return false; | 139 return false; |
| 140 #else | 140 #else |
| 141 return web_app::IsValidUrl(web_contents()->GetURL()); | 141 return web_app::IsValidUrl(web_contents()->GetURL()); |
| 142 #endif | 142 #endif |
| 143 } | 143 } |
| 144 | 144 |
| 145 bool TabHelper::CanCreateBookmarkApp() const { | 145 bool TabHelper::CanCreateBookmarkApp() const { |
| 146 return !profile_->IsGuestSession() && | 146 return !profile_->IsGuestSession() && |
| 147 !profile_->IsSystemProfile() && |
| 147 IsValidBookmarkAppUrl(web_contents()->GetURL()); | 148 IsValidBookmarkAppUrl(web_contents()->GetURL()); |
| 148 } | 149 } |
| 149 | 150 |
| 150 void TabHelper::AddScriptExecutionObserver(ScriptExecutionObserver* observer) { | 151 void TabHelper::AddScriptExecutionObserver(ScriptExecutionObserver* observer) { |
| 151 script_execution_observers_.AddObserver(observer); | 152 script_execution_observers_.AddObserver(observer); |
| 152 } | 153 } |
| 153 | 154 |
| 154 void TabHelper::RemoveScriptExecutionObserver( | 155 void TabHelper::RemoveScriptExecutionObserver( |
| 155 ScriptExecutionObserver* observer) { | 156 ScriptExecutionObserver* observer) { |
| 156 script_execution_observers_.RemoveObserver(observer); | 157 script_execution_observers_.RemoveObserver(observer); |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 577 } | 578 } |
| 578 } | 579 } |
| 579 | 580 |
| 580 void TabHelper::SetTabId(RenderViewHost* render_view_host) { | 581 void TabHelper::SetTabId(RenderViewHost* render_view_host) { |
| 581 render_view_host->Send( | 582 render_view_host->Send( |
| 582 new ExtensionMsg_SetTabId(render_view_host->GetRoutingID(), | 583 new ExtensionMsg_SetTabId(render_view_host->GetRoutingID(), |
| 583 SessionTabHelper::IdForTab(web_contents()))); | 584 SessionTabHelper::IdForTab(web_contents()))); |
| 584 } | 585 } |
| 585 | 586 |
| 586 } // namespace extensions | 587 } // namespace extensions |
| OLD | NEW |