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 "content/browser/devtools/protocol/page_handler.h" | 5 #include "content/browser/devtools/protocol/page_handler.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 24 matching lines...) Expand all Loading... | |
35 #include "content/public/browser/web_contents_delegate.h" | 35 #include "content/public/browser/web_contents_delegate.h" |
36 #include "content/public/common/referrer.h" | 36 #include "content/public/common/referrer.h" |
37 #include "third_party/skia/include/core/SkBitmap.h" | 37 #include "third_party/skia/include/core/SkBitmap.h" |
38 #include "ui/base/page_transition_types.h" | 38 #include "ui/base/page_transition_types.h" |
39 #include "ui/gfx/codec/jpeg_codec.h" | 39 #include "ui/gfx/codec/jpeg_codec.h" |
40 #include "ui/gfx/codec/png_codec.h" | 40 #include "ui/gfx/codec/png_codec.h" |
41 #include "ui/gfx/geometry/size_conversions.h" | 41 #include "ui/gfx/geometry/size_conversions.h" |
42 #include "ui/gfx/image/image.h" | 42 #include "ui/gfx/image/image.h" |
43 #include "ui/gfx/image/image_util.h" | 43 #include "ui/gfx/image/image_util.h" |
44 #include "ui/snapshot/snapshot.h" | 44 #include "ui/snapshot/snapshot.h" |
45 #include "ui/views/widget/widget.h" | |
45 #include "url/gurl.h" | 46 #include "url/gurl.h" |
46 | 47 |
47 namespace content { | 48 namespace content { |
48 namespace protocol { | 49 namespace protocol { |
49 | 50 |
50 namespace { | 51 namespace { |
51 | 52 |
52 static const char kPng[] = "png"; | 53 static const char kPng[] = "png"; |
53 static const char kJpeg[] = "jpeg"; | 54 static const char kJpeg[] = "jpeg"; |
54 static int kDefaultScreenshotQuality = 80; | 55 static int kDefaultScreenshotQuality = 80; |
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
587 } | 588 } |
588 | 589 |
589 Response PageHandler::StopLoading() { | 590 Response PageHandler::StopLoading() { |
590 WebContentsImpl* web_contents = GetWebContents(); | 591 WebContentsImpl* web_contents = GetWebContents(); |
591 if (!web_contents) | 592 if (!web_contents) |
592 return Response::InternalError(); | 593 return Response::InternalError(); |
593 web_contents->Stop(); | 594 web_contents->Stop(); |
594 return Response::OK(); | 595 return Response::OK(); |
595 } | 596 } |
596 | 597 |
598 Response PageHandler::MaximizeWindow() { | |
599 return Response::Error("not implemented"); | |
600 } | |
601 | |
602 Response PageHandler::MinimizeWindow() { | |
603 return Response::Error("not implemented"); | |
604 } | |
605 | |
606 Response PageHandler::SetWindowFullscreen(Maybe<bool> fullscreen) { | |
dgozman
2017/03/16 01:45:59
Is this method an equivalent of fullscreen api, or
| |
607 WebContentsImpl* web_contents = GetWebContents(); | |
608 if (!web_contents) | |
609 return Response::InternalError(); | |
610 views::Widget::GetWidgetForNativeWindow( | |
611 web_contents->GetTopLevelNativeWindow()) | |
612 ->SetFullscreen(fullscreen.fromMaybe(true)); | |
613 return Response::OK(); | |
614 } | |
615 | |
616 Response PageHandler::SetWindowBounds(Maybe<int> left, | |
617 Maybe<int> top, | |
618 Maybe<int> width, | |
619 Maybe<int> height) { | |
620 return Response::Error("not implemented"); | |
621 } | |
622 | |
623 Response PageHandler::GetWindowBounds(int* left, | |
624 int* top, | |
625 int* width, | |
626 int* height) { | |
627 return Response::Error("not implemented"); | |
628 } | |
629 | |
597 } // namespace protocol | 630 } // namespace protocol |
598 } // namespace content | 631 } // namespace content |
OLD | NEW |