| 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 if (!web_view_) |
| 352 return NULL; |
| 353 return web_view_->GetWidget()->GetNativeWindow(); |
| 354 } |
| 355 |
| 350 void WebActivity::Init() { | 356 void WebActivity::Init() { |
| 351 DCHECK(web_view_); | 357 DCHECK(web_view_); |
| 352 web_view_->InstallAccelerators(); | 358 web_view_->InstallAccelerators(); |
| 353 } | 359 } |
| 354 | 360 |
| 355 SkColor WebActivity::GetRepresentativeColor() const { | 361 SkColor WebActivity::GetRepresentativeColor() const { |
| 356 // TODO(sad): Compute the color from the favicon. | 362 // TODO(sad): Compute the color from the favicon. |
| 357 return web_view_ ? title_color_ : kDefaultUnavailableColor; | 363 return web_view_ ? title_color_ : kDefaultUnavailableColor; |
| 358 } | 364 } |
| 359 | 365 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 void WebActivity::DidUpdateFaviconURL( | 400 void WebActivity::DidUpdateFaviconURL( |
| 395 const std::vector<content::FaviconURL>& candidates) { | 401 const std::vector<content::FaviconURL>& candidates) { |
| 396 ActivityManager::Get()->UpdateActivity(this); | 402 ActivityManager::Get()->UpdateActivity(this); |
| 397 } | 403 } |
| 398 | 404 |
| 399 void WebActivity::DidChangeThemeColor(SkColor theme_color) { | 405 void WebActivity::DidChangeThemeColor(SkColor theme_color) { |
| 400 title_color_ = theme_color; | 406 title_color_ = theme_color; |
| 401 } | 407 } |
| 402 | 408 |
| 403 } // namespace athena | 409 } // namespace athena |
| OLD | NEW |