Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(114)

Side by Side Diff: chrome/browser/extensions/extension_tabs_module.cc

Issue 8983010: Convert WebContents to return a content::NavigationController instead of the implementation. Upda... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix mac Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_tabs_module.h" 5 #include "chrome/browser/extensions/extension_tabs_module.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 28 matching lines...) Expand all
39 #include "chrome/common/chrome_notification_types.h" 39 #include "chrome/common/chrome_notification_types.h"
40 #include "chrome/common/chrome_switches.h" 40 #include "chrome/common/chrome_switches.h"
41 #include "chrome/common/extensions/extension.h" 41 #include "chrome/common/extensions/extension.h"
42 #include "chrome/common/extensions/extension_error_utils.h" 42 #include "chrome/common/extensions/extension_error_utils.h"
43 #include "chrome/common/extensions/extension_messages.h" 43 #include "chrome/common/extensions/extension_messages.h"
44 #include "chrome/common/pref_names.h" 44 #include "chrome/common/pref_names.h"
45 #include "chrome/common/url_constants.h" 45 #include "chrome/common/url_constants.h"
46 #include "content/browser/renderer_host/backing_store.h" 46 #include "content/browser/renderer_host/backing_store.h"
47 #include "content/browser/renderer_host/render_view_host.h" 47 #include "content/browser/renderer_host/render_view_host.h"
48 #include "content/browser/renderer_host/render_view_host_delegate.h" 48 #include "content/browser/renderer_host/render_view_host_delegate.h"
49 #include "content/browser/tab_contents/navigation_controller.h"
50 #include "content/browser/tab_contents/tab_contents_view.h" 49 #include "content/browser/tab_contents/tab_contents_view.h"
50 #include "content/public/browser/navigation_controller.h"
51 #include "content/public/browser/navigation_entry.h" 51 #include "content/public/browser/navigation_entry.h"
52 #include "content/public/browser/notification_details.h" 52 #include "content/public/browser/notification_details.h"
53 #include "content/public/browser/notification_source.h" 53 #include "content/public/browser/notification_source.h"
54 #include "content/public/browser/web_contents.h" 54 #include "content/public/browser/web_contents.h"
55 #include "skia/ext/image_operations.h" 55 #include "skia/ext/image_operations.h"
56 #include "skia/ext/platform_canvas.h" 56 #include "skia/ext/platform_canvas.h"
57 #include "third_party/skia/include/core/SkBitmap.h" 57 #include "third_party/skia/include/core/SkBitmap.h"
58 #include "ui/gfx/codec/jpeg_codec.h" 58 #include "ui/gfx/codec/jpeg_codec.h"
59 #include "ui/gfx/codec/png_codec.h" 59 #include "ui/gfx/codec/png_codec.h"
60 60
(...skipping 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after
1065 } else { 1065 } else {
1066 EXTENSION_FUNCTION_VALIDATE(tab_value->GetAsInteger(&tab_id)); 1066 EXTENSION_FUNCTION_VALIDATE(tab_value->GetAsInteger(&tab_id));
1067 } 1067 }
1068 1068
1069 int tab_index = -1; 1069 int tab_index = -1;
1070 TabStripModel* tab_strip = NULL; 1070 TabStripModel* tab_strip = NULL;
1071 if (!GetTabById(tab_id, profile(), include_incognito(), 1071 if (!GetTabById(tab_id, profile(), include_incognito(),
1072 NULL, &tab_strip, &contents, &tab_index, &error_)) { 1072 NULL, &tab_strip, &contents, &tab_index, &error_)) {
1073 return false; 1073 return false;
1074 } 1074 }
1075 NavigationController& controller = contents->web_contents()->GetController(); 1075 content::NavigationController& controller =
1076 contents->web_contents()->GetController();
1076 1077
1077 // TODO(rafaelw): handle setting remaining tab properties: 1078 // TODO(rafaelw): handle setting remaining tab properties:
1078 // -title 1079 // -title
1079 // -favIconUrl 1080 // -favIconUrl
1080 1081
1081 // Navigate the tab to a new location if the url is different. 1082 // Navigate the tab to a new location if the url is different.
1082 std::string url_string; 1083 std::string url_string;
1083 if (update_props->HasKey(keys::kUrlKey)) { 1084 if (update_props->HasKey(keys::kUrlKey)) {
1084 EXTENSION_FUNCTION_VALIDATE(update_props->GetString( 1085 EXTENSION_FUNCTION_VALIDATE(update_props->GetString(
1085 keys::kUrlKey, &url_string)); 1086 keys::kUrlKey, &url_string));
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after
1661 // called for every API call the extension made. 1662 // called for every API call the extension made.
1662 GotLanguage(language); 1663 GotLanguage(language);
1663 } 1664 }
1664 1665
1665 void DetectTabLanguageFunction::GotLanguage(const std::string& language) { 1666 void DetectTabLanguageFunction::GotLanguage(const std::string& language) {
1666 result_.reset(Value::CreateStringValue(language.c_str())); 1667 result_.reset(Value::CreateStringValue(language.c_str()));
1667 SendResponse(true); 1668 SendResponse(true);
1668 1669
1669 Release(); // Balanced in Run() 1670 Release(); // Balanced in Run()
1670 } 1671 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698