| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "athena/content/app_activity.h" | 5 #include "athena/content/app_activity.h" |
| 6 | 6 |
| 7 #include "athena/activity/public/activity_manager.h" | 7 #include "athena/activity/public/activity_manager.h" |
| 8 #include "athena/content/app_activity_registry.h" | 8 #include "athena/content/app_activity_registry.h" |
| 9 #include "athena/content/public/app_registry.h" | 9 #include "athena/content/public/app_registry.h" |
| 10 #include "content/public/browser/web_contents.h" | 10 #include "content/public/browser/web_contents.h" |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 } | 131 } |
| 132 | 132 |
| 133 void AppActivity::CreateOverviewModeImage() { | 133 void AppActivity::CreateOverviewModeImage() { |
| 134 // TODO(skuhne): Implement this! | 134 // TODO(skuhne): Implement this! |
| 135 } | 135 } |
| 136 | 136 |
| 137 gfx::ImageSkia AppActivity::GetOverviewModeImage() { | 137 gfx::ImageSkia AppActivity::GetOverviewModeImage() { |
| 138 return overview_mode_image_; | 138 return overview_mode_image_; |
| 139 } | 139 } |
| 140 | 140 |
| 141 void AppActivity::PrepareContentsForOverview() { |
| 142 // Turn on fast resizing to avoid re-laying out the web contents when |
| 143 // entering / exiting overview mode. |
| 144 web_view_->SetFastResize(true); |
| 145 } |
| 146 |
| 147 void AppActivity::ResetContentsView() { |
| 148 web_view_->SetFastResize(false); |
| 149 web_view_->Layout(); |
| 150 } |
| 151 |
| 141 void AppActivity::TitleWasSet(content::NavigationEntry* entry, | 152 void AppActivity::TitleWasSet(content::NavigationEntry* entry, |
| 142 bool explicit_set) { | 153 bool explicit_set) { |
| 143 ActivityManager::Get()->UpdateActivity(this); | 154 ActivityManager::Get()->UpdateActivity(this); |
| 144 } | 155 } |
| 145 | 156 |
| 146 void AppActivity::DidUpdateFaviconURL( | 157 void AppActivity::DidUpdateFaviconURL( |
| 147 const std::vector<content::FaviconURL>& candidates) { | 158 const std::vector<content::FaviconURL>& candidates) { |
| 148 ActivityManager::Get()->UpdateActivity(this); | 159 ActivityManager::Get()->UpdateActivity(this); |
| 149 } | 160 } |
| 150 | 161 |
| 151 // Register an |activity| with an application. | 162 // Register an |activity| with an application. |
| 152 // Note: This should only get called once for an |app_window| of the | 163 // Note: This should only get called once for an |app_window| of the |
| 153 // |activity|. | 164 // |activity|. |
| 154 void AppActivity::RegisterActivity() { | 165 void AppActivity::RegisterActivity() { |
| 155 content::WebContents* web_contents = GetWebContents(); | 166 content::WebContents* web_contents = GetWebContents(); |
| 156 AppRegistry* app_registry = AppRegistry::Get(); | 167 AppRegistry* app_registry = AppRegistry::Get(); |
| 157 // Get the application's registry. | 168 // Get the application's registry. |
| 158 app_activity_registry_ = app_registry->GetAppActivityRegistry( | 169 app_activity_registry_ = app_registry->GetAppActivityRegistry( |
| 159 app_id_, web_contents->GetBrowserContext()); | 170 app_id_, web_contents->GetBrowserContext()); |
| 160 DCHECK(app_activity_registry_); | 171 DCHECK(app_activity_registry_); |
| 161 // Register the activity. | 172 // Register the activity. |
| 162 app_activity_registry_->RegisterAppActivity(this); | 173 app_activity_registry_->RegisterAppActivity(this); |
| 163 } | 174 } |
| 164 | 175 |
| 165 } // namespace athena | 176 } // namespace athena |
| OLD | NEW |