| 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/chromeos/login/simple_web_view_dialog.h" | 5 #include "chrome/browser/chromeos/login/simple_web_view_dialog.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| 11 #include "chrome/app/chrome_command_ids.h" | 11 #include "chrome/app/chrome_command_ids.h" |
| 12 #include "chrome/browser/chromeos/login/captive_portal_window_proxy.h" | 12 #include "chrome/browser/chromeos/login/captive_portal_window_proxy.h" |
| 13 #include "chrome/browser/profiles/profile_manager.h" | 13 #include "chrome/browser/profiles/profile_manager.h" |
| 14 #include "chrome/browser/ui/browser.h" | 14 #include "chrome/browser/ui/browser.h" |
| 15 #include "chrome/browser/ui/content_settings/content_setting_bubble_model_delega
te.h" | 15 #include "chrome/browser/ui/content_settings/content_setting_bubble_model_delega
te.h" |
| 16 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 16 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| 17 #include "chrome/browser/ui/toolbar/toolbar_model.h" | 17 #include "chrome/browser/ui/toolbar/toolbar_model.h" |
| 18 #include "chrome/browser/ui/view_ids.h" | 18 #include "chrome/browser/ui/view_ids.h" |
| 19 #include "chrome/browser/ui/views/location_bar/location_icon_view.h" | 19 #include "chrome/browser/ui/views/location_bar/location_icon_view.h" |
| 20 #include "chrome/browser/ui/views/page_info_bubble_view.h" | 20 #include "chrome/browser/ui/views/page_info_bubble_view.h" |
| 21 #include "chrome/browser/ui/views/reload_button.h" | 21 #include "chrome/browser/ui/views/reload_button.h" |
| 22 #include "content/public/browser/navigation_controller.h" | 22 #include "content/public/browser/navigation_controller.h" |
| 23 #include "content/public/browser/navigation_entry.h" | 23 #include "content/public/browser/navigation_entry.h" |
| 24 #include "content/public/browser/web_contents.h" | 24 #include "content/public/browser/web_contents.h" |
| 25 #include "grit/generated_resources.h" | 25 #include "grit/generated_resources.h" |
| 26 #include "grit/theme_resources.h" | 26 #include "grit/theme_resources.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 | 94 |
| 95 namespace chromeos { | 95 namespace chromeos { |
| 96 | 96 |
| 97 // Stub implementation of ContentSettingBubbleModelDelegate. | 97 // Stub implementation of ContentSettingBubbleModelDelegate. |
| 98 class StubBubbleModelDelegate : public ContentSettingBubbleModelDelegate { | 98 class StubBubbleModelDelegate : public ContentSettingBubbleModelDelegate { |
| 99 public: | 99 public: |
| 100 StubBubbleModelDelegate() {} | 100 StubBubbleModelDelegate() {} |
| 101 virtual ~StubBubbleModelDelegate() {} | 101 virtual ~StubBubbleModelDelegate() {} |
| 102 | 102 |
| 103 // ContentSettingBubbleModelDelegate implementation: | 103 // ContentSettingBubbleModelDelegate implementation: |
| 104 virtual void ShowCollectedCookiesDialog( | 104 virtual void ShowCollectedCookiesDialog(TabContents* contents) OVERRIDE { |
| 105 TabContentsWrapper* contents) OVERRIDE { | |
| 106 } | 105 } |
| 107 | 106 |
| 108 virtual void ShowContentSettingsPage(ContentSettingsType type) OVERRIDE { | 107 virtual void ShowContentSettingsPage(ContentSettingsType type) OVERRIDE { |
| 109 } | 108 } |
| 110 | 109 |
| 111 private: | 110 private: |
| 112 DISALLOW_COPY_AND_ASSIGN(StubBubbleModelDelegate); | 111 DISALLOW_COPY_AND_ASSIGN(StubBubbleModelDelegate); |
| 113 }; | 112 }; |
| 114 | 113 |
| 115 // SimpleWebViewDialog class --------------------------------------------------- | 114 // SimpleWebViewDialog class --------------------------------------------------- |
| (...skipping 28 matching lines...) Expand all Loading... |
| 144 web_view_ = web_view_container_.get(); | 143 web_view_ = web_view_container_.get(); |
| 145 | 144 |
| 146 // We create the WebContents ourselves because the TCW assumes ownership of | 145 // We create the WebContents ourselves because the TCW assumes ownership of |
| 147 // it. This should be reworked once we don't need to use the TCW here. | 146 // it. This should be reworked once we don't need to use the TCW here. |
| 148 WebContents* web_contents = | 147 WebContents* web_contents = |
| 149 WebContents::Create(ProfileManager::GetDefaultProfile(), | 148 WebContents::Create(ProfileManager::GetDefaultProfile(), |
| 150 NULL, | 149 NULL, |
| 151 MSG_ROUTING_NONE, | 150 MSG_ROUTING_NONE, |
| 152 NULL, | 151 NULL, |
| 153 NULL); | 152 NULL); |
| 154 wrapper_.reset(new TabContentsWrapper(web_contents)); | 153 tab_contents_.reset(new TabContents(web_contents)); |
| 155 web_view_->SetWebContents(web_contents); | 154 web_view_->SetWebContents(web_contents); |
| 156 web_contents->SetDelegate(this); | 155 web_contents->SetDelegate(this); |
| 157 web_view_->LoadInitialURL(url); | 156 web_view_->LoadInitialURL(url); |
| 158 } | 157 } |
| 159 | 158 |
| 160 void SimpleWebViewDialog::Init() { | 159 void SimpleWebViewDialog::Init() { |
| 161 set_background(views::Background::CreateSolidBackground(SK_ColorWHITE)); | 160 set_background(views::Background::CreateSolidBackground(SK_ColorWHITE)); |
| 162 | 161 |
| 163 // Back/Forward buttons. | 162 // Back/Forward buttons. |
| 164 back_ = new views::ImageButton(this); | 163 back_ = new views::ImageButton(this); |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 | 395 |
| 397 void SimpleWebViewDialog::UpdateReload(bool is_loading, bool force) { | 396 void SimpleWebViewDialog::UpdateReload(bool is_loading, bool force) { |
| 398 if (reload_) { | 397 if (reload_) { |
| 399 reload_->ChangeMode( | 398 reload_->ChangeMode( |
| 400 is_loading ? ReloadButton::MODE_STOP : ReloadButton::MODE_RELOAD, | 399 is_loading ? ReloadButton::MODE_STOP : ReloadButton::MODE_RELOAD, |
| 401 force); | 400 force); |
| 402 } | 401 } |
| 403 } | 402 } |
| 404 | 403 |
| 405 } // namespace chromeos | 404 } // namespace chromeos |
| OLD | NEW |