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 "chrome/browser/extensions/extension_host.h" | 5 #include "chrome/browser/extensions/extension_host.h" |
6 | 6 |
7 #include <list> | 7 #include <list> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 #include "content/public/browser/render_process_host.h" | 43 #include "content/public/browser/render_process_host.h" |
44 #include "content/public/browser/render_view_host.h" | 44 #include "content/public/browser/render_view_host.h" |
45 #include "content/public/browser/site_instance.h" | 45 #include "content/public/browser/site_instance.h" |
46 #include "content/public/browser/web_contents.h" | 46 #include "content/public/browser/web_contents.h" |
47 #include "content/public/browser/web_contents_view.h" | 47 #include "content/public/browser/web_contents_view.h" |
48 #include "grit/browser_resources.h" | 48 #include "grit/browser_resources.h" |
49 #include "grit/chromium_strings.h" | 49 #include "grit/chromium_strings.h" |
50 #include "grit/generated_resources.h" | 50 #include "grit/generated_resources.h" |
51 #include "ui/base/keycodes/keyboard_codes.h" | 51 #include "ui/base/keycodes/keyboard_codes.h" |
52 #include "ui/base/l10n/l10n_util.h" | 52 #include "ui/base/l10n/l10n_util.h" |
| 53 #include "ui/base/layout.h" |
53 #include "ui/base/resource/resource_bundle.h" | 54 #include "ui/base/resource/resource_bundle.h" |
54 | 55 |
55 #if defined(TOOLKIT_VIEWS) | 56 #if defined(TOOLKIT_VIEWS) |
56 #include "ui/views/widget/widget.h" | 57 #include "ui/views/widget/widget.h" |
57 #endif | 58 #endif |
58 | 59 |
59 using WebKit::WebDragOperation; | 60 using WebKit::WebDragOperation; |
60 using WebKit::WebDragOperationsMask; | 61 using WebKit::WebDragOperationsMask; |
61 using content::NativeWebKeyboardEvent; | 62 using content::NativeWebKeyboardEvent; |
62 using content::OpenURLParams; | 63 using content::OpenURLParams; |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 chrome::NOTIFICATION_EXTENSION_PROCESS_TERMINATED, | 324 chrome::NOTIFICATION_EXTENSION_PROCESS_TERMINATED, |
324 content::Source<Profile>(profile_), | 325 content::Source<Profile>(profile_), |
325 content::Details<ExtensionHost>(this)); | 326 content::Details<ExtensionHost>(this)); |
326 } | 327 } |
327 | 328 |
328 void ExtensionHost::InsertInfobarCSS() { | 329 void ExtensionHost::InsertInfobarCSS() { |
329 DCHECK(!is_background_page()); | 330 DCHECK(!is_background_page()); |
330 | 331 |
331 static const base::StringPiece css( | 332 static const base::StringPiece css( |
332 ResourceBundle::GetSharedInstance().GetRawDataResource( | 333 ResourceBundle::GetSharedInstance().GetRawDataResource( |
333 IDR_EXTENSIONS_INFOBAR_CSS)); | 334 IDR_EXTENSIONS_INFOBAR_CSS, ui::SCALE_FACTOR_NONE)); |
334 | 335 |
335 render_view_host()->InsertCSS(string16(), css.as_string()); | 336 render_view_host()->InsertCSS(string16(), css.as_string()); |
336 } | 337 } |
337 | 338 |
338 void ExtensionHost::DidStopLoading() { | 339 void ExtensionHost::DidStopLoading() { |
339 bool notify = !did_stop_loading_; | 340 bool notify = !did_stop_loading_; |
340 did_stop_loading_ = true; | 341 did_stop_loading_ = true; |
341 if (extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_POPUP || | 342 if (extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_POPUP || |
342 extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_DIALOG || | 343 extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_DIALOG || |
343 extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_INFOBAR || | 344 extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_INFOBAR || |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
589 params.user_gesture = user_gesture; | 590 params.user_gesture = user_gesture; |
590 browser::Navigate(¶ms); | 591 browser::Navigate(¶ms); |
591 } | 592 } |
592 | 593 |
593 void ExtensionHost::RenderViewReady() { | 594 void ExtensionHost::RenderViewReady() { |
594 content::NotificationService::current()->Notify( | 595 content::NotificationService::current()->Notify( |
595 chrome::NOTIFICATION_EXTENSION_HOST_CREATED, | 596 chrome::NOTIFICATION_EXTENSION_HOST_CREATED, |
596 content::Source<Profile>(profile_), | 597 content::Source<Profile>(profile_), |
597 content::Details<ExtensionHost>(this)); | 598 content::Details<ExtensionHost>(this)); |
598 } | 599 } |
OLD | NEW |