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/content/public/dialogs.h" |
9 #include "athena/input/public/accelerator_manager.h" | 10 #include "athena/input/public/accelerator_manager.h" |
10 #include "base/bind.h" | 11 #include "base/bind.h" |
11 #include "base/command_line.h" | 12 #include "base/command_line.h" |
12 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
13 #include "content/public/browser/native_web_keyboard_event.h" | 14 #include "content/public/browser/native_web_keyboard_event.h" |
14 #include "content/public/browser/navigation_controller.h" | 15 #include "content/public/browser/navigation_controller.h" |
15 #include "content/public/browser/web_contents.h" | 16 #include "content/public/browser/web_contents.h" |
16 #include "content/public/browser/web_contents_delegate.h" | 17 #include "content/public/browser/web_contents_delegate.h" |
17 #include "content/public/common/content_switches.h" | 18 #include "content/public/common/content_switches.h" |
18 #include "ui/aura/window.h" | 19 #include "ui/aura/window.h" |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 return; | 296 return; |
296 | 297 |
297 ui::ScopedLayerAnimationSettings settings(progress_bar_->GetAnimator()); | 298 ui::ScopedLayerAnimationSettings settings(progress_bar_->GetAnimator()); |
298 settings.SetTweenType(gfx::Tween::EASE_IN); | 299 settings.SetTweenType(gfx::Tween::EASE_IN); |
299 ui::Layer* layer = progress_bar_.get(); | 300 ui::Layer* layer = progress_bar_.get(); |
300 settings.AddObserver(new ui::ClosureAnimationObserver( | 301 settings.AddObserver(new ui::ClosureAnimationObserver( |
301 base::Bind(&base::DeletePointer<ui::Layer>, progress_bar_.release()))); | 302 base::Bind(&base::DeletePointer<ui::Layer>, progress_bar_.release()))); |
302 layer->SetOpacity(0.f); | 303 layer->SetOpacity(0.f); |
303 } | 304 } |
304 | 305 |
| 306 virtual content::ColorChooser* OpenColorChooser( |
| 307 content::WebContents* web_contents, |
| 308 SkColor color, |
| 309 const std::vector<content::ColorSuggestion>& suggestions) OVERRIDE { |
| 310 return athena::OpenColorChooser(web_contents, color, suggestions); |
| 311 } |
| 312 |
| 313 // Called when a file selection is to be done. |
| 314 virtual void RunFileChooser( |
| 315 content::WebContents* web_contents, |
| 316 const content::FileChooserParams& params) OVERRIDE { |
| 317 return athena::OpenFileChooser(web_contents, params); |
| 318 } |
| 319 |
305 private: | 320 private: |
306 void CreateProgressBar() { | 321 void CreateProgressBar() { |
307 CHECK(!progress_bar_); | 322 CHECK(!progress_bar_); |
308 progress_bar_.reset(new ui::Layer(ui::LAYER_SOLID_COLOR)); | 323 progress_bar_.reset(new ui::Layer(ui::LAYER_SOLID_COLOR)); |
309 progress_bar_->SetColor(SkColorSetRGB(0x17, 0x59, 0xcd)); | 324 progress_bar_->SetColor(SkColorSetRGB(0x17, 0x59, 0xcd)); |
310 } | 325 } |
311 | 326 |
312 scoped_ptr<WebActivityController> controller_; | 327 scoped_ptr<WebActivityController> controller_; |
313 | 328 |
314 // If the activity got evicted, this is the web content which holds the known | 329 // If the activity got evicted, this is the web content which holds the known |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 | 541 |
527 void WebActivity::ReloadAndObserve() { | 542 void WebActivity::ReloadAndObserve() { |
528 if (web_view_->IsContentEvicted()) { | 543 if (web_view_->IsContentEvicted()) { |
529 DCHECK_EQ(ACTIVITY_UNLOADED, current_state_); | 544 DCHECK_EQ(ACTIVITY_UNLOADED, current_state_); |
530 web_view_->ReloadContent(); | 545 web_view_->ReloadContent(); |
531 } | 546 } |
532 Observe(web_view_->GetWebContents()); | 547 Observe(web_view_->GetWebContents()); |
533 } | 548 } |
534 | 549 |
535 } // namespace athena | 550 } // namespace athena |
OLD | NEW |