| 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/web_activity.h" | 5 #include "athena/content/web_activity.h" |
| 6 | 6 |
| 7 #include "athena/activity/public/activity_factory.h" | 7 #include "athena/activity/public/activity_factory.h" |
| 8 #include "athena/activity/public/activity_manager.h" | 8 #include "athena/activity/public/activity_manager.h" |
| 9 #include "athena/input/public/accelerator_manager.h" | 9 #include "athena/input/public/accelerator_manager.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 return web_view_ && web_view_->IsDrawn(); | 340 return web_view_ && web_view_->IsDrawn(); |
| 341 } | 341 } |
| 342 | 342 |
| 343 Activity::ActivityMediaState WebActivity::GetMediaState() { | 343 Activity::ActivityMediaState WebActivity::GetMediaState() { |
| 344 // TODO(skuhne): The function GetTabMediaStateForContents(WebContents), | 344 // TODO(skuhne): The function GetTabMediaStateForContents(WebContents), |
| 345 // and the AudioStreamMonitor needs to be moved from Chrome into contents to | 345 // and the AudioStreamMonitor needs to be moved from Chrome into contents to |
| 346 // make it more modular and so that we can use it from here. | 346 // make it more modular and so that we can use it from here. |
| 347 return Activity::ACTIVITY_MEDIA_STATE_NONE; | 347 return Activity::ACTIVITY_MEDIA_STATE_NONE; |
| 348 } | 348 } |
| 349 | 349 |
| 350 aura::Window* WebActivity::GetWindow() { | |
| 351 return !web_view_ ? NULL : web_view_->GetWidget()->GetNativeWindow(); | |
| 352 } | |
| 353 | |
| 354 void WebActivity::Init() { | 350 void WebActivity::Init() { |
| 355 DCHECK(web_view_); | 351 DCHECK(web_view_); |
| 356 web_view_->InstallAccelerators(); | 352 web_view_->InstallAccelerators(); |
| 357 } | 353 } |
| 358 | 354 |
| 359 SkColor WebActivity::GetRepresentativeColor() const { | 355 SkColor WebActivity::GetRepresentativeColor() const { |
| 360 // TODO(sad): Compute the color from the favicon. | 356 // TODO(sad): Compute the color from the favicon. |
| 361 return web_view_ ? title_color_ : kDefaultUnavailableColor; | 357 return web_view_ ? title_color_ : kDefaultUnavailableColor; |
| 362 } | 358 } |
| 363 | 359 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 void WebActivity::DidUpdateFaviconURL( | 394 void WebActivity::DidUpdateFaviconURL( |
| 399 const std::vector<content::FaviconURL>& candidates) { | 395 const std::vector<content::FaviconURL>& candidates) { |
| 400 ActivityManager::Get()->UpdateActivity(this); | 396 ActivityManager::Get()->UpdateActivity(this); |
| 401 } | 397 } |
| 402 | 398 |
| 403 void WebActivity::DidChangeThemeColor(SkColor theme_color) { | 399 void WebActivity::DidChangeThemeColor(SkColor theme_color) { |
| 404 title_color_ = theme_color; | 400 title_color_ = theme_color; |
| 405 } | 401 } |
| 406 | 402 |
| 407 } // namespace athena | 403 } // namespace athena |
| OLD | NEW |