Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(265)

Side by Side Diff: athena/content/app_activity.cc

Issue 518673007: Make activities have a thick border when in overview mode part 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@athena_overview2
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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);
oshima 2014/09/03 22:36:12 I wonder if this should be default on athena. When
pkotwicz 2014/09/05 16:38:50 This should not be the default. Fast resize does n
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698