OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 "chrome/browser/extensions/extension_view.h" | 5 #include "chrome/browser/extensions/extension_view.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "chrome/browser/browser.h" | 8 #include "chrome/browser/browser.h" |
9 #include "chrome/browser/character_encoding.h" | 9 #include "chrome/browser/character_encoding.h" |
10 #include "chrome/browser/extensions/extension.h" | 10 #include "chrome/browser/extensions/extension.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 SetVisible(true); | 46 SetVisible(true); |
47 DidContentsPreferredWidthChange(pending_preferred_width_); | 47 DidContentsPreferredWidthChange(pending_preferred_width_); |
48 } | 48 } |
49 } | 49 } |
50 | 50 |
51 void ExtensionView::SetBackground(const SkBitmap& background) { | 51 void ExtensionView::SetBackground(const SkBitmap& background) { |
52 HWNDHtmlView::SetBackground(background); | 52 HWNDHtmlView::SetBackground(background); |
53 ShowIfCompletelyLoaded(); | 53 ShowIfCompletelyLoaded(); |
54 } | 54 } |
55 | 55 |
56 void ExtensionView::DidStopLoading(RenderViewHost* render_view_host, | 56 void ExtensionView::DidStopLoading(RenderViewHost* render_view_host) { |
57 int32 page_id) { | |
58 render_view_host->WasResized(); | 57 render_view_host->WasResized(); |
59 did_stop_loading_ = true; | 58 did_stop_loading_ = true; |
60 ShowIfCompletelyLoaded(); | 59 ShowIfCompletelyLoaded(); |
61 } | 60 } |
62 | 61 |
63 void ExtensionView::DidContentsPreferredWidthChange(const int pref_width) { | 62 void ExtensionView::DidContentsPreferredWidthChange(const int pref_width) { |
64 // Don't actually do anything with this information until we have been shown. | 63 // Don't actually do anything with this information until we have been shown. |
65 // Size changes will not be honored by lower layers while we are hidden. | 64 // Size changes will not be honored by lower layers while we are hidden. |
66 if (!IsVisible()) { | 65 if (!IsVisible()) { |
67 pending_preferred_width_ = pref_width; | 66 pending_preferred_width_ = pref_width; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 const GURL& frame_url, | 103 const GURL& frame_url, |
105 const int flags, | 104 const int flags, |
106 IPC::Message* reply_msg, | 105 IPC::Message* reply_msg, |
107 bool* did_suppress_message) { | 106 bool* did_suppress_message) { |
108 // Automatically cancel the javascript alert (otherwise the renderer hangs | 107 // Automatically cancel the javascript alert (otherwise the renderer hangs |
109 // indefinitely). | 108 // indefinitely). |
110 *did_suppress_message = true; | 109 *did_suppress_message = true; |
111 render_view_host()->JavaScriptMessageBoxClosed(reply_msg, true, L""); | 110 render_view_host()->JavaScriptMessageBoxClosed(reply_msg, true, L""); |
112 } | 111 } |
113 | 112 |
114 void ExtensionView::DidStartLoading(RenderViewHost* render_view_host, | 113 void ExtensionView::DidStartLoading(RenderViewHost* render_view_host) { |
115 int32 page_id) { | |
116 static const StringPiece toolstrip_css( | 114 static const StringPiece toolstrip_css( |
117 ResourceBundle::GetSharedInstance().GetRawDataResource( | 115 ResourceBundle::GetSharedInstance().GetRawDataResource( |
118 IDR_EXTENSIONS_TOOLSTRIP_CSS)); | 116 IDR_EXTENSIONS_TOOLSTRIP_CSS)); |
119 render_view_host->InsertCSSInWebFrame(L"", toolstrip_css.as_string()); | 117 render_view_host->InsertCSSInWebFrame(L"", toolstrip_css.as_string()); |
120 } | 118 } |
121 | 119 |
122 RenderViewHostDelegate::View* ExtensionView::GetViewDelegate() const { | 120 RenderViewHostDelegate::View* ExtensionView::GetViewDelegate() const { |
123 // TODO(erikkay) this is unfortunate. The interface declares that this method | 121 // TODO(erikkay) this is unfortunate. The interface declares that this method |
124 // must be const (no good reason for it as far as I can tell) which means you | 122 // must be const (no good reason for it as far as I can tell) which means you |
125 // can't return self without doing this const_cast. Either we need to change | 123 // can't return self without doing this const_cast. Either we need to change |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 } | 167 } |
170 | 168 |
171 void ExtensionView::UpdateDragCursor(bool is_drop_target) { | 169 void ExtensionView::UpdateDragCursor(bool is_drop_target) { |
172 } | 170 } |
173 | 171 |
174 void ExtensionView::TakeFocus(bool reverse) { | 172 void ExtensionView::TakeFocus(bool reverse) { |
175 } | 173 } |
176 | 174 |
177 void ExtensionView::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) { | 175 void ExtensionView::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) { |
178 } | 176 } |
OLD | NEW |