OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ash/content/keyboard_overlay/keyboard_overlay_delegate.h" | 5 #include "ash/content/keyboard_overlay/keyboard_overlay_delegate.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 }; | 47 }; |
48 | 48 |
49 void PaintMessageHandler::RegisterMessages() { | 49 void PaintMessageHandler::RegisterMessages() { |
50 web_ui()->RegisterMessageCallback( | 50 web_ui()->RegisterMessageCallback( |
51 "didPaint", base::Bind(&PaintMessageHandler::DidPaint, AsWeakPtr())); | 51 "didPaint", base::Bind(&PaintMessageHandler::DidPaint, AsWeakPtr())); |
52 } | 52 } |
53 | 53 |
54 void PaintMessageHandler::DidPaint(const base::ListValue* args) { | 54 void PaintMessageHandler::DidPaint(const base::ListValue* args) { |
55 // Show the widget after the web content has been painted. | 55 // Show the widget after the web content has been painted. |
56 widget_->Show(); | 56 widget_->Show(); |
57 web_ui()->CallJavascriptFunction("onWidgetShown"); | 57 web_ui()->CallJavascriptFunctionUnsafe("onWidgetShown"); |
58 } | 58 } |
59 | 59 |
60 } // namespace | 60 } // namespace |
61 | 61 |
62 namespace ash { | 62 namespace ash { |
63 | 63 |
64 KeyboardOverlayDelegate::KeyboardOverlayDelegate(const base::string16& title, | 64 KeyboardOverlayDelegate::KeyboardOverlayDelegate(const base::string16& title, |
65 const GURL& url) | 65 const GURL& url) |
66 : title_(title), url_(url), widget_(NULL) {} | 66 : title_(title), url_(url), widget_(NULL) {} |
67 | 67 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 bool KeyboardOverlayDelegate::ShouldShowDialogTitle() const { | 133 bool KeyboardOverlayDelegate::ShouldShowDialogTitle() const { |
134 return false; | 134 return false; |
135 } | 135 } |
136 | 136 |
137 bool KeyboardOverlayDelegate::HandleContextMenu( | 137 bool KeyboardOverlayDelegate::HandleContextMenu( |
138 const content::ContextMenuParams& params) { | 138 const content::ContextMenuParams& params) { |
139 return true; | 139 return true; |
140 } | 140 } |
141 | 141 |
142 } // namespace ash | 142 } // namespace ash |
OLD | NEW |