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/content_proxy.h" | 9 #include "athena/content/content_proxy.h" |
10 #include "athena/content/public/dialogs.h" | 10 #include "athena/content/public/dialogs.h" |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 reload_message_->Hide(); | 278 reload_message_->Hide(); |
279 overscroll_y_ = 0; | 279 overscroll_y_ = 0; |
280 } | 280 } |
281 | 281 |
282 virtual void AddNewContents(content::WebContents* source, | 282 virtual void AddNewContents(content::WebContents* source, |
283 content::WebContents* new_contents, | 283 content::WebContents* new_contents, |
284 WindowOpenDisposition disposition, | 284 WindowOpenDisposition disposition, |
285 const gfx::Rect& initial_pos, | 285 const gfx::Rect& initial_pos, |
286 bool user_gesture, | 286 bool user_gesture, |
287 bool* was_blocked) OVERRIDE { | 287 bool* was_blocked) OVERRIDE { |
| 288 // TODO(oshima): Use factory. |
288 ActivityManager::Get()->AddActivity( | 289 ActivityManager::Get()->AddActivity( |
289 new WebActivity(new AthenaWebView(new_contents))); | 290 new WebActivity(new AthenaWebView(new_contents))); |
290 } | 291 } |
291 | 292 |
292 virtual bool PreHandleKeyboardEvent( | 293 virtual bool PreHandleKeyboardEvent( |
293 content::WebContents* source, | 294 content::WebContents* source, |
294 const content::NativeWebKeyboardEvent& event, | 295 const content::NativeWebKeyboardEvent& event, |
295 bool* is_keyboard_shortcut) OVERRIDE { | 296 bool* is_keyboard_shortcut) OVERRIDE { |
296 return controller_->PreHandleKeyboardEvent( | 297 return controller_->PreHandleKeyboardEvent( |
297 source, event, is_keyboard_shortcut); | 298 source, event, is_keyboard_shortcut); |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 | 633 |
633 void WebActivity::ReloadAndObserve() { | 634 void WebActivity::ReloadAndObserve() { |
634 if (web_view_->IsContentEvicted()) { | 635 if (web_view_->IsContentEvicted()) { |
635 DCHECK_EQ(ACTIVITY_UNLOADED, current_state_); | 636 DCHECK_EQ(ACTIVITY_UNLOADED, current_state_); |
636 web_view_->ReloadContent(); | 637 web_view_->ReloadContent(); |
637 } | 638 } |
638 Observe(web_view_->GetWebContents()); | 639 Observe(web_view_->GetWebContents()); |
639 } | 640 } |
640 | 641 |
641 } // namespace athena | 642 } // namespace athena |
OLD | NEW |