Chromium Code Reviews| 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/command_line.h" | |
| 10 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
| 11 #include "content/public/browser/native_web_keyboard_event.h" | 12 #include "content/public/browser/native_web_keyboard_event.h" |
| 12 #include "content/public/browser/navigation_controller.h" | 13 #include "content/public/browser/navigation_controller.h" |
| 13 #include "content/public/browser/web_contents.h" | 14 #include "content/public/browser/web_contents.h" |
| 14 #include "content/public/browser/web_contents_delegate.h" | 15 #include "content/public/browser/web_contents_delegate.h" |
| 16 #include "content/public/common/content_switches.h" | |
| 15 #include "ui/views/controls/webview/unhandled_keyboard_event_handler.h" | 17 #include "ui/views/controls/webview/unhandled_keyboard_event_handler.h" |
| 16 #include "ui/views/controls/webview/webview.h" | 18 #include "ui/views/controls/webview/webview.h" |
| 17 #include "ui/views/focus/focus_manager.h" | 19 #include "ui/views/focus/focus_manager.h" |
| 18 #include "ui/views/widget/widget.h" | 20 #include "ui/views/widget/widget.h" |
| 19 | 21 |
| 22 | |
| 23 | |
|
sadrul
2014/08/29 19:36:54
Remove blank lines.
mfomitchev
2014/08/29 19:45:16
Done.
| |
| 20 namespace athena { | 24 namespace athena { |
| 21 namespace { | 25 namespace { |
| 22 | 26 |
| 23 class WebActivityController : public AcceleratorHandler { | 27 class WebActivityController : public AcceleratorHandler { |
| 24 public: | 28 public: |
| 25 enum Command { | 29 enum Command { |
| 26 CMD_BACK, | 30 CMD_BACK, |
| 27 CMD_FORWARD, | 31 CMD_FORWARD, |
| 28 CMD_RELOAD, | 32 CMD_RELOAD, |
| 29 CMD_RELOAD_IGNORE_CACHE, | 33 CMD_RELOAD_IGNORE_CACHE, |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 213 params.url)); | 217 params.url)); |
| 214 break; | 218 break; |
| 215 } | 219 } |
| 216 default: | 220 default: |
| 217 break; | 221 break; |
| 218 } | 222 } |
| 219 // NULL is returned if the URL wasn't opened immediately. | 223 // NULL is returned if the URL wasn't opened immediately. |
| 220 return NULL; | 224 return NULL; |
| 221 } | 225 } |
| 222 | 226 |
| 227 virtual bool CanOverscrollContent() const OVERRIDE { | |
| 228 const std::string value = CommandLine::ForCurrentProcess()-> | |
| 229 GetSwitchValueASCII(switches::kOverscrollHistoryNavigation); | |
| 230 return value != "0"; | |
| 231 } | |
| 232 | |
| 223 virtual void AddNewContents(content::WebContents* source, | 233 virtual void AddNewContents(content::WebContents* source, |
| 224 content::WebContents* new_contents, | 234 content::WebContents* new_contents, |
| 225 WindowOpenDisposition disposition, | 235 WindowOpenDisposition disposition, |
| 226 const gfx::Rect& initial_pos, | 236 const gfx::Rect& initial_pos, |
| 227 bool user_gesture, | 237 bool user_gesture, |
| 228 bool* was_blocked) OVERRIDE { | 238 bool* was_blocked) OVERRIDE { |
| 229 ActivityManager::Get()->AddActivity( | 239 ActivityManager::Get()->AddActivity( |
| 230 new WebActivity(new AthenaWebView(new_contents))); | 240 new WebActivity(new AthenaWebView(new_contents))); |
| 231 } | 241 } |
| 232 | 242 |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 407 void WebActivity::DidUpdateFaviconURL( | 417 void WebActivity::DidUpdateFaviconURL( |
| 408 const std::vector<content::FaviconURL>& candidates) { | 418 const std::vector<content::FaviconURL>& candidates) { |
| 409 ActivityManager::Get()->UpdateActivity(this); | 419 ActivityManager::Get()->UpdateActivity(this); |
| 410 } | 420 } |
| 411 | 421 |
| 412 void WebActivity::DidChangeThemeColor(SkColor theme_color) { | 422 void WebActivity::DidChangeThemeColor(SkColor theme_color) { |
| 413 title_color_ = theme_color; | 423 title_color_ = theme_color; |
| 414 } | 424 } |
| 415 | 425 |
| 416 } // namespace athena | 426 } // namespace athena |
| OLD | NEW |